react_on_rails_pro 16.2.0.beta.8

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.
Files changed (109) hide show
  1. checksums.yaml +7 -0
  2. data/.controlplane/Dockerfile +49 -0
  3. data/.controlplane/controlplane.yml +22 -0
  4. data/.controlplane/gvc.yml +25 -0
  5. data/.controlplane/postgres.yml +33 -0
  6. data/.controlplane/rails.yml +49 -0
  7. data/.controlplane/redis.yml +18 -0
  8. data/.gitignore +77 -0
  9. data/.prettierignore +12 -0
  10. data/.prettierrc +19 -0
  11. data/.rspec +2 -0
  12. data/.rubocop.yml +120 -0
  13. data/.scss-lint.yml +205 -0
  14. data/CHANGELOG.md +570 -0
  15. data/CI_SETUP.md +502 -0
  16. data/CONTRIBUTING.md +376 -0
  17. data/Dockerfile +63 -0
  18. data/Gemfile +8 -0
  19. data/Gemfile.development_dependencies +74 -0
  20. data/Gemfile.loader +32 -0
  21. data/Gemfile.lock +527 -0
  22. data/LICENSE +98 -0
  23. data/LICENSE_SETUP.md +272 -0
  24. data/README.md +577 -0
  25. data/Rakefile +13 -0
  26. data/app/controllers/react_on_rails_pro/rsc_payload_controller.rb +7 -0
  27. data/app/helpers/react_on_rails_pro_helper.rb +360 -0
  28. data/app/views/react_on_rails_pro/rsc_payload.html.erb +1 -0
  29. data/babel.config.js +4 -0
  30. data/docs/bundle-caching.md +205 -0
  31. data/docs/caching.md +234 -0
  32. data/docs/code-splitting-loadable-components.md +313 -0
  33. data/docs/code-splitting.md +349 -0
  34. data/docs/configuration.md +165 -0
  35. data/docs/contributors-info/onboarding-customers.md +6 -0
  36. data/docs/contributors-info/releasing.md +40 -0
  37. data/docs/contributors-info/style.md +33 -0
  38. data/docs/home-pro.md +146 -0
  39. data/docs/installation.md +203 -0
  40. data/docs/js-memory-leaks.md +22 -0
  41. data/docs/node-renderer/basics.md +92 -0
  42. data/docs/node-renderer/debugging.md +38 -0
  43. data/docs/node-renderer/error-reporting-and-tracing.md +160 -0
  44. data/docs/node-renderer/heroku.md +102 -0
  45. data/docs/node-renderer/js-configuration.md +91 -0
  46. data/docs/node-renderer/troubleshooting.md +5 -0
  47. data/docs/profiling-server-side-rendering-code.md +179 -0
  48. data/docs/react-server-components/add-streaming-and-interactivity.md +190 -0
  49. data/docs/react-server-components/create-without-ssr.md +448 -0
  50. data/docs/react-server-components/glossary.md +102 -0
  51. data/docs/react-server-components/how-react-server-components-work.md +243 -0
  52. data/docs/react-server-components/inside-client-components.md +332 -0
  53. data/docs/react-server-components/purpose-and-benefits.md +243 -0
  54. data/docs/react-server-components/rendering-flow.md +86 -0
  55. data/docs/react-server-components/selective-hydration-in-streamed-components.md +75 -0
  56. data/docs/react-server-components/server-side-rendering.md +72 -0
  57. data/docs/react-server-components/tutorial.md +19 -0
  58. data/docs/release-notes/4.0.md +94 -0
  59. data/docs/release-notes/v4-react-server-components.md +66 -0
  60. data/docs/ruby-api.md +11 -0
  61. data/docs/streaming-server-rendering.md +210 -0
  62. data/docs/troubleshooting.md +24 -0
  63. data/docs/updating.md +219 -0
  64. data/eslint.config.mjs +220 -0
  65. data/lib/react_on_rails_pro/assets_precompile.rb +230 -0
  66. data/lib/react_on_rails_pro/cache.rb +88 -0
  67. data/lib/react_on_rails_pro/concerns/rsc_payload_renderer.rb +38 -0
  68. data/lib/react_on_rails_pro/concerns/stream.rb +103 -0
  69. data/lib/react_on_rails_pro/configuration.rb +228 -0
  70. data/lib/react_on_rails_pro/constants.rb +8 -0
  71. data/lib/react_on_rails_pro/engine.rb +24 -0
  72. data/lib/react_on_rails_pro/error.rb +14 -0
  73. data/lib/react_on_rails_pro/license_public_key.rb +30 -0
  74. data/lib/react_on_rails_pro/license_validator.rb +188 -0
  75. data/lib/react_on_rails_pro/prepare_node_renderer_bundles.rb +40 -0
  76. data/lib/react_on_rails_pro/rendering_error.rb +5 -0
  77. data/lib/react_on_rails_pro/request.rb +318 -0
  78. data/lib/react_on_rails_pro/routes.rb +13 -0
  79. data/lib/react_on_rails_pro/server_rendering_js_code.rb +102 -0
  80. data/lib/react_on_rails_pro/server_rendering_pool/node_rendering_pool.rb +133 -0
  81. data/lib/react_on_rails_pro/server_rendering_pool/pro_rendering.rb +117 -0
  82. data/lib/react_on_rails_pro/stream_cache.rb +61 -0
  83. data/lib/react_on_rails_pro/stream_request.rb +170 -0
  84. data/lib/react_on_rails_pro/utils.rb +222 -0
  85. data/lib/react_on_rails_pro/v8_log_processor.rb +50 -0
  86. data/lib/react_on_rails_pro/version.rb +6 -0
  87. data/lib/react_on_rails_pro.rb +23 -0
  88. data/package-scripts.yml +109 -0
  89. data/package.json +159 -0
  90. data/rakelib/dummy_apps.rake +22 -0
  91. data/rakelib/lint.rake +32 -0
  92. data/rakelib/public_key_management.rake +155 -0
  93. data/rakelib/rbs.rake +47 -0
  94. data/rakelib/run_rspec.rake +81 -0
  95. data/rakelib/task_helpers.rb +45 -0
  96. data/rakelib/yard.rake +20 -0
  97. data/react_on_rails_pro.gemspec +47 -0
  98. data/readme-gen-docs.md +1 -0
  99. data/script/bootstrap +33 -0
  100. data/script/preinstall.js +31 -0
  101. data/script/setup +23 -0
  102. data/script/test +38 -0
  103. data/sig/react_on_rails_pro/cache.rbs +13 -0
  104. data/sig/react_on_rails_pro/configuration.rbs +100 -0
  105. data/sig/react_on_rails_pro/error.rbs +4 -0
  106. data/sig/react_on_rails_pro/utils.rbs +7 -0
  107. data/sig/react_on_rails_pro.rbs +5 -0
  108. data/yarn.lock +7599 -0
  109. metadata +319 -0
