Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 22e2b2f

Browse files
committed
closes #265
1 parent dc96fc9 commit 22e2b2f

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

lib/hyper-react.rb

+3-16
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
11
require 'hyperloop-config'
22
Hyperloop.import 'hyper-store'
3-
Hyperloop.import 'react/react-source-browser', client_only: true
4-
Hyperloop.import 'react/react-source-server', server_only: true
3+
Hyperloop.js_import 'react/react-source-browser', client_only: true, defines: ['ReactDOM', 'React']
4+
Hyperloop.js_import 'react/react-source-server', server_only: true, defines: 'React'
55
Hyperloop.import 'browser/delay', client_only: true
66
Hyperloop.import 'hyper-react'
7-
Hyperloop.import 'react_ujs'
7+
Hyperloop.js_import 'react_ujs', defines: 'ReactRailsUJS'
88

99
if RUBY_ENGINE == 'opal'
1010
module Hyperloop
1111
class Component
1212
end
1313
end
14-
15-
if `Opal.global.React === undefined || Opal.global.React.version === undefined`
16-
raise [
17-
"No React.js Available",
18-
"",
19-
"A global `React` must be defined before requiring 'hyper-react'",
20-
"",
21-
"To USE THE BUILT-IN SOURCE: ",
22-
" add 'require \"react/react-source-browser\"' immediately before the 'require \"hyper-react\" directive.",
23-
"IF USING WEBPACK:",
24-
" add 'react' to your webpack manifest."
25-
].join("\n")
26-
end
2714
require 'react/top_level'
2815
require 'react/top_level_render'
2916
require 'react/observable'

0 commit comments

Comments
 (0)