react-rails 3.2.0 → 3.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f880539ce7f68ea781230ca57528e974c66e33f329e88e7033978c9d8243054d
4
- data.tar.gz: c84e9c0426a5a7acc67b7c0d2a06a1f183042fee201aa417971ba40bcf857634
3
+ metadata.gz: 13efe13ea9f8c571c9ea6e2b25381cb340bb5bae81e94c12b780e071ccd4bf7f
4
+ data.tar.gz: 1700688b3ac613a9d5f0809e3630c17cae42bc8317add6824354e6561d2e7201
5
5
  SHA512:
6
- metadata.gz: 26113545fd0ead4c41ad391c8685e97205d9d8a7d15b8b6200a7e331ccf359a4aae1e765aa94666c39d6a2b5530bb6828fe0bf9031917a5ce46eb75a30a0dae8
7
- data.tar.gz: 43f3f456fa55b25b13bc5fe5b3b535a1cff349b12f649ffcc1804ab49dbd13c0df8962c5fc1f9890ee4309137fa95f026ed0a58316ca71e670df9767551fed0f
6
+ metadata.gz: 1a256ed82761889a4c15c492489a296580d713ba5e1655bfcb562f1804a3e05cead1d9695663fa5baa678f181ac451913324fcf2eca9f75c6a1426302fa36b74
7
+ data.tar.gz: 9fe8da002d2b02d091dd06d1db5cccfe84e1f1d1f0464beebc333ac28f86835d3ccfdcf0aa1269d677ef530874b9c7d0835cfc04e66b50b10bed11a05e37f61f
data/CHANGELOG.md CHANGED
@@ -1,17 +1,41 @@
1
- # react-rails
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. The ShakaCode.com team is helping to maintain this Ruby gem. You also might want to consider the [react_on_rails](https://github.com/shakacode/react_on_rails) gem.
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
- [#1209 2.7 Release Discussion](https://github.com/reactjs/react-rails/issues/1209)
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 are not yet released._
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.0] - 2024-11-22
19
+
20
+ #### Added
21
+ - Support for Propshaft server rendering. [PR 1345](https://github.com/reactjs/react-rails/pull/1345) by [elektronaut](https://github.com/elektronaut)
22
+
23
+ #### Fixed
24
+
25
+ - Support `connection_pool` v3 [PR 1367](https://github.com/reactjs/react-rails/pull/1367) by [G-Rath](https://github.com/G-Rath).
26
+
27
+ ## [3.2.1] - 2024-05-16
28
+
29
+ #### Fixed
30
+ - 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).
31
+
32
+ - 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)
33
+
34
+ ## [3.2.0] - 2024-01-10
11
35
 
12
36
  #### Changed
37
+ - Support other JS package managers using `package_json` gem [PR #1306](https://github.com/reactjs/react-rails/pull/1306) by [G-Rath](https://github.com/G-Rath).
13
38
  - Make es6 and ts usable at same time. #1299
14
- - Support other JS package managers using `package_json` gem #1306
15
39
 
16
40
  ## [3.1.1] - 2023-08-16
17
41
 
@@ -26,7 +50,7 @@ _Please add entries here for your pull requests that are not yet released._
26
50
  ## [3.0.0] - 2023-08-14
27
51
 
28
52
  ### Breaking Changes
29
- - Requires separate compilations for server & client bundles if using Shakapacker (see [Webpack config](https://github.com/reactjs/react-rails/tree/master/test/dummy/config/webpack)) #1274
53
+ - Requires separate compilations for server & client bundles if using Shakapacker (see [Webpack config](https://github.com/reactjs/react-rails/tree/main/test/dummy/config/webpack)) #1274
30
54
  - 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. #1274
31
55
  - Upgrades React-Rails' embedded react to v18.2.0. Uses node polyfill plugin & fast-text-encoder for SSR text encoding. #1290
32
56
  - If using Webpacker/Shakapacker, requires upgrading to Shakapacker v7 #1274 and #1285
@@ -41,6 +65,8 @@ _Please add entries here for your pull requests that are not yet released._
41
65
 
42
66
  ## [2.7.0] - 2023-05-06
43
67
 
68
+ [#1209 2.7 Release Discussion](https://github.com/reactjs/react-rails/issues/1209)
69
+
44
70
  #### New Features
45
71
  - Camelizes keys with primitive values, in addition to hashes #946
46
72
  - Expose alternative implementations for `ReactUJS.getConstructor` #1050
@@ -571,7 +597,10 @@ _Please add entries here for your pull requests that are not yet released._
571
597
  - Server rendering with `prerender: true`
572
598
  - Transform `.jsx` in the asset pipeline
573
599
 
574
- [Unreleased]: https://github.com/reactjs/react-rails/compare/v3.1.1...master
600
+ [Unreleased]: https://github.com/reactjs/react-rails/compare/v3.3.0...main
601
+ [3.3.0]: https://github.com/reactjs/react-rails/compare/v3.2.1...v3.3.0
602
+ [3.2.1]: https://github.com/reactjs/react-rails/compare/v3.2.0...v3.2.1
603
+ [3.2.0]: https://github.com/reactjs/react-rails/compare/v3.1.1...v3.2.0
575
604
  [3.1.1]: https://github.com/reactjs/react-rails/compare/v3.1.0...v3.1.1
576
605
  [3.1.0]: https://github.com/reactjs/react-rails/compare/v3.0.0...v3.1.0
577
606
  [3.0.0]: https://github.com/reactjs/react-rails/compare/v2.7.1...v3.0.0
data/README.md CHANGED
@@ -4,24 +4,36 @@
4
4
  [![npm](https://img.shields.io/npm/v/react_ujs.svg?style=flat-square)](https://www.npmjs.com/package/react_ujs)
5
5
  [![Ruby](https://github.com/reactjs/react-rails/actions/workflows/ruby.yml/badge.svg)](https://github.com/reactjs/react-rails/actions/workflows/ruby.yml)
6
6
 
7
- ## News
8
- V3.0.0 is released with Shakapacker v7 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.
7
+ For version 2.7 documentation, visit the [2.7-stable](https://github.com/reactjs/react-rails/tree/2.7-stable) branch.
11
8
 
12
9
  ## Summary
13
10
  React-Rails is a flexible tool to use [React](http://facebook.github.io/react/) with Rails. The benefits:
14
11
  * Automatically renders React server-side and client-side
15
12
  * Supports [Shakapacker](https://github.com/shakacode/shakapacker) v7
13
+ * Supports Propshaft
16
14
  * Supports Sprockets 4.x, 3.x
17
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/)
18
16
 
17
+ ---
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/).
20
+
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).
22
+
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
+
19
25
  ---
20
26
  ## ShakaCode Support
21
27
 
22
- [ShakaCode](https://www.shakacode.com) offers support for upgrading this gem, and related gems such as Webpacker and using Shakapacker. If interested, contact Justin Gordon, [justin@shakacode.com](mailto:justin@shakacode.com). We're also [hiring](https://jobs.lever.co/shakacode/3bdbfdb3-4495-4611-a279-01dddb351abe)!
28
+ [ShakaCode](https://www.shakacode.com) focuses on helping Ruby on Rails teams use React and Webpack better. We can upgrade your project and improve your development and customer experiences, allowing you to focus on building new features or fixing bugs instead.
29
+
30
+ 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/).
31
+
32
+ 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.
23
33
 
24
- Here's a testimonial of how ShakaCode can help, from [Florian Gößler](https://github.com/FGoessler) of [Blinkist](https://www.blinkist.com/), January 2, 2023:
34
+ 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.
35
+
36
+ Here's a testimonial of how ShakaCode can help from [Florian Gößler](https://github.com/FGoessler) of [Blinkist](https://www.blinkist.com/), January 2, 2023:
25
37
  > Hey Justin 👋
26
38
  >
27
39
  > I just wanted to let you know that we today shipped the webpacker to shakapacker upgrades and it all seems to be running smoothly! Thanks again for all your support and your teams work! 😍
@@ -30,11 +42,11 @@ Here's a testimonial of how ShakaCode can help, from [Florian Gößler](https://
30
42
  >
31
43
  > Have a great 2023 and maybe we get to work together again later in the year! 🙌
32
44
 
33
- Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=date_DESC#review-2118154). Here's [another review of a Shakapacker migration that led to more work](https://clutch.co/profile/shakacode#reviews?sort_by=date_DESC#review-2096078).
45
+ Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=date_DESC#review-2118154).
34
46
 
35
47
  ## Resources
36
48
  * [Click to join **React + Rails Slack**](https://reactrails.slack.com/join/shared_invite/enQtNjY3NTczMjczNzYxLTlmYjdiZmY3MTVlMzU2YWE0OWM0MzNiZDI0MzdkZGFiZTFkYTFkOGVjODBmOWEyYWQ3MzA2NGE1YWJjNmVlMGE). Then join the channel `#react-rails`.
37
- * If you are upgrading, you might consider migrating to the [react_on_rails](https://github.com/shakacode/react_on_rails) gem.
49
+ * If upgrading, consider migrating to the [react_on_rails](https://github.com/shakacode/react_on_rails) gem.
38
50
  * Source code example utilizing React-Rails: https://github.com/BookOfGreg/react-rails-example-app
39
51
 
40
52
  ## Documentation
@@ -77,32 +89,24 @@ Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=
77
89
  - [HMR](docs/common-errors.md#hmr)
78
90
  - [Tests in component directory](docs/common-errors.md#tests-in-component-directory)
79
91
 
80
- After reading this README file, additional information about React-Rails can be found in the Wiki page:
92
+ After reading this README file, additional information about React-Rails can be found on the Wiki page:
81
93
  https://github.com/reactjs/React-Rails/wiki
82
- The Wiki page features a significant amount of additional information about React-Rails which includes instructional articles and answers to the most frequently asked questions.
94
+ The Wiki page features a significant amount of additional information about React-Rails, including instructional articles and answers to the most frequently asked questions.
83
95
 
84
96
  ## Related Projects
85
97
 
86
- - [webpacker-react](https://github.com/renchap/webpacker-react): Integration of React with Rails utilizing Webpack with Hot Module Replacement (HMR).
87
- - [The React on Rails Course](https://learnetto.com/users/hrishio/courses/the-free-react-on-rails-5-course) A video course which teaches the basics of React and how to get started using it in Rails with `react-rails`.
88
98
  - [react\_on\_rails](https://github.com/shakacode/react_on_rails): Integration of React with Rails utilizing Webpack, Redux, React-Router.
89
- - [react-rails-hot-loader](https://github.com/rmosolgo/react-rails-hot-loader) Simple live-reloader for `react-rails`.
99
+ - [React on Rails Pro](https://www.shakacode.com/react-on-rails-pro/):React on Rails with Node rendering and many other performance enhancements.
90
100
  - [react-rails-benchmark_renderer](https://github.com/pboling/react-rails-benchmark_renderer) adds performance instrumentation to server rendering.
91
101
  - [Ruby Hyperstack](https://hyperstack.org/): Use Ruby to build reactive user interfaces with React.
92
102
 
93
103
  ## Contributing
94
104
 
95
- 🎉 Thanks for taking the time to contribute! 🎉
96
-
97
- With 5 Million+ downloads of the react-rails Gem and another 2 Million+ downloads of react_ujs on NPM, you're helping the biggest React + Rails community!
98
-
99
- By contributing to React-Rails, you agree to abide by the [code of conduct](https://github.com/reactjs/react-rails/blob/master/CODE_OF_CONDUCT.md).
100
-
101
- You can always help by submitting patches or triaging issues. Even offering reproduction steps to issues is incredibly helpful!
105
+ 🎉 Thanks for taking the time to contribute! 🎉 See [CONTRIBUTING.md](./CONTRIBUTING.md) for more details.
102
106
 
103
107
  # Supporters
104
108
 
105
- The following companies support the development of this and other open-source projects maintained by ShakaCode by providing licenses to the ShakaCode team. ShakaCode stands by the usefulness of these products!
109
+ The following companies provide licenses to the ShakaCode team, supporting the development of this and other open-source projects maintained by ShakaCode. ShakaCode stands by the usefulness of these products!
106
110
 
107
111
  <br />
108
112
  <br />
@@ -130,5 +134,19 @@ The following companies support the development of this and other open-source pr
130
134
  <img alt="BrowserStack" src="https://user-images.githubusercontent.com/4244251/184881129-e1edf4b7-3ae1-4ea8-9e6d-3595cf01609e.png" height="55px">
131
135
  </picture>
132
136
  </a>
137
+ <a href="https://www.honeybadger.io/">
138
+ <picture>
139
+ <img alt="HoneyBadger" src="https://user-images.githubusercontent.com/4244251/184881133-79ee9c3c-8165-4852-958e-31687b9536f4.png" height="70px">
140
+ </picture>
141
+ </a>
142
+ <a href="https://coderabbit.ai">
143
+ <picture>
144
+ <source media="(prefers-color-scheme: dark)" srcset="https://victorious-bubble-f69a016683.media.strapiapp.com/White_Typemark_7229870ac5.svg">
145
+ <source media="(prefers-color-scheme: light)" srcset="https://victorious-bubble-f69a016683.media.strapiapp.com/Orange_Typemark_7958cfa790.svg">
146
+ <img alt="CodeRabbit" src="https://victorious-bubble-f69a016683.media.strapiapp.com/Orange_Typemark_7958cfa790.svg" height="55px">
147
+ </picture>
148
+ </a>
149
+
150
+ ---
133
151
 
134
- Please see our [Contribution guide](https://github.com/reactjs/react-rails/blob/master/CONTRIBUTING.md) for more info.
152
+ ShakaCode is [hiring](https://jobs.lever.co/shakacode/3bdbfdb3-4495-4611-a279-01dddddb351abe)!
@@ -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,((__WEBPACK_EXTERNAL_MODULE__787__,__WEBPACK_EXTERNAL_MODULE__156__,__WEBPACK_EXTERNAL_MODULE__997__)=>(()=>{var __webpack_modules__={634:(e,t,n)=>{"use strict";var o=n(156);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot},10:(e,t,n)=>{var o=n(787),r=n(156),a=n(997),u=n(230),c=n(121),d=n(831),i=n(37),s=n(39),{supportsHydration:_,reactHydrate:l,createReactRootLike:p}=n(198),f=n(613),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:d,constructorFromRequireContextWithGlobalFallback:i,useContext:function(e){this.getConstructor=i(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),d=a.getAttribute(t.PROPS_ATTR),i=d&&JSON.parse(d),s=a.getAttribute(t.RENDER_ATTR),E=a.getAttribute(t.CACHE_ID_ATTR),h=a.hasAttribute(t.TURBOLINKS_PERMANENT_ATTR);if(!c){var m="Cannot find component: '"+u+"'";throw console&&console.log&&console.log("%c[react-rails] %c"+m+" for element","font-weight: bold","",a),new Error(m+". Make sure your component is available to render.")}var b=this.components[E];if(void 0===b&&(b=o.createElement(c,i),h&&(this.components[E]=b)),s&&_())b=l(a,b);else{const e=p(a);b=e.render(b),f&&this.roots.push({node:a,root:e})}}},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)},unmountRoot:function(e){this.roots.filter((function(t){return t.node&&t.node===e})).forEach((function(e){e.root.unmount(),e.root=null,e.node=null}))},handleMount:function(e){var t=void 0;e&&e.target&&(t=e.target),v.mountComponents(t)},handleUnmount:function(e){e&&e.target&&e.target}};"undefined"!=typeof window&&v.detectEvents(),self.ReactRailsUJS=v,e.exports=v},230:(e,t,n)=>{var o=n(528),r=n(921),a=n(228),u=n(724),c=n(968);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)}},528: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)}}},921: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)}}},228:e=>{e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount)}}},968: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)}}},724: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)}}},121:function(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}},831: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}}},37:(e,t,n)=>{var o=n(121),r=n(831);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}}},39:(e,t,n)=>{var o=n(121),r=n(831);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}}},198:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createReactRootLike:()=>_,reactHydrate:()=>s,supportsHydration:()=>i});var o=n(156),r=n.n(o),a=n(613),u=n.n(a);let c=r();if(u())try{c=n(634)}catch(e){c=r()}const d=c;function i(){return"function"==typeof d.hydrate||"function"==typeof d.hydrateRoot}function s(e,t){return"function"==typeof d.hydrateRoot?d.hydrateRoot(e,t):d.hydrate(t,e)}function _(e){return u()?d.createRoot(e):function(e){return{render:t=>d.render(t,e)}}(e)}},613:(e,t,n)=>{var o,r=n(156);o=void 0!==r&&(r.version.split(".")[0]||16)>=18,e.exports=o},787:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__787__},156:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__156__},997:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__997__}},__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__(10);return __webpack_exports__})()));
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__787__,__WEBPACK_EXTERNAL_MODULE__156__,__WEBPACK_EXTERNAL_MODULE__997__)=>(()=>{var __webpack_modules__={634:(e,t,n)=>{"use strict";var o=n(156);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot},10:(e,t,n)=>{var o=n(787),r=n(156),a=n(997),u=n(230),c=n(121),i=n(831),d=n(37),s=n(39),{supportsHydration:_,reactHydrate:l,createReactRootLike:p}=n(198),f=n(613),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},230:(e,t,n)=>{var o=n(528),r=n(921),a=n(228),u=n(724),c=n(968);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)}},528: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)}}},921: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)}}},228:e=>{e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount)}}},968: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)}}},724: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)}}},121:function(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}},831: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}}},37:(e,t,n)=>{var o=n(121),r=n(831);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}}},39:(e,t,n)=>{var o=n(121),r=n(831);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}}},198:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createReactRootLike:()=>_,reactHydrate:()=>s,supportsHydration:()=>d});var o=n(156),r=n.n(o),a=n(613),u=n.n(a);let c=r();if(u())try{c=n(634)}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)}},613:(e,t,n)=>{var o,r=n(156);o=void 0!==r&&(r.version.split(".")[0]||16)>=18,e.exports=o},787:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__787__},156:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__156__},997:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__997__}},__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__(10);return __webpack_exports__})()));
@@ -4,6 +4,6 @@ module React
4
4
  module Rails
