Commit 8f49d0b
committed
Define
* components making use of `window` can actually do it without the trick found in the `components.js` file of the dummy test app
* components/files packaged as CommonJS modules by browserify (using browserify-rails for instance) can successfully use `global`
For this second point, this fix is necessary because of the self-calling function browserify uses to wrap code that uses the `global` variable:
```ruby
(function (global){
global.MyComponent = React.createClass({ ... });
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
```
If `window` was used instead of `global`, it would still need the fix or the workaround found in the tests' dummy app as mentioned.self and window global objects in the combined JS code so that:1 parent b4051e1 commit 8f49d0b
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments