react-rails 3.2.1 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -6
- data/README.md +17 -2
- data/lib/assets/javascripts/react_ujs.js +1 -1
- data/lib/assets/react-source/development/react-server.js +240 -178
- data/lib/assets/react-source/development/react.js +74 -68
- data/lib/assets/react-source/production/react-server.js +1 -1
- data/lib/assets/react-source/production/react.js +1 -1
- data/lib/react/rails/railtie.rb +34 -5
- data/lib/react/rails/version.rb +1 -1
- data/lib/react/server_rendering/bundle_renderer.rb +2 -0
- data/lib/react/server_rendering/propshaft_container.rb +22 -0
- data/lib/react/server_rendering.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b5e1ccdeab785c0b331f0ed14526d51b1c9e0664155c97a2a0d76cf83256178
|
|
4
|
+
data.tar.gz: 30e201fae747df7226067519c57d04f1d08bd0761d23fe705d4ba062a6b24f68
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 54cef1d88db5e4f2da26f180595bd0fcf9c1580d98e51a543f8c48718868be80984b3532289960b635f64dcc56af17c8e6984f5523720e33781decabd09a97dd
|
|
7
|
+
data.tar.gz: aa7865684c1080db96759a49dffa7ef5d82937535e2dba043eac766be40b85deaeea32ba14529371426aacc28179b7b0515a5a332340dde92fb1333fe41566d9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog for React-Rails
|
|
2
2
|
|
|
3
|
-
If you need help upgrading `react-rails`, `webpacker` to `shakapacker`, or JS packages, contact justin@shakacode.com.
|
|
3
|
+
If you need help upgrading `react-rails`, `webpacker` to `shakapacker`, or JS packages, contact justin@shakacode.com. We can upgrade your project and improve your development and customer experiences, allowing you to focus on building new features or fixing bugs instead.
|
|
4
4
|
|
|
5
|
-
[
|
|
5
|
+
For an overview of working with us, see our [Client Engagement Model](https://www.shakacode.com/blog/client-engagement-model/) article and [how we bill for time](https://www.shakacode.com/blog/shortcut-jira-trello-github-toggl-time-and-task-tracking/).
|
|
6
|
+
|
|
7
|
+
We also specialize in helping development teams lower infrastructure and CI costs. Check out our project [Control Plane Flow](https://github.com/shakacode/control-plane-flow/), which can allow you to get the ease of Heroku with the power of Kubernetes and big cost savings.
|
|
8
|
+
|
|
9
|
+
If you think ShakaCode can help your project, [click here](https://meetings.hubspot.com/justingordon/30-minute-consultation) to book a call with [Justin Gordon](mailto:justin@shakacode.com), the creator of React on Rails and Shakapacker.
|
|
10
|
+
|
|
11
|
+
You also might want to consider the [react_on_rails](https://github.com/shakacode/react_on_rails) gem.
|
|
6
12
|
|
|
7
13
|
## Unreleased
|
|
8
14
|
Changes since the last non-beta release.
|
|
9
15
|
|
|
10
|
-
_Please add entries here for your pull requests that
|
|
16
|
+
_Please add entries here for your pull requests that have not yet been released. Include LINKS for PRs and committers._
|
|
17
|
+
|
|
18
|
+
## [3.3.1] - 2026-05-15
|
|
19
|
+
|
|
20
|
+
#### Fixed
|
|
21
|
+
- Preserve default controller layouts for `render component:` after the Rails 8 render pipeline change. [PR 1418](https://github.com/reactjs/react-rails/pull/1418) by [justin808](https://github.com/justin808). Fixes [#1356](https://github.com/reactjs/react-rails/issues/1356).
|
|
22
|
+
- Remove unneeded runtime dependencies. [PR 1420](https://github.com/reactjs/react-rails/pull/1420) by [G-Rath](https://github.com/g-rath).
|
|
23
|
+
- Fix Propshaft asset version cache busting so server-rendered bundles invalidate correctly when assets change. [PR 1403](https://github.com/reactjs/react-rails/pull/1403).
|
|
24
|
+
|
|
25
|
+
## [3.3.0] - 2026-03-31
|
|
26
|
+
|
|
27
|
+
#### Added
|
|
28
|
+
- Support for Propshaft server rendering. [PR 1345](https://github.com/reactjs/react-rails/pull/1345) by [elektronaut](https://github.com/elektronaut)
|
|
29
|
+
|
|
30
|
+
#### Fixed
|
|
31
|
+
|
|
32
|
+
- Support `connection_pool` v3 [PR 1367](https://github.com/reactjs/react-rails/pull/1367) by [G-Rath](https://github.com/G-Rath).
|
|
33
|
+
|
|
34
|
+
## [3.2.1] - 2024-05-16
|
|
11
35
|
|
|
12
36
|
#### Fixed
|
|
13
|
-
- Replaced call to ReactRailsUJS.unmountComponents that was erroneously removed by
|
|
37
|
+
- Replaced call to ReactRailsUJS.unmountComponents that was erroneously removed by [PR 1290](https://github.com/reactjs/react-rails/pull/1305) in 3.0.0 [PR 1339](https://github.com/reactjs/react-rails/pull/1339).
|
|
14
38
|
|
|
15
39
|
- Prevent roots from being re-created when using React 18 [PR 1305](https://github.com/reactjs/react-rails/pull/1305) by [diogobeda](https://github.com/diogobeda)
|
|
16
40
|
|
|
@@ -48,6 +72,8 @@ _Please add entries here for your pull requests that are not yet released. Inclu
|
|
|
48
72
|
|
|
49
73
|
## [2.7.0] - 2023-05-06
|
|
50
74
|
|
|
75
|
+
[#1209 2.7 Release Discussion](https://github.com/reactjs/react-rails/issues/1209)
|
|
76
|
+
|
|
51
77
|
#### New Features
|
|
52
78
|
- Camelizes keys with primitive values, in addition to hashes #946
|
|
53
79
|
- Expose alternative implementations for `ReactUJS.getConstructor` #1050
|
|
@@ -578,7 +604,10 @@ _Please add entries here for your pull requests that are not yet released. Inclu
|
|
|
578
604
|
- Server rendering with `prerender: true`
|
|
579
605
|
- Transform `.jsx` in the asset pipeline
|
|
580
606
|
|
|
581
|
-
[Unreleased]: https://github.com/reactjs/react-rails/compare/v3.
|
|
607
|
+
[Unreleased]: https://github.com/reactjs/react-rails/compare/v3.3.1...main
|
|
608
|
+
[3.3.1]: https://github.com/reactjs/react-rails/compare/v3.3.0...v3.3.1
|
|
609
|
+
[3.3.0]: https://github.com/reactjs/react-rails/compare/v3.2.1...v3.3.0
|
|
610
|
+
[3.2.1]: https://github.com/reactjs/react-rails/compare/v3.2.0...v3.2.1
|
|
582
611
|
[3.2.0]: https://github.com/reactjs/react-rails/compare/v3.1.1...v3.2.0
|
|
583
612
|
[3.1.1]: https://github.com/reactjs/react-rails/compare/v3.1.0...v3.1.1
|
|
584
613
|
[3.1.0]: https://github.com/reactjs/react-rails/compare/v3.0.0...v3.1.0
|
data/README.md
CHANGED
|
@@ -10,6 +10,7 @@ For version 2.7 documentation, visit the [2.7-stable](https://github.com/reactjs
|
|
|
10
10
|
React-Rails is a flexible tool to use [React](http://facebook.github.io/react/) with Rails. The benefits:
|
|
11
11
|
* Automatically renders React server-side and client-side
|
|
12
12
|
* Supports [Shakapacker](https://github.com/shakacode/shakapacker) v7
|
|
13
|
+
* Supports Propshaft
|
|
13
14
|
* Supports Sprockets 4.x, 3.x
|
|
14
15
|
* 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/)
|
|
15
16
|
|
|
@@ -17,9 +18,11 @@ React-Rails is a flexible tool to use [React](http://facebook.github.io/react/)
|
|
|
17
18
|
|
|
18
19
|
While ShakaCode will continue to support this gem, you might consider migrating to [React on Rails](https://github.com/shakacode/react_on_rails) or [React on Rails Pro with proper Node rendering](https://www.shakacode.com/react-on-rails-pro/).
|
|
19
20
|
|
|
20
|
-
Why? React on Rails code receives much more active development and testing. For example, consider the [ReactRailsUJS](https://github.com/reactjs/react-rails/blob/
|
|
21
|
+
Why? React on Rails code receives much more active development and testing. For example, consider the [ReactRailsUJS](https://github.com/reactjs/react-rails/blob/main/react_ujs/index.js) implementation compared to the [ReactOnRails Node package](https://github.com/shakacode/react_on_rails/tree/master/node_package) which is written in TypeScript. For another example, React on Rails has work underway to support the latest React features, such as [React Server Components](https://react.dev/reference/rsc/server-components).
|
|
21
22
|
|
|
22
|
-
You can find [migration to React on Rails steps here](https://github.com/reactjs/react-rails/blob/
|
|
23
|
+
You can find [migration to React on Rails steps here](https://github.com/reactjs/react-rails/blob/main/docs/migrating-from-react-rails-to-react_on_rails.md).
|
|
24
|
+
|
|
25
|
+
For the fastest path, try the [LLM-assisted migration prompt](https://github.com/reactjs/react-rails/blob/main/docs/migrating-from-react-rails-to-react_on_rails.md#llm-assisted-migration-prompt).
|
|
23
26
|
|
|
24
27
|
---
|
|
25
28
|
## ShakaCode Support
|
|
@@ -133,6 +136,18 @@ The following companies provide licenses to the ShakaCode team, supporting the d
|
|
|
133
136
|
<img alt="BrowserStack" src="https://user-images.githubusercontent.com/4244251/184881129-e1edf4b7-3ae1-4ea8-9e6d-3595cf01609e.png" height="55px">
|
|
134
137
|
</picture>
|
|
135
138
|
</a>
|
|
139
|
+
<a href="https://www.honeybadger.io/">
|
|
140
|
+
<picture>
|
|
141
|
+
<img alt="HoneyBadger" src="https://user-images.githubusercontent.com/4244251/184881133-79ee9c3c-8165-4852-958e-31687b9536f4.png" height="70px">
|
|
142
|
+
</picture>
|
|
143
|
+
</a>
|
|
144
|
+
<a href="https://coderabbit.ai">
|
|
145
|
+
<picture>
|
|
146
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://victorious-bubble-f69a016683.media.strapiapp.com/White_Typemark_7229870ac5.svg">
|
|
147
|
+
<source media="(prefers-color-scheme: light)" srcset="https://victorious-bubble-f69a016683.media.strapiapp.com/Orange_Typemark_7958cfa790.svg">
|
|
148
|
+
<img alt="CodeRabbit" src="https://victorious-bubble-f69a016683.media.strapiapp.com/Orange_Typemark_7958cfa790.svg" height="55px">
|
|
149
|
+
</picture>
|
|
150
|
+
</a>
|
|
136
151
|
|
|
137
152
|
---
|
|
138
153
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server"],t):"object"==typeof exports?exports.ReactRailsUJS=t(require("react"),require("react-dom"),require("react-dom/server")):e.ReactRailsUJS=t(e.React,e.ReactDOM,e.ReactDOMServer)}(self,(
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server"],t):"object"==typeof exports?exports.ReactRailsUJS=t(require("react"),require("react-dom"),require("react-dom/server")):e.ReactRailsUJS=t(e.React,e.ReactDOM,e.ReactDOMServer)}(self,(__WEBPACK_EXTERNAL_MODULE__442__,__WEBPACK_EXTERNAL_MODULE__3__,__WEBPACK_EXTERNAL_MODULE__612__)=>(()=>{var __webpack_modules__={470(e,t,n){"use strict";var o=n(3);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot},237(e,t,n){var o=n(442),r=n(3),a=n(612),u=n(181),c=n(682),i=n(863),d=n(518),s=n(963),{supportsHydration:_,reactHydrate:l,createReactRootLike:p}=n(946),f=n(428),v={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:"undefined"!=typeof window&&void 0!==window.jQuery&&window.jQuery,components:{},roots:[],findDOMNodes:function(e){var t,n,o=v.CLASS_NAME_ATTR;switch(typeof e){case"undefined":t="["+o+"]",n=document;break;case"object":t="["+o+"]",n=e;break;case"string":t=e+"["+o+"], "+e+" ["+o+"]",n=document}return v.jQuery?v.jQuery(t,n):n.querySelectorAll(t)},getConstructor:c,constructorFromGlobal:c,constructorFromRequireContext:i,constructorFromRequireContextWithGlobalFallback:d,useContext:function(e){this.getConstructor=d(e)},useContexts:function(e){this.getConstructor=s(e)},serverRender:function(e,t,n){var r=this.getConstructor(t),u=o.createElement(r,n);return a[e](u)},mountComponents:function(e){for(var t=v,n=t.findDOMNodes(e),r=0;r<n.length;++r){var a=n[r],u=a.getAttribute(t.CLASS_NAME_ATTR),c=t.getConstructor(u),i=a.getAttribute(t.PROPS_ATTR),d=i&&JSON.parse(i),s=a.getAttribute(t.RENDER_ATTR),p=a.getAttribute(t.CACHE_ID_ATTR),f=a.hasAttribute(t.TURBOLINKS_PERMANENT_ATTR);if(!c){var E="Cannot find component: '"+u+"'";throw console&&console.log&&console.log("%c[react-rails] %c"+E+" for element","font-weight: bold","",a),new Error(E+". Make sure your component is available to render.")}var h=this.components[p];void 0===h&&(h=o.createElement(c,d),f&&(this.components[p]=h)),h=s&&_()?l(a,h):this.findOrCreateRoot(a).render(h)}},unmountComponents:function(e){for(var t=v.findDOMNodes(e),n=0;n<t.length;++n){var o=t[n];f?this.unmountRoot(o):r.unmountComponentAtNode(o)}},detectEvents:function(){u(this)},findOrCreateRoot:function(e){var t=this.findRoot(e);return t||(t=p(e),f&&this.roots.push({node:e,root:t})),t},findRoot:function(e){if(f){var t=this.roots.find(function(t){return t.node&&t.node===e});return t?t.root:void 0}},unmountRoot:function(e){var t=this.findRoot(e);t&&(t.unmount(),this.roots=this.roots.filter(function(t){return t.node!==e}))},handleMount:function(e){var t=void 0;e&&e.target&&(t=e.target),v.mountComponents(t)},handleUnmount:function(e){var t=void 0;e&&e.target&&(t=e.target),v.unmountComponents(t)}};"undefined"!=typeof window&&v.detectEvents(),self.ReactRailsUJS=v,e.exports=v},181(e,t,n){var o=n(821),r=n(177),a=n(387),u=n(30),c=n(779);e.exports=function(e){e.handleEvent&&("undefined"!=typeof Turbolinks&&void 0!==Turbolinks.EVENTS&&c.teardown(e),a.teardown(e),u.teardown(e),r.teardown(e),o.teardown(e)),"addEventListener"in window?(e.handleEvent=function(e,t){document.addEventListener(e,t)},e.removeEvent=function(e,t){document.removeEventListener(e,t)}):(e.handleEvent=function(e,t){window.attachEvent(e,t)},e.removeEvent=function(e,t){window.detachEvent(e,t)}),"undefined"!=typeof Turbolinks&&Turbolinks.supported?void 0!==Turbolinks.EVENTS?c.setup(e):void 0!==Turbolinks.controller?a.setup(e):u.setup(e):"undefined"!=typeof $&&"function"==typeof $.pjax?r.setup(e):o.setup(e)}},821(e){e.exports={setup:function(e){"addEventListener"in window?e.handleEvent("DOMContentLoaded",e.handleMount):e.handleEvent("onload",e.handleMount)},teardown:function(e){e.removeEvent("DOMContentLoaded",e.handleMount),e.removeEvent("onload",e.handleMount)}}},177(e){e.exports={setup:function(e){e.handleEvent("ready",e.handleMount),e.handleEvent("pjax:end",e.handleMount),e.handleEvent("pjax:beforeReplace",e.handleUnmount)},teardown:function(e){e.removeEvent("ready",e.handleMount),e.removeEvent("pjax:end",e.handleMount),e.removeEvent("pjax:beforeReplace",e.handleUnmount)}}},387(e){e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount)}}},779(e){e.exports={setup:function(e){e.handleEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)},teardown:function(e){e.removeEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)}}},30(e){e.exports={setup:function(e){Turbolinks.pagesCached(0),e.handleEvent("page:change",e.handleMount),e.handleEvent("page:receive",e.handleUnmount)},teardown:function(e){e.removeEvent("page:change",e.handleMount),e.removeEvent("page:receive",e.handleUnmount)}}},682(module){var topLevel="undefined"==typeof window?this:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor.default&&(constructor=constructor.default),constructor}},863(e){e.exports=function(e){return function(t){var n=t.split("."),o=n.shift(),r=n,a=e("./"+o);return r.forEach(function(e){a=a[e]}),a.__esModule&&(a=a.default),a}}},518(e,t,n){var o=n(682),r=n(863);e.exports=function(e){var t=r(e);return function(e){var n;try{n=t(e)}catch(t){try{n=o(e)}catch(e){console.error(t),console.error(e)}}return n}}},963(e,t,n){var o=n(682),r=n(863);e.exports=function(e){var t=e.map(e=>r(e));return function(e){var n;try{var r,a,u=0;do{r=t[u];try{n=r(e)}catch(e){a||(a=e)}u+=1}while(u<t.length);if(!n)throw a}catch(a){try{n=o(e)}catch(e){console.error(a),console.error(e)}}return n}}},946(e,t,n){"use strict";n.r(t),n.d(t,{createReactRootLike:()=>_,reactHydrate:()=>s,supportsHydration:()=>d});var o=n(3),r=n.n(o),a=n(428),u=n.n(a);let c=r();if(u())try{c=n(470)}catch(e){c=r()}const i=c;function d(){return"function"==typeof i.hydrate||"function"==typeof i.hydrateRoot}function s(e,t){return"function"==typeof i.hydrateRoot?i.hydrateRoot(e,t):i.hydrate(t,e)}function _(e){return u()?i.createRoot(e):function(e){return{render:t=>i.render(t,e)}}(e)}},428(e,t,n){var o,r=n(3);o=void 0!==r&&(r.version.split(".")[0]||16)>=18,e.exports=o},442(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__442__},3(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__3__},612(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__612__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(237);return __webpack_exports__})());
|