5
5
  # If you change this, make sure to update VERSIONS.md
6
6
  # and republish the UJS by updating package.json and `bundle exec rake ujs:publish`
7
- VERSION = "3.2.0"
7
+ VERSION = "3.3.0"
8
8
  end
9
9
  end
@@ -4,6 +4,7 @@ require "react/server_rendering/environment_container"
4
4
  require "react/server_rendering/manifest_container"
5
5
  require "react/server_rendering/yaml_manifest_container"
6
6
  require "react/server_rendering/separate_server_bundle_container"
7
+ require "react/server_rendering/propshaft_container"
7
8
 
8
9
  module React
9
10
  module ServerRendering
@@ -103,6 +104,7 @@ module React
103
104
  def asset_container_class
104
105
  return self.class.asset_container_class if self.class.asset_container_class.present?
105
106
  return SeparateServerBundleContainer if SeparateServerBundleContainer.compatible?
107
+ return PropshaftContainer if PropshaftContainer.compatible?
106
108
 
107
109
  return EnvironmentContainer unless assets_precompiled?
108
110
 
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module React
4
+ module ServerRendering
5
+ # Return asset contents by getting them from a Propshaft::Assembly instance.
6
+ class PropshaftContainer
7
+ class << self
8
+ def assembly
9
+ ::Rails.application.assets
10
+ end
11
+
12
+ def compatible?
13
+ !!defined?(Propshaft) && assembly.is_a?(Propshaft::Assembly)
14
+ end
15
+ end
16
+
17
+ def find_asset(path)
18
+ self.class.assembly.load_path.find(path).content.force_encoding("utf-8")
19
+ end
20
+ end
21
+ end
22
+ end
@@ -16,7 +16,7 @@ module React
16
16
  # @return [void]