data/CHANGELOG.md ADDED
@@ -0,0 +1,570 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file. Items under `Unreleased` is upcoming features that will be out in next release.
4
+
5
+ ## Gem and Package Versions
6
+
7
+ Gem and package versions are the same except for beta releases where the gem uses a `.beta` and the package uses a `-beta` (same for `rc`).
8
+
9
+ 1. **Gem**: `3.0.0.rc.1`
10
+ 2. **Package**: `3.0.0-rc.1`
11
+
12
+ You can find the **package** version numbers from this repo's tags and below in this file.
13
+
14
+ ---
15
+
16
+ [HEAD compared to 3.3.1]: Click to see all changes compared to the last 3.x version. See the [4.0 Release Notes](https://github.com/shakacode/react_on_rails_pro/blob/master/docs/release-notes/4.0.md).
17
+
18
+ ## [Unreleased]
19
+
20
+ _Add changes in master not yet tagged._
21
+
22
+ ### Improved
23
+ - Significantly improved streaming performance by processing React components concurrently instead of sequentially. This reduces latency and improves responsiveness when using `stream_view_containing_react_components`.
24
+
25
+ ### Added
26
+ - Added `config.concurrent_component_streaming_buffer_size` configuration option to control the memory buffer size for concurrent component streaming (defaults to 64). This allows fine-tuning of memory usage vs. performance for streaming applications.
27
+
28
+ ### Added
29
+
30
+ - Added `cached_stream_react_component` helper method, similar to `cached_react_component` but for streamed components.
31
+ - **License Validation System**: Implemented comprehensive JWT-based license validation with offline verification using RSA-256 signatures. License validation occurs at startup in both Ruby and Node.js environments. Supports required fields (`sub`, `iat`, `exp`) and optional fields (`plan`, `organization`, `iss`). FREE evaluation licenses are available for 3 months at [shakacode.com/react-on-rails-pro](https://shakacode.com/react-on-rails-pro). [PR #1857](https://github.com/shakacode/react_on_rails/pull/1857) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
32
+ - **Pro-Specific Configurations Moved from Open-Source**: The following React Server Components (RSC) configurations are now exclusively in the Pro gem and should be configured in `ReactOnRailsPro.configure`:
33
+
34
+ - `rsc_bundle_js_file` - Path to the RSC bundle file
35
+ - `react_server_client_manifest_file` - Path to the React server client manifest
36
+ - `react_client_manifest_file` - Path to the React client manifest
37
+
38
+ These configurations were previously available in the open-source `ReactOnRails.configure` block but have been moved to Pro where they belong since RSC is a Pro-only feature.
39
+
40
+ - **Streaming View Helpers Now Pro-Exclusive**: The following view helpers are now defined exclusively in the Pro gem:
41
+
42
+ - `stream_react_component` - Progressive SSR using React 18+ streaming
43
+ - `rsc_payload_react_component` - RSC payload rendering
44
+
45
+ These helpers were previously in the open-source gem but have been moved to Pro as they are Pro-only features.
46
+
47
+ - **Node Renderer Gem Version Validation**: The node renderer now validates that the Ruby gem version (`react_on_rails_pro`) matches the node renderer package version (`@shakacode-tools/react-on-rails-pro-node-renderer`) on every render request. Environment-aware: strict enforcement in development (returns 412 Precondition Failed on mismatch), permissive in production (allows with warning). Includes version normalization to handle Ruby gem vs NPM format differences (e.g., `4.0.0.rc.1` vs `4.0.0-rc.1`). [PR #1881](https://github.com/shakacode/react_on_rails/pull/1881) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
48
+
49
+ ### Changed
50
+
51
+ - Renamed Node Renderer configuration option `bundlePath` to `serverBundleCachePath` to better clarify its purpose as a cache directory for uploaded server bundles, distinct from Shakapacker's public asset directory. The old `bundlePath` property and `RENDERER_BUNDLE_PATH` environment variable continue to work with deprecation warnings. [PR 2008](https://github.com/shakacode/react_on_rails/pull/2008) by [justin808](https://github.com/justin808).
52
+
53
+ ### Changed (Breaking)
54
+
55
+ - `config.prerender_caching`, which controls caching for non-streaming components, now also controls caching for streamed components. To disable caching for an individual render, pass `internal_option(:skip_prerender_cache)`.
56
+ - **Configuration Migration Required**: If you are using RSC features, you must move the RSC-related configurations from `ReactOnRails.configure` to `ReactOnRailsPro.configure` in your initializers. See the migration example in the [React on Rails CHANGELOG](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#unreleased).
57
+ - Added `async` gem dependency (>= 2.6) to support concurrent streaming functionality.
58
+
59
+ ## [4.0.0-rc.15] - 2025-08-11
60
+
61
+ ### Fixed
62
+
63
+ - Fixed an issue where, when React Server Components (RSC) support was disabled, the Node Renderer unnecessarily requested bundles on every render. Now, bundles are only requested when actually needed, improving performance and reducing redundant network traffic. [PR 545](https://github.com/shakacode/react_on_rails_pro/pull/545) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
64
+ - **Fix `descriptor closed` error**: The errors happens when the node renderer restarts while it's still handling an in-progress request (especially if it's a streaming request that may take more time to handle). Implemented a fix that makes worker shutdown gracefully after it finishes all active requests. When a worker receives the shutdown message, if it doesn't shut down during the `gracefulWorkerRestartTimeout`, the master forcibly kills it. [PR #1970][https://github.com/shakacode/react_on_rails/pull/1970] by [AbanoubGhadban](https://github.com/AbanoubGhadban).
65
+
66
+ ### Changed
67
+
68
+ - Upgraded HTTPX dependency from 1.3.4 to ~> 1.5 (currently 1.5.1). [PR 520](https://github.com/shakacode/react_on_rails_pro/pull/520) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
69
+
70
+ ## [4.0.0-rc.14] - 2025-06-22
71
+
72
+ ### Improved
73
+
74
+ - Improved RSC rendering flow by eliminating double rendering of server components and reducing the number of HTTP requests.
75
+ - Updated communication protocol between Node Renderer and Rails to version 2.0.0 which supports the ability to upload multiple bundles at once.
76
+ - Added the ability to communicate between different bundles on the renderer by using the `runOnOtherBundle` function which is globally available for the rendering request.
77
+
78
+ [PR 515](https://github.com/shakacode/react_on_rails_pro/pull/515) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
79
+
80
+ ## [4.0.0-rc.13] - 2025-03-07
81
+
82
+ ### Added
83
+
84
+ - 🚀 **Introducing React Server Components Support!** 🎉
85
+ - Experience the future of React with full RSC integration
86
+ - Seamlessly use React Server Components in your Rails apps
87
+ - Reduce client bundle sizes
88
+ - Enable powerful new patterns for data fetching
89
+ - [See the full tutorial](https://www.shakacode.com/react-on-rails-pro/docs/react-server-components-tutorial)
90
+
91
+ [PR 422](https://github.com/shakacode/react_on_rails_pro/pull/422) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
92
+
93
+ ### Changed (Breaking)
94
+
95
+ - `ReactOnRailsPro::Utils#copy_assets` retuns `nil` instead of `Response` object. Because it throws an error if an error occurs.
96
+
97
+ ## [4.0.0.rc.11] - 2025-02-09
98
+
99
+ ### Changed
100
+
101
+ - [PR 511](https://github.com/shakacode/react_on_rails_pro/pull/511) by [Romex91](https://github.com/Romex91)
102
+
103
+ - Set `bodyLimit` to 100 MB by default to fix error 413.
104
+ - Add `fastifyServerOptions` to the config
105
+
106
+ - Specify exact httpx version until the bug there is fixed [PR #496](https://github.com/shakacode/react_on_rails_pro/pull/496) by [alexeyr-ci](https://github.com/alexeyr-ci)
107
+
108
+ ### Changed
109
+
110
+ - Renamed `includeTimerPolyfills` configuration option to `stubTimers`. [PR 506](https://github.com/shakacode/react_on_rails_pro/pull/506) by [alexeyr-ci](https://github.com/alexeyr-ci).
111
+ - Fail immediately on detecting obsolete config options to prevent unexpected misconfigurations. [PR 506](https://github.com/shakacode/react_on_rails_pro/pull/506) by [alexeyr-ci](https://github.com/alexeyr-ci).
112
+
113
+ ## [4.0.0.rc.9] - 2024-12-05
114
+
115
+ ### Changed
116
+
117
+ - Error reporting and tracing integrations are completely redone. See [the docs](./docs/node-renderer/error-reporting-and-tracing.md) for details. [PR 471](https://github.com/shakacode/react_on_rails_pro/pull/471) by [alexeyr-ci](https://github.com/alexeyr-ci).
118
+ - Upgraded to Fastify 5 by default, with an option to fall back to Fastify 4 on older Node versions. [PR 478](https://github.com/shakacode/react_on_rails_pro/pull/478) by [alexeyr-ci](https://github.com/alexeyr-ci).
119
+ - Logging now uses Pino instead of Winston, aligning with Fastify. [PR 479](https://github.com/shakacode/react_on_rails_pro/pull/479) by [alexeyr-ci](https://github.com/alexeyr-ci).
120
+ - In particular, this can make a difference on uncaught exceptions and unhandled rejections; now the process should always exit if they happen, as recommended.
121
+ - Converted from `Net::HTTP` to HTTPX for requests to the Node renderer [PR 452](https://github.com/shakacode/react_on_rails_pro/pull/452) by [alexeyr-ci](https://github.com/alexeyr-ci).
122
+ - Communication with Node Renderer now uses HTTP/2 Cleartext [PR 392](https://github.com/shakacode/react_on_rails_pro/pull/392) by [alexeyr-ci](https://github.com/alexeyr-ci).
123
+
124
+ ## [4.0.0.rc.6] - 2024-11-12
125
+
126
+ ### Added
127
+
128
+ - Added streaming server rendering support:
129
+ - [PR 407](https://github.com/shakacode/react_on_rails_pro/pull/407) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
130
+ - New `stream_view_containing_react_components` helper method that can be used with `stream_react_component` helper method in react_on_rails gem.
131
+ - Enables progressive page loading and improved performance for server-rendered React components.
132
+ - Added support for replaying console logs that occur during server rendering of streamed React components. This enables debugging of server-side rendering issues by capturing and displaying console output on the client and on the server output. [PR #429](https://github.com/shakacode/react_on_rails_pro/pull/429) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
133
+ - Added support for handling errors happening during server rendering of streamed React components [PR #432](https://github.com/shakacode/react_on_rails_pro/pull/432) by [AbanoubGhadban](https://github.com/AbanoubGhadban):
134
+ - It handles errors that happen during the initial render and errors that happen inside suspense boundaries.
135
+ - Added `raise_non_shell_server_rendering_errors` configuration option.
136
+ - Added support for replaying console logs from asynchronous operations:
137
+ - New `replayServerAsyncOperationLogs` configuration option to enable/disable this feature
138
+ - When enabled, captures and replays console output from async operations during server-side rendering
139
+ - [PR 440](https://github.com/shakacode/react_on_rails_pro/pull/440) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
140
+
141
+ ### Removed
142
+
143
+ - Drop support for EOL'd Ruby 2.7 [PR 365](https://github.com/shakacode/react_on_rails_pro/pull/365) by [ahangarha](https://github.com/ahangarha).
144
+ - Drop support for React on Rails below 14.0.4 [PR 415](https://github.com/shakacode/react_on_rails_pro/pull/415) by [rameziophobia](https://github.com/rameziophobia).
145
+
146
+ ### Fixed
147
+
148
+ - Updated multiple JS dependencies for bug fixes.
149
+ - Added execute permission for `spec/dummy/bin/dev` [PR 387](https://github.com/shakacode/react_on_rails_pro/pull/387) by [alexeyr](https://github.com/alexeyr).
150
+ - Made default bundle paths in node-renderer and Rails consistent [PR 399](https://github.com/shakacode/react_on_rails_pro/pull/399) by [alexeyr-ci](https://github.com/alexeyr-ci).
151
+
152
+ ### Changed
153
+
154
+ - Support Shakapacker 8.0.0, Modified webpack configurations to use shakapacker instead of webpacker. This drops support for shakapacker 6.X [PR 415](https://github.com/shakacode/react_on_rails_pro/pull/415) by [rameziophobia](https://github.com/rameziophobia).
155
+ - Converted the node-renderer worker from Express to Fastify [PR 398](https://github.com/shakacode/react_on_rails_pro/pull/398) by [alexeyr-ci](https://github.com/alexeyr-ci).
156
+
157
+ ## [3.3.1] - 2025-08-11
158
+
159
+ ### Changed
160
+
161
+ - Converted JS code to TS [PR 386](https://github.com/shakacode/react_on_rails_pro/pull/386) and [PR 389](https://github.com/shakacode/react_on_rails_pro/pull/389) by [alexeyr-ci](https://github.com/alexeyr-ci).
162
+
163
+ ### Fixed
164
+
165
+ - Removed file size limit for assets and bundles. [PR 459](https://github.com/shakacode/react_on_rails_pro/pull/459) by [alexeyr-ci](https://github.com/alexeyr-ci).
166
+ - Enabled use as a `git:` dependency. [PR 490](https://github.com/shakacode/react_on_rails_pro/pull/490) by [alexeyr-ci](https://github.com/alexeyr-ci).
167
+ - Enabled `queueMicrotask` use in server bundle to support React 19. [PR 505](https://github.com/shakacode/react_on_rails_pro/pull/505) by [alexeyr-ci](https://github.com/alexeyr-ci).
168
+ - Made bundle hash environment aware. [PR 512](https://github.com/shakacode/react_on_rails_pro/pull/512) by [judahmeek](https://github.com/judahmeek).
169
+ - Made compatible with Ruby 3.4. [PR 541](https://github.com/shakacode/react_on_rails_pro/pull/541) by [alexeyr-ci2](https://github.com/alexeyr-ci2).
170
+
171
+ ## [3.2.1] - 2023-06-07
172
+
173
+ Fixed release, supports Ruby 2.7.5.
174
+
175
+ See branch https://github.com/shakacode/react_on_rails_pro/tree/3-support-ruby-2-7
176
+
177
+ ### Fixed
178
+
179
+ - Removed console errors when `setTimeout` is used server-size. The call is silently ignored for seamless integration of https://github.com/petyosi/react-virtuoso
180
+ - Numerous Dependabot alerts
181
+
182
+ ## Doc and Spec Only Updates
183
+
184
+ React 18 is now supported! Check the [React on Rails CHANGELOG.md](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md) for details and the updates to the [loadable-components instructions](https://github.com/shakacode/react_on_rails_pro/blob/master/docs/code-splitting-loadable-components.md).
185
+
186
+ ### Improved
187
+
188
+ - Updated `Rubocop` version from `1.18.3` to `1.36.0`. Fixed Rubocop warnings. [PR 296](https://github.com/shakacode/react_on_rails_pro/pull/296) by [alkesh26](https://github.com/alkesh26).
189
+ - Updated dependencies to address known security vulnerabilities
190
+
191
+ ## [3.1.0] - 2022-08-03
192
+
193
+ ### Fixed
194
+
195
+ - Removes `include_execjs_polyfills` options from RoRP gem configuration & adds `include_timer_polyfills` option for Node Renderer configuration, which enables use of setTimeout & other timer functions during server rendering. [PR 281](https://github.com/shakacode/react_on_rails_pro/pull/281) by [judahmeek](https://github.com/judahmeek).
196
+
197
+ ### Improvement
198
+
199
+ - Warn, do not raise on missing assets [PR 280](https://github.com/shakacode/react_on_rails_pro/pull/280) by [Romex91](https://github.com/Romex91)
200
+
201
+ ## [3.0.1] - 2022-07-011
202
+
203
+ ### Fixed
204
+
205
+ - Fix possible `uninitialized constant ReactOnRails (NameError)` in `lib/react_on_rails_pro/error.rb:4`. [PR 277](https://github.com/shakacode/react_on_rails_pro/pull/273) by [alexeyr](https://github.com/alexeyr).
206
+
207
+ ## [3.0.0] - 2022-07-07
208
+
209
+ ### Fixed
210
+
211
+ - Make asset paths in PrepareNodeRenderBundles relative too. The symlink to the bundle itself was made relative in #231, but asset symlinks remained absolute. This makes them relative too. Fixes #272. [PR 273](https://github.com/shakacode/react_on_rails_pro/pull/273) by [alexeyr](https://github.com/alexeyr).
212
+
213
+ ## [3.0.0-rc.4] - 2022-06-28
214
+
215
+ ### Fixed
216
+
217
+ - Add RAILS_ENV to bundle cache key. This ensures a development bundle will never get accidentally deployed to production. [PR 270](https://github.com/shakacode/react_on_rails_pro/pull/270) by [justin808](https://github.com/justin808).
218
+ - Replace use of utc_timestamp with Utils.bundle_hash. Important fix as timestamps are not stable between build time and the deployment of a Heroku slug. [PR 269](https://github.com/shakacode/react_on_rails_pro/pull/269) by [Judahmeek](https://github.com/Judahmeek).
219
+
220
+ ## [3.0.0-rc.3] - 2022-04-14
221
+
222
+ ### Fixed
223
+
224
+ - Fix prepare_node_renderer script. [PR 254](https://github.com/shakacode/react_on_rails_pro/pull/254) by [judahmeek](https://github.com/judahmeek).
225
+ - Better logging for error 'Request protocol undefined does not match installed renderer protocol'. [PR 252](https://github.com/shakacode/react_on_rails_pro/pull/252) by [justin808](https://github.com/justin808).
226
+
227
+ ## [3.0.0-rc.1] - 2022-02-26
228
+
229
+ ### Fixed
230
+
231
+ - Use relative source path for bundle symlink which conflicted with extraction of (Heroku) slugs caching resulting in incorrect extraction of the slugs due to absolute paths in the symlinks. [PR 231](https://github.com/shakacode/react_on_rails_pro/pull/231) by [judahmeek](https://github.com/judahmeek).
232
+
233
+ ## [3.0.0-rc.0] - 2021-10-27
234
+
235
+ ### Upgrading to 3.0
236
+
237
+ 1. Changed rake task name from vm to node:
238
+ Rename react_on_rails_pro:pre_stage_bundle_for_vm_renderer to react_on_rails_pro:pre_stage_bundle_for_node_renderer
239
+ 2. **Bundle Caching**: ReactOnRailsPro::AssetsPrecompile will automatically pre_stage_bundle_for_node_renderer if using the node_renderer. So don't do this twice in another place if using ReactOnRailsPro::AssetsPrecompile for bundle caching. You might have modified your own assets:precompile task.
240
+
241
+ ### Changed
242
+
243
+ - Moved default location of placed node renderer sym links to be /.node-renderer-bundles as the /tmp directory is typically
244
+ cleared during slug trimming
245
+
246
+ ### Added
247
+
248
+ - [PR 220](https://github.com/shakacode/react_on_rails_pro/pull/220) by [justin808](https://github.com/justin808).
249
+
250
+ - **Add `ssr_timeout` configuration** so the Rails server will not wait more than this many seconds for a SSR request to return once issued.
251
+ - Change default for `renderer_use_fallback_exec_js` to `false`.
252
+ - Change default log level to info.
253
+
254
+ - Add support for render functions to be async (returning promises). Also add `include_execjs_polyfills` option to configuration for React on Rails to optionally stop stubbing of setTimeout, setInterval, & clearTimeout polyfills while using NodeRenderer. [PR 210](https://github.com/shakacode/react_on_rails_pro/pull/210) by [judahmeek](https://github.com/judahmeek).
255
+
256
+ ### Fixed
257
+
258
+ - Ability to call `server_render_js(raw_js)` fixed. Previously, always errored.
259
+ - Errors during rendering result in ReactOnRails::PrerenderError
260
+ - When retrying rendering, the retry message is more clear
261
+
262
+ ## [2.3.0] - 2021-09-22
263
+
264
+ ### Added
265
+
266
+ - Configuration option for `ssr_timeout` so the Rails server will not wait more than this many seconds
267
+ for a SSR request to return once issued. Default timeout if not set is 5.
268
+ `config.ssr_timeout = 5`
269
+
270
+ - Added optional method `extra_files_to_cache` to the definition of the module for the configuration of
271
+ the remote_bundle_cache_adapter. This allows files outside of the regular build directory to be
272
+ placed in the cached zip file and then extracted and restored when the cache is restored. The use
273
+ case for this is some files created during the build process that belongs to a location outside of
274
+ the regular deployment directory for files produced by the `build` method of the module.
275
+
276
+ [PR 221](https://github.com/shakacode/react_on_rails_pro/pull/221) by
277
+ [justin808](https://github.com/justin808) and [ershadul1](https://github.com/ershadul1).
278
+
279
+ ## [2.2.0] - 2021-07-13
280
+
281
+ - Change rake react_on_rails_pro:pre_stage_bundle_for_vm_renderer to use symlinks to save slug size. [PR 202](https://github.com/shakacode/react_on_rails_pro/pull/202) by [justin808](https://github.com/justin808).
282
+
283
+ ## [2.1.1] - 2021-05-29
284
+
285
+ - Add optional extra cache values for bundle caching. The cache adapter can now provide a method cache_keys. [PR 196](https://github.com/shakacode/react_on_rails_pro/pull/196) by [justin808](https://github.com/justin808).
286
+
287
+ ## [2.1.0] - 2021-05-15
288
+
289
+ ### Added
290
+
291
+ - Optional production bundle caching. [PR 179](https://github.com/shakacode/react_on_rails_pro/pull/179) by [judahmeek](https://github.com/judahmeek).
292
+ - Added configurations:
293
+ - `excluded_dependency_globs`: don't include these in caches
294
+ - `remote_bundle_cache_adapter`: See `docs/bundle-caching.md
295
+
296
+ ---
297
+
298
+ ### 2.0 Upgrade Steps
299
+
300
+ 1. Update React on Rails to 12.2.0
301
+ 2. Be sure to use an API key that has the Github package access and know your API key username. For questions, message Justin Gordon on Slack or [justin@shakacode.com](mailto:justin@shakacode.com).
302
+
303
+ In your `config/initializers/react_on_rails_pro.rb`:
304
+
305
+ 1. Rename any references from `config.serializer_globs` to `config.dependency_globs`
306
+ 1. Rename any references from `vm-renderer` to `node-renderer`
307
+ 1. Rename `vmRenderer` to `NodeRenderer`
308
+
309
+ Follow the steps for the new installation that uses Github Packages: [docs/installation.md](https://github.com/shakacode/react_on_rails_pro/blob/master/docs/installation.md).
310
+
311
+ 1. Be sure to namespace the package like `require('@shakacode-tools/react-on-rails-pro-node-renderer');`
312
+ 1. Add the Honeybadger ("@honeybadger-io/js") or Sentry ("@sentry/node") NPM packages, as those used to be **dependencies**. Now they are optional.
313
+ 1. Add the `@sentry/tracing` package if you want to try Sentry tracing. See [Error Reporting and Tracing for Sentry and HoneyBadger](./docs/node-renderer/error-reporting-and-tracing.md).
314
+
315
+ For example, the old code might be:
316
+
317
+ ```js
318
+ const { reactOnRailsProVmRenderer } = require('react-on-rails-pro-vm-renderer');
319
+ ```
320
+
321
+ New
322
+
323
+ ```js
324
+ const { reactOnRailsProNodeRenderer } = require('@shakacode-tools/react-on-rails-pro-node-renderer');
325
+ ```
326
+
327
+ ---
328
+
329
+ ## [2.0.0] - 2021-04-02
330
+
331
+ - See 2.0 Upgrade steps!
332
+
333
+ ## [2.0.0.beta.3] - 2021-03-31
334
+
335
+ #### Improved
336
+
337
+ - Warn, do not raise on missing assets [PR 176](https://github.com/shakacode/react_on_rails_pro/pull/176) by [Romex91](https://github.com/Romex91)
338
+
339
+ ## [2.0.0.beta.2] - 2021-03-23
340
+
341
+ #### Added
342
+
343
+ - Added option `config.throw_js_errors` so that any errors in SSR will go to the console plus HoneyBadger/Sentry. [PR 174](https://github.com/shakacode/react_on_rails_pro/pull/174) by [justin808](https://github.com/justin808).
344
+
345
+ #### Fixed
346
+
347
+ - Logs missing error reporting packages (Sentry/HoneyBadger) instead of throwing an error. [PR 174](https://github.com/shakacode/react_on_rails_pro/pull/174) by [justin808](https://github.com/justin808).
348
+
349
+ ## [2.0.0.beta.1] - 2021-03-14
350
+
351
+ - Added Sentry Tracing support. [PR 150](https://github.com/shakacode/react_on_rails_pro/pull/150) by [ashgaliyev](https://github.com/ashgaliyev). To use this feature, you need to add `config.sentryTracing = true` (or ENV `SENTRY_TRACING=true`) and optionally the `config.sentryTracesSampleRate = 0.5` (or ENV `SENTRY_TRACES_SAMPLE_RATE=0.5`). The value of the sample rate is the percentage of requests to trace. For documentation of Sentry Tracing, see the [Sentry Performance Monitoring Docs](https://docs.sentry.io/platforms/ruby/performance/), the [Sentry Distributed Tracing Docs](https://docs.sentry.io/product/performance/distributed-tracing/), and the [Sentry Sampling Transactions Docs](https://docs.sentry.io/platforms/ruby/performance/sampling/). The default **config.sentryTracesSampleRate** is **0.1**.
352
+
353
+ * Renamed `config.serializer_globs`to `config.dependency_globs`. [PR 165](https://github.com/shakacode/react_on_rails_pro/pull/165) by [judahmeek](https://github.com/judahmeek)
354
+ * RORP_CACHE_HIT and RORP_CACHE_KEY is returned for prerender caching, which is only when there is no fragment caching.
355
+ * Improve cache information from react_component_hash. Hash result now includes 2 new keys
356
+ - RORP_CACHE_HIT
357
+ - RORP_CACHE_KEY
358
+ Additionally, ReactOnRailsPro::Utils.printable_cache_key(cache_key) added.
359
+ * [PR 170](https://github.com/shakacode/react_on_rails_pro/pull/170) by [justin808](https://github.com/justin808).
360
+
361
+ ## [2.0.0.beta.0] - 2020-12-03
362
+
363
+ - Renamed VM Renderer to Node Renderer. [PR 140](https://github.com/shakacode/react_on_rails_pro/pull/140) by [justin808](https://github.com/justin808).
364
+
365
+ ### Fixed
366
+
367
+ - Cache key not stable between machines same deploy. [PR 159](https://github.com/shakacode/react_on_rails_pro/pull/136) by [justin808](https://github.com/justin808).
368
+
369
+ ## [1.5.6] - 2020-12-02
370
+
371
+ Switched to releases being published packages.
372
+
373
+ ### Fixed
374
+
375
+ - Minor fix to error messages
376
+ - Updated gem and package dependencies
377
+
378
+ ## [1.5.5] - 2020-08-17
379
+
380
+ ### Added
381
+
382
+ - Added request retrying in case of timeouts. [PR 136](https://github.com/shakacode/react_on_rails_pro/pull/136) by [ashgaliyev](https://github.com/ashgaliyev).
383
+
384
+ ## [1.5.4] - 2020-07-22
385
+
386
+ ### Added
387
+
388
+ - Added support for Github packages. To switch from using the Github private repo with a tag, request a new auth token from justin@shakacode.com.
389
+
390
+ ## [1.5.3] - 2020-06-30
391
+
392
+ ### Added
393
+
394
+ - Added sentry support. [PR 132](https://github.com/shakacode/react_on_rails_pro/pull/132) by [ashgaliyev](https://github.com/ashgaliyev).
395
+
396
+ ## [1.5.2] - 2020-06-25
397
+
398
+ ### Improved
399
+
400
+ - Added `process` and `Buffer` to the context if `suppportModules === true`. [PR 131](https://github.com/shakacode/react_on_rails_pro/pull/131) by [ashgaliyev](https://github.com/ashgaliyev).
401
+
402
+ ## [1.5.1] - 2020-03-25
403
+
404
+ ### Improved
405
+
406
+ - config.assets_to_copy can take a single value in addition to an array. [PR 122](https://github.com/shakacode/react_on_rails_pro/pull/122) [justin808](https://github.com/justin808).
407
+ - Better handling for an invalid renderer_url configuration. [PR 109](https://github.com/shakacode/react_on_rails_pro/pull/109) [justin808](https://github.com/justin808).
408
+
409
+ ## [1.5.0] - 2020-03-17
410
+
411
+ ### Added
412
+
413
+ - Added support for loadable components SSR [PR 112](https://github.com/shakacode/react_on_rails_pro/pull/112) and [PR 118](https://github.com/shakacode/react_on_rails_pro/pull/118) by [ashgaliyev](https://github.com/ashgaliyev) and [justin808](https://github.com/justin808).
414
+ - New option added to the node-renderer: `supportModules`. This setting is necessary for using [loadable-components](https://github.com/gregberge/loadable-components/). See [Server-side rendering with code-splitting using Loadable/Components](https://github.com/shakacode/react_on_rails_pro/blob/master/docs/code-splitting-loadable-components.md) for more detailss.
415
+
416
+ ### Changed
417
+
418
+ - Updated to bundler V2. [PR 114](https://github.com/shakacode/react_on_rails_pro/pull/114) by [justin808](https://github.com/justin808).
419
+ - Updated spec dummy. [PR 115](https://github.com/shakacode/react_on_rails_pro/pull/115) by [justin808](https://github.com/justin808).
420
+
421
+ - Better handling for an invalid renderer_url configuration
422
+
423
+ ## [1.4.4] - 2019-06-10
424
+
425
+ ### Fixed
426
+
427
+ - Improve error handling. [PR 103](https://github.com/shakacode/react_on_rails_pro/pull/103) by [justin808](https://github.com/justin808).
428
+
429
+ ## [1.4.3] - 2019-06-06
430
+
431
+ ### Fixed
432
+
433
+ - Lock timeouts and update error handling. Previously, many renderer errors resulted in crashes rather than a fallback
434
+ to ExecJS. Also, lengthened the lock timeouts for the bundle lock. [PR 100](https://github.com/shakacode/react_on_rails_pro/pull/100) by [justin808](https://github.com/justin808).
435
+ - Added check to skip pre-render cache for components rendered by `cache_react_component` and `cache_react_component_hash` because this saves on cache storage, thus improving overall performance. [PR 91](https://github.com/shakacode/react_on_rails_pro/pull/91) by [ashgaliyev](https://github.com/ashgaliyev).
436
+
437
+ ## [1.4.2] - 2019-05-26
438
+
439
+ ### Changed
440
+
441
+ - Removed babel processing. Node v12 recommended. [PR 93](https://github.com/shakacode/react_on_rails_pro/pull/91) by [ashgaliyev](https://github.com/ashgaliyev).
442
+
443
+ ## [1.4.1] - 2019-03-19
444
+
445
+ ### Fixed
446
+
447
+ - `cached_react_component_hash` incorrectly failed to include the bundle_hash unless `prerender: true` was used as an option. This fix addresses that issue. There is no need to use `prerender: true` as generating a hash only makes sense if prerendering is done. [PR 82](https://github.com/shakacode/react_on_rails_pro/pull/82) by [justin808](https://github.com/justin808).
448
+
449
+ ## [1.4.0] - 2019-01-15
450
+
451
+ ### Added
452
+
453
+ - Added config option `honeybadgerApiKey` or ENV value `HONEYBADGER_API_KEY` so that errors can flow to HoneyBadger. [PR 93](https://github.com/shakacode/react_on_rails_pro/pull/75) by [ashgaliyev](https://github.com/ashgaliyev).
454
+
455
+ ## [1.3.1] - 2018-12-26
456
+
457
+ ### Added
458
+
459
+ - Added option `cache_options:` to the cached_react_component_hash and cached_react_component
460
+ a hash including values such as :compress, :expires_in, :race_condition_ttl
461
+ - Added option `:if`, `:unless` to the cached_react_component_hash and cached_react_component
462
+ to skip or use caching
463
+ - option `cache_keys:` can be passed as a lambda now to delay evaluation when passing the :if or
464
+ :unless options
465
+
466
+ Above are in [PR 82](https://github.com/shakacode/react_on_rails_pro/pull/82) by [justin808](https://github.com/justin808)
467
+
468
+ ## [1.3.0] - 2018-12-18
469
+
470
+ - **Migration:** react_on_rails must be updated to version >= 11.2.1.
471
+
472
+ ### Added
473
+
474
+ - Added `config.ssr_pre_hook_js` to call some JavaScript to clear out state from libraries that
475
+ misbehave during server Rendering. For example, suppose that we had to call `SomeLibrary.clearCache()`
476
+ between calls to server renderer. Note, SomeLibrary needs to be globally exposed in the server
477
+ rendering webpack bundle.
478
+
479
+ ## [1.2.1] - 2018-08-26
480
+
481
+ ### Fixed
482
+
483
+ - Major overhaul of the node-renderer. Improved logging and error handling, ready for async
484
+ - Fixed race conditions with init of renderer
485
+ - Improved logging
486
+ - Ensuring all places that an error will result in a 400 sent to the rails server.
487
+ - Handle threading issue with writing the bundle by using a lockfile.
488
+ - Change internals so that async rendering is ready.
489
+ - Add debugging instructions
490
+ - Promisified some node APIs and wrote everything with careful async/await syntax, ensuring that errors are always caught and that promises are always returned from the async functions.
491
+
492
+ Above are in [PR 65](https://github.com/shakacode/react_on_rails_pro/pull/65) by [justin808](https://github.com/justin808).
493
+
494
+ ## [1.2.0]
495
+
496
+ - **Migration:** react_on_rails must be updated to version 11.1.x+.
497
+
498
+ ### Added
499
+
500
+ - Added `serializer_globs` configuration value to add a MD5 of serializer files to the cache key for fragment caching. [#60](https://github.com/shakacode/react_on_rails_pro/pull/60) by [justin808](https://github.com/justin808).
501
+ - More efficient calculation of the request digest. Previously, we would do a regexp replace to filter out the dom node id because if was randomized. React on Rails 11.1.x provides a default to say not to randomize. [#64](https://github.com/shakacode/react_on_rails_pro/pull/64) by [justin808](https://github.com/justin808).
502
+
503
+ ### Fixed
504
+
505
+ - Fix for truncation of code and better error logs. This fixes the issue with truncation of the code when over 1 MB due to large props. Max changes to 10 MB. [#63](https://github.com/shakacode/react_on_rails_pro/pull/63) by [justin808](https://github.com/justin808).
506
+
507
+ ## [1.1.0]
508
+
509
+ ### Added
510
+
511
+ - Added `tracing` configuration flag to time server rendering calls
512
+
513
+ ### Changed
514
+
515
+ - Default usage of PORT and LOG_LEVEL for the node-renderer bin file changed to use values RENDERER_PORT and RENDERER_LOG_LEVEL
516
+ - Default Rails config.server_render is "ExecJS". Previously was "VmRenderer"
517
+
518
+ Above changes in [PR 52](https://github.com/shakacode/react_on_rails_pro/pull/52) by [justin808](https://github.com/justin808).
519
+
520
+ ## [1.0.0]
521
+
522
+ ### Added
523
+
524
+ - support for node renderer & fallback renderer
525
+ - support for javascript evaluation caching
526
+ - advanced error handling
527
+
528
+ [HEAD compared to 3.2.1]: https://github.com/shakacode/react_on_rails_pro/compare/3.3.1...HEAD
529
+ [Unreleased]: https://github.com/shakacode/react_on_rails_pro/compare/4.0.0-rc-15...HEAD
530
+ [4.0.0-rc.15]: https://github.com/shakacode/react_on_rails_pro/compare/4.0.0-rc.14...4.0.0-rc.15
531
+ [4.0.0.rc.11]: https://github.com/shakacode/react_on_rails_pro/compare/4.0.0-rc.9...4.0.0-rc.11
532
+ [4.0.0.rc.9]: https://github.com/shakacode/react_on_rails_pro/compare/4.0.0-rc.6...4.0.0-rc.9
533
+ [4.0.0.rc.6]: https://github.com/shakacode/react_on_rails_pro/compare/3.3.1...4.0.0-rc.6
534
+ [3.3.1]: https://github.com/shakacode/react_on_rails_pro/compare/3.2.1...3.3.1
535
+ [3.2.1]: https://github.com/shakacode/react_on_rails_pro/compare/3.1.2...3.2.1
536
+ [3.1.2]: https://github.com/shakacode/react_on_rails_pro/compare/3.1.0...3.1.2
537
+ [3.1.0]: https://github.com/shakacode/react_on_rails_pro/compare/3.0.1...3.1.0
538
+ [3.0.1]: https://github.com/shakacode/react_on_rails_pro/compare/3.0.0...3.0.1
539
+ [3.0.0]: https://github.com/shakacode/react_on_rails_pro/compare/2.3.0...3.0.0
540
+ [3.0.0-rc.4]: https://github.com/shakacode/react_on_rails_pro/compare/3.0.0-rc.3...3.0.0-rc.4
541
+ [3.0.0-rc.3]: https://github.com/shakacode/react_on_rails_pro/compare/3.0.0-rc.1...3.0.0-rc.3
542
+ [3.0.0-rc.1]: https://github.com/shakacode/react_on_rails_pro/compare/3.0.0-rc.0...3.0.0-rc.1
543
+ [3.0.0-rc.0]: https://github.com/shakacode/react_on_rails_pro/compare/2.3.0...3.0.0-rc.0
544
+ [2.3.0]: https://github.com/shakacode/react_on_rails_pro/compare/2.2.0...2.3.0
545
+ [2.2.0]: https://github.com/shakacode/react_on_rails_pro/compare/2.1.1...2.2.0
546
+ [2.1.1]: https://github.com/shakacode/react_on_rails_pro/compare/2.1.0...2.1.1
547
+ [2.1.0]: https://github.com/shakacode/react_on_rails_pro/compare/2.0.0...2.1.0
548
+ [2.0.0]: https://github.com/shakacode/react_on_rails_pro/compare/1.5.6...2.0.0
549
+ [2.0.0.beta.3]: https://github.com/shakacode/react_on_rails_pro/compare/2.0.0-beta.2...2.0.0-beta.3
550
+ [2.0.0.beta.2]: https://github.com/shakacode/react_on_rails_pro/compare/2.0.0-beta.1...2.0.0-beta.2
551
+ [2.0.0.beta.1]: https://github.com/shakacode/react_on_rails_pro/compare/2.0.0-beta.0...2.0.0-beta.1
552
+ [2.0.0.beta.0]: https://github.com/shakacode/react_on_rails_pro/compare/1.5.6...2.0.0-beta.0
553
+ [1.5.6]: https://github.com/shakacode/react_on_rails_pro/compare/1.5.5...1.5.6
554
+ [1.5.5]: https://github.com/shakacode/react_on_rails_pro/compare/1.5.4...1.5.5
555
+ [1.5.4]: https://github.com/shakacode/react_on_rails_pro/compare/1.5.3...1.5.4
556
+ [1.5.3]: https://github.com/shakacode/react_on_rails_pro/compare/1.5.2...1.5.3
557
+ [1.5.2]: https://github.com/shakacode/react_on_rails_pro/compare/1.5.1...1.5.2
558
+ [1.5.1]: https://github.com/shakacode/react_on_rails_pro/compare/1.5.0...1.5.1
559
+ [1.5.0]: https://github.com/shakacode/react_on_rails_pro/compare/1.4.4...1.5.0
560
+ [1.4.4]: https://github.com/shakacode/react_on_rails_pro/compare/1.4.3...1.4.4
561
+ [1.4.3]: https://github.com/shakacode/react_on_rails_pro/compare/1.4.2...1.4.3
562
+ [1.4.2]: https://github.com/shakacode/react_on_rails_pro/compare/1.4.1...1.4.2
563
+ [1.4.1]: https://github.com/shakacode/react_on_rails_pro/compare/1.4.0...1.4.1
564
+ [1.4.0]: https://github.com/shakacode/react_on_rails_pro/compare/1.3.1...1.4.0
565
+ [1.3.1]: https://github.com/shakacode/react_on_rails_pro/compare/1.3.0...1.3.1
566
+ [1.3.0]: https://github.com/shakacode/react_on_rails_pro/compare/1.2.1...1.3.0
567
+ [1.2.1]: https://github.com/shakacode/react_on_rails_pro/compare/1.2.0...1.2.1
568
+ [1.2.0]: https://github.com/shakacode/react_on_rails_pro/compare/1.1.0...1.2.0
569
+ [1.1.0]: https://github.com/shakacode/react_on_rails_pro/compare/1.0.0...1.1.0
570
+ [1.0.0]: https://github.com/shakacode/react_on_rails_pro/releases/tag/1.0.0