Skip to content

Commit 833b04a

Browse files
author
Robert Mosolgo
committed
Merge pull request #457 from danott/require-individual-addons
Pick-and-choose addons with Sprockets directives
2 parents e980a8a + 143dd8c commit 833b04a

39 files changed

+146090
-54675
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
#### New Features
66

7+
- Individual add-ons can be included in a bundle with sprockets require directives.
8+
79
#### Deprecation
810

911
#### Bug Fixes
1012

11-
- Add CHANGELOG to gem bundle #471
13+
- Add CHANGELOG to gem bundle #471
1214
- Use `window.attachEvent` to support IE8 without jQuery 😬#446
1315

1416
## 1.5.0 (November 25, 2015)

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ end
7676
After restarting your Rails server, `//= require react` will provide the build of React.js which
7777
was specified by the configurations.
7878

79+
If you want to hand-pick which add-ons are added to your build they are available via sprockets
80+
directives.
81+
82+
```js
83+
//= require react
84+
//= require react-addons-css-transition-group
85+
```
86+
7987
`react-rails` offers a few other options for versions & builds of React.js.
8088
See [VERSIONS.md](https://github.com/reactjs/react-rails/blob/master/VERSIONS.md) for more info about
8189
using the `react-source` gem or dropping in your own copies of React.js.

Rakefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,26 @@ namespace :react do
3131
# Without addons:
3232
copy_react_asset("#{environment}/react-browser.js", "#{environment}/react.js")
3333
copy_react_asset("#{environment}/react-server.js", "#{environment}/react-server.js")
34+
3435
# With addons:
3536
copy_react_asset("#{environment}/react-browser-with-addons.js", "#{environment}-with-addons/react.js")
3637
copy_react_asset("#{environment}/react-server-with-addons.js", "#{environment}-with-addons/react-server.js")
38+
39+
addons = %w(
40+
addons-clone-with-props
41+
addons-create-fragment
42+
addons-css-transition-group
43+
addons-linked-state-mixin
44+
addons-perf
45+
addons-pure-render-mixin
46+
addons-test-utils
47+
addons-transition-group
48+
addons-update
49+
)
50+
51+
addons.each do |name|
52+
copy_react_asset("#{environment}/react-#{name}.js", "#{environment}/react-#{name}.js")
53+
end
3754
end
3855
end
3956

0 commit comments

Comments
 (0)