17
17
  def self.reset_pool
18
18
  options = { size: pool_size, timeout: pool_timeout }
19
- @pool = ConnectionPool.new(options) { renderer.new(renderer_options) }
19
+ @pool = ConnectionPool.new(**options) { renderer.new(renderer_options) }
20
20
  end
21
21
 
22
22
  # Check a renderer out of the pool and use it to render the component.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul O’Shannessy
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-01-10 00:00:00.000000000 Z
14
+ date: 2026-03-31 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: appraisal
@@ -197,6 +197,20 @@ dependencies:
197
197
  version: '2.5'
198
198
  - !ruby/object:Gem::Dependency
199
199
  name: pry-byebug
200
+ requirement: !ruby/object:Gem::Requirement
201
+ requirements:
202
+ - - "~>"
203
+ - !ruby/object:Gem::Version
204
+ version: 3.8.0
205
+ type: :development
206
+ prerelease: false
207
+ version_requirements: !ruby/object:Gem::Requirement
208
+ requirements:
209
+ - - "~>"
210
+ - !ruby/object:Gem::Version
211
+ version: 3.8.0
212
+ - !ruby/object:Gem::Dependency
213
+ name: package_json
200
214
  requirement: !ruby/object:Gem::Requirement
201
215
  requirements:
202
216
  - - ">="
