react-on-rails-pro 16.4.0-rc.8 → 16.4.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.
|
@@ -21,8 +21,8 @@ import { onPageLoaded } from 'react-on-rails/pageLifecycle';
|
|
|
21
21
|
import * as StoreRegistry from "./StoreRegistry.js";
|
|
22
22
|
import * as ComponentRegistry from "./ComponentRegistry.js";
|
|
23
23
|
const REACT_ON_RAILS_STORE_ATTRIBUTE = 'data-js-react-on-rails-store';
|
|
24
|
-
const IMMEDIATE_HYDRATION_PRO_WARNING = "[REACT ON RAILS] The 'immediate_hydration' feature requires
|
|
25
|
-
'Please visit https://shakacode.com/react-on-rails-pro
|
|
24
|
+
const IMMEDIATE_HYDRATION_PRO_WARNING = "[REACT ON RAILS] The 'immediate_hydration' feature requires the React on Rails Pro gem to be installed on the server. " +
|
|
25
|
+
'Please visit https://www.shakacode.com/react-on-rails-pro/ for installation details.';
|
|
26
26
|
async function delegateToRenderer(componentObj, props, railsContext, domNodeId, trace) {
|
|
27
27
|
const { name, component, isRenderer } = componentObj;
|
|
28
28
|
if (isRenderer) {
|
|
@@ -63,9 +63,10 @@ class ComponentRenderer {
|
|
|
63
63
|
*/
|
|
64
64
|
async render(el, railsContext) {
|
|
65
65
|
const isImmediateHydrationRequested = el.getAttribute('data-immediate-hydration') === 'true';
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
// rorPro signals gem presence on the server, not license validity.
|
|
67
|
+
const hasProGemInstalled = railsContext.rorPro;
|
|
68
|
+
// Handle immediate_hydration feature usage without Pro gem installed
|
|
69
|
+
if (isImmediateHydrationRequested && !hasProGemInstalled) {
|
|
69
70
|
console.warn(IMMEDIATE_HYDRATION_PRO_WARNING);
|
|
70
71
|
// Fallback to standard behavior: wait for page load before hydrating
|
|
71
72
|
if (document.readyState === 'loading') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-on-rails-pro",
|
|
3
|
-
"version": "16.4.0
|
|
3
|
+
"version": "16.4.0",
|
|
4
4
|
"description": "React on Rails Pro package with React Server Components support",
|
|
5
5
|
"main": "lib/ReactOnRails.full.js",
|
|
6
6
|
"type": "module",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"./ServerComponentFetchError": "./lib/ServerComponentFetchError.js"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"react-on-rails": "16.4.0
|
|
50
|
+
"react-on-rails": "16.4.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": ">= 16",
|