You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ _Please add entries here for your pull requests that are not yet released._
12
12
### Breaking Changes
13
13
- Remove support & testing for Webpacker 3/4.
14
14
- Add support & testing for Shakapacker v6
15
-
- Requires separate compilations for server & client bundles (see [Webpack config](https://github.com/reactjs/react-rails/blob/judahmeek/workingCI/test/dummy/config/webpack))
15
+
- Requires separate compilations for server & client bundles (see [Webpack config](https://github.com/reactjs/react-rails/tree/master/test/dummy/config/webpack))
16
16
- Replaces WebpackManifestContainer, which searched for assets in the webpack manifest, with SeparateServerBundleContainer, which expects a single server bundle file & does not use the webpack manifest at all.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -94,13 +94,17 @@ To develop the React_UJS NPM Package, make your changes and run `npm pack` to ma
94
94
95
95
##### Running tests
96
96
97
+
Run `yalc publish --push` in the root directory of the gem to ensure the test suites use the exact same js code used in the currenlty developing ReactRails.
98
+
97
99
`bundle exec appraisal install` to install gems on every gemfile Appraisal contains.
98
100
`rake test` or `bundle exec appraisal rake test` runs everything.
99
101
or run a specific suite using `bundle exec appraisal <appraisal name> rake test`
100
102
- Find appraisal names in [Appraisals](Appraisals)
101
103
- Integration tests run in Headless Chrome which is included in Chrome (59+ linux,OSX | 60+ Windows)
102
104
- ChromeDriver is included with `chromedriver-helper` gem so no need to manually install that 👍
103
105
106
+
**Note:** If using Ruby 2.7, set `MT_KWARGS_HACK=1` to ensure Minitest runs smoothly.
107
+
104
108
##### Updating the pre-bundled react
105
109
- Update React with `rake react:update`
106
110
It outputs an ironically webpacked couple of files into `lib/assets/react-source/<environment>/react(-server).js` where it will be picked up by `sprockets` in `lib/react/rails/asset_variant.rb`
v2.7.1 is released. Please try it out and report any issues. We'll try to address any critical issues ASAP. We're going shortly release 3.0, which fully support Shakapacker v6, including SSR.
8
+
V3.0.0 is released with Shakapacker v6 support, including SSR. Please try it out and report any issues. We'll try to address any critical issues ASAP.
9
+
10
+
For version 2.7 documentation checkout [2.7-stable](https://github.com/reactjs/react-rails/tree/2.7-stable) branch.
9
11
10
12
## Summary
11
13
React-Rails is a flexible tool to use [React](http://facebook.github.io/react/) with Rails. The benefits:
12
14
* Automatically renders React server-side and client-side
13
-
* Supports Webpacker 4.x, 3.x, 2.x, 1.1+ or Shakapacker v6+
* Lets you use [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html), [ES6](http://es6-features.org/), [TypeScript](https://www.typescriptlang.org/), [CoffeeScript](http://coffeescript.org/)
16
18
17
19
---
@@ -64,10 +66,10 @@ Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=
-[Getting warning for `Can't resolve 'react-dom/client'` in React < 18](#getting-warning-for-cant-resolve-react-domclient-in-react--18)
70
-
-[During installation](#during-installation)
71
73
-[Undefined Set](#undefined-set)
72
74
-[Using TheRubyRacer](#using-therubyracer)
73
75
-[HMR](#hmr)
@@ -491,7 +493,7 @@ ReactRailsUJS.detectEvents()
491
493
492
494
For example, if `Turbolinks` is loaded _after_`ReactRailsUJS`, you'll need to call this again. This function removes previous handlers before adding new ones, so it's safe to call as often as needed.
493
495
494
-
If `Turbolinks` is `import`ed via Webpacker (and thus not available globally), `ReactRailsUJS` will be unable to locate it. To fix this, you can temporarily add it to the global namespace:
496
+
If `Turbolinks` is `import`ed via Shakapacker (and thus not available globally), `ReactRailsUJS` will be unable to locate it. To fix this, you can temporarily add it to the global namespace:
495
497
496
498
```js
497
499
// Order is particular. First start Turbolinks:
@@ -545,6 +547,7 @@ Server rendering is powered by [`ExecJS`](https://github.com/rails/execjs) and s
545
547
546
548
-`react-rails` must load your code. By convention, it uses `server_rendering.js`, which was created
547
549
by the install task. This file must include your components _and_ their dependencies (eg, Underscore.js).
550
+
- Requires separate compilations for server & client bundles (see [Webpack config](https://github.com/reactjs/react-rails/tree/master/test/dummy/config/webpack))
548
551
- Your code can't reference `document` or `window`. Prerender processes don't have access to `document` or `window`,
549
552
so jQuery and some other libs won't work in this environment :(
550
553
@@ -775,6 +778,11 @@ For example, to change the [ES6 Component template](https://github.com/reactjs/r
775
778
776
779
## Upgrading
777
780
781
+
### 2.7 to 3.0
782
+
- Keep your `react_ujs` up to date: `yarn upgrade`
783
+
-**Drop support for Webpacker:** Before any ReactRails upgrade, make sure upgrading from Webpacker to Shakapacker 6.x.
784
+
-**SSR:** ReactRails 3.x requires separate compilations for server & client bundles. See [Webpack config](https://github.com/reactjs/react-rails/tree/master/test/dummy/config/webpack) directory in the dummy app to addapt the new implementation.
785
+
778
786
### 2.3 to 2.4
779
787
780
788
Keep your `react_ujs` up to date, `yarn upgrade`
@@ -810,30 +818,6 @@ You may see a warning like this when building a Webpack bundle using any version
LibV8 itself is already [beyond version 7](https://github.com/cowboyd/libv8/releases/tag/v7.3.492.27.1) therefore many serverside issues are caused by old JS engines and fixed by using an up to date one such as [MiniRacer](https://github.com/discourse/mini_racer) or [TheRubyRhino](https://github.com/cowboyd/therubyrhino) on JRuby.
850
834
851
835
### HMR
852
-
Hot Module Replacement is [possible with this gem](https://stackoverflow.com/a/54846330/193785) as it does just pass through to Webpacker. Please open an issue to let us know tips and tricks for it to add to the wiki.
853
836
854
-
Sample repo that shows HMR working with `react-rails`: [https://github.com/edelgado/react-rails-hmr](https://github.com/edelgado/react-rails-hmr)
837
+
Check out [Enabling Hot Module Replacement (HMR)](https://github.com/shakacode/shakapacker/blob/master/docs/react.md#enabling-hot-module-replacement-hmr) in Shakapacker documentation.
855
838
856
839
One caveat is that currently you [cannot Server-Side Render along with HMR](https://github.com/reactjs/react-rails/issues/925#issuecomment-415469572).
0 commit comments