@@ -210,7 +224,41 @@ dependencies:
210
224
  - !ruby/object:Gem::Version
211
225
  version: '0'
212
226
  - !ruby/object:Gem::Dependency
213
- name: package_json
227
+ name: rails
228
+ requirement: !ruby/object:Gem::Requirement
229
+ requirements:
230
+ - - "~>"
231
+ - !ruby/object:Gem::Version
232
+ version: 7.0.7
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: 7.0.7.2
236
+ type: :development
237
+ prerelease: false
238
+ version_requirements: !ruby/object:Gem::Requirement
239
+ requirements:
240
+ - - "~>"
241
+ - !ruby/object:Gem::Version
242
+ version: 7.0.7
243
+ - - ">="
244
+ - !ruby/object:Gem::Version
245
+ version: 7.0.7.2
246
+ - !ruby/object:Gem::Dependency
247
+ name: turbo-rails
248
+ requirement: !ruby/object:Gem::Requirement
249
+ requirements:
250
+ - - ">="
251
+ - !ruby/object:Gem::Version
252
+ version: '0'
253
+ type: :development
254
+ prerelease: false
255
+ version_requirements: !ruby/object:Gem::Requirement
256
+ requirements:
257
+ - - ">="
258
+ - !ruby/object:Gem::Version
259
+ version: '0'
260
+ - !ruby/object:Gem::Dependency
261
+ name: minitest-retry
214
262
  requirement: !ruby/object:Gem::Requirement
215
263
  requirements:
216
264
  - - ">="
@@ -349,6 +397,7 @@ files:
349
397
  - lib/react/server_rendering/environment_container.rb
350
398
  - lib/react/server_rendering/exec_js_renderer.rb
351
399
  - lib/react/server_rendering/manifest_container.rb
400
+ - lib/react/server_rendering/propshaft_container.rb
352
401
  - lib/react/server_rendering/separate_server_bundle_container.rb
353
402
  - lib/react/server_rendering/yaml_manifest_container.rb
354
403
  homepage: https://github.com/reactjs/react-rails
@@ -370,7 +419,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
370
419
  - !ruby/object:Gem::Version
371
420
  version: '0'
372
421
  requirements: []
373
- rubygems_version: 3.2.32
422
+ rubygems_version: 3.4.19
374
423
  signing_key:
375
424
  specification_version: 4
376
425
  summary: React integration for Ruby on Rails