react-on-rails 16.7.0-rc.0 → 16.7.0-rc.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.
@@ -0,0 +1,2 @@
1
+ export { renderToPipeableStream, renderToString, type PipeableStream } from 'react-dom/server';
2
+ //# sourceMappingURL=ReactDOMServer.d.cts.map
package/lib/reactApis.cjs CHANGED
@@ -15,7 +15,9 @@ let reactDomClient;
15
15
  if (exports.supportsRootApi) {
16
16
  // This will never throw an exception, but it's the way to tell Webpack the dependency is optional
17
17
  // https://github.com/webpack/webpack/issues/339#issuecomment-47739112
18
- // Unfortunately, it only converts the error to a warning.
18
+ // Unfortunately, it only converts the error to a warning. React 16/17 consumers can suppress
19
+ // the warning by passing `reactDomClientWarning` from 'react-on-rails/webpackHelpers' to their
20
+ // webpack `ignoreWarnings` config. See #3137.
19
21
  try {
20
22
  reactDomClient = require('react-dom/client');
21
23
  }
@@ -0,0 +1,11 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { RenderReturnType } from './types/index.ts' with { 'resolution-mode': 'import' };
3
+ export declare const supportsRootApi: boolean;
4
+ export declare const supportsHydrate: boolean;
5
+ type HydrateOrRenderType = (domNode: Element, reactElement: ReactElement) => RenderReturnType;
6
+ export declare const reactHydrate: HydrateOrRenderType;
7
+ export declare function reactRender(domNode: Element, reactElement: ReactElement): RenderReturnType;
8
+ export declare const unmountComponentAtNode: (container: Element) => boolean;
9
+ export declare const ensureReactUseAvailable: () => void;
10
+ export {};
11
+ //# sourceMappingURL=reactApis.d.cts.map
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reactDomClientWarning = void 0;
4
+ /**
5
+ * Suppression pattern for the "Module not found: Can't resolve 'react-dom/client'"
6
+ * warning that webpack emits when building React 16/17 apps with react-on-rails.
7
+ *
8
+ * The warning is harmless: react-on-rails detects the React version at runtime and
9
+ * only calls into react-dom/client when React 18+ is available. But webpack's static
10
+ * analysis still tries to resolve the conditional require at build time, so the
11
+ * warning shows up on React 16/17 builds even though the build is healthy.
12
+ *
13
+ * Usage in your webpack config (Webpack 5 / Shakapacker):
14
+ *
15
+ * const { reactDomClientWarning } = require('react-on-rails/webpackHelpers');
16
+ *
17
+ * module.exports = {
18
+ * // ...
19
+ * ignoreWarnings: [reactDomClientWarning],
20
+ * };
21
+ *
22
+ * Webpack 4 / Webpacker 5 users can pass the same regex to
23
+ * `stats.warningsFilter` instead, since `ignoreWarnings` is a Webpack 5 option.
24
+ *
25
+ * Tracking issue: https://github.com/shakacode/react_on_rails/issues/3137
26
+ */
27
+ // eslint-disable-next-line import/prefer-default-export -- intentionally named so additional helpers can be added later without a breaking change
28
+ exports.reactDomClientWarning = /Module not found: Error: Can't resolve 'react-dom\/client'/;
29
+ //# sourceMappingURL=webpackHelpers.cjs.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Suppression pattern for the "Module not found: Can't resolve 'react-dom/client'"
3
+ * warning that webpack emits when building React 16/17 apps with react-on-rails.
4
+ *
5
+ * The warning is harmless: react-on-rails detects the React version at runtime and
6
+ * only calls into react-dom/client when React 18+ is available. But webpack's static
7
+ * analysis still tries to resolve the conditional require at build time, so the
8
+ * warning shows up on React 16/17 builds even though the build is healthy.
9
+ *
10
+ * Usage in your webpack config (Webpack 5 / Shakapacker):
11
+ *
12
+ * const { reactDomClientWarning } = require('react-on-rails/webpackHelpers');
13
+ *
14
+ * module.exports = {
15
+ * // ...
16
+ * ignoreWarnings: [reactDomClientWarning],
17
+ * };
18
+ *
19
+ * Webpack 4 / Webpacker 5 users can pass the same regex to
20
+ * `stats.warningsFilter` instead, since `ignoreWarnings` is a Webpack 5 option.
21
+ *
22
+ * Tracking issue: https://github.com/shakacode/react_on_rails/issues/3137
23
+ */
24
+ export declare const reactDomClientWarning: RegExp;
25
+ //# sourceMappingURL=webpackHelpers.d.cts.map
package/package.json CHANGED
@@ -1,9 +1,18 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "16.7.0-rc.0",
3
+ "version": "16.7.0-rc.1",
4
4
  "description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5
5
  "main": "lib/ReactOnRails.full.js",
6
6
  "type": "module",
7
+ "scripts": {
8
+ "build": "pnpm run clean && tsc",
9
+ "build-watch": "pnpm run clean && tsc --watch",
10
+ "clean": "rm -rf ./lib",
11
+ "test": "jest tests",
12
+ "type-check": "tsc --noEmit --noErrorTruncation",
13
+ "prepare": "[ -f lib/ReactOnRails.full.js ] || (rm -rf ./lib && tsc)",
14
+ "prepublishOnly": "pnpm run build"
15
+ },
7
16
  "repository": {
8
17
  "type": "git",
9
18
  "url": "git+https://github.com/shakacode/react_on_rails.git",
@@ -30,6 +39,7 @@
30
39
  "./createReactOutput": "./lib/createReactOutput.js",
31
40
  "./isServerRenderResult": "./lib/isServerRenderResult.js",
32
41
  "./reactApis": "./lib/reactApis.cjs",
42
+ "./webpackHelpers": "./lib/webpackHelpers.cjs",
33
43
  "./reactHydrateOrRender": "./lib/reactHydrateOrRender.js",
34
44
  "./turbolinksUtils": "./lib/turbolinksUtils.js",
35
45
  "./isRenderFunction": "./lib/isRenderFunction.js",
@@ -63,17 +73,11 @@
63
73
  "lib/**/*.js",
64
74
  "lib/**/*.cjs",
65
75
  "lib/**/*.mjs",
66
- "lib/**/*.d.ts"
76
+ "lib/**/*.d.ts",
77
+ "lib/**/*.d.cts"
67
78
  ],
68
79
  "bugs": {
69
80
  "url": "https://github.com/shakacode/react_on_rails/issues"
70
81
  },
71
- "homepage": "https://reactonrails.com/docs/",
72
- "scripts": {
73
- "build": "pnpm run clean && tsc",
74
- "build-watch": "pnpm run clean && tsc --watch",
75
- "clean": "rm -rf ./lib",
76
- "test": "jest tests",
77
- "type-check": "tsc --noEmit --noErrorTruncation"
78
- }
79
- }
82
+ "homepage": "https://reactonrails.com/docs/"
83
+ }
package/LICENSE.md DELETED
@@ -1,83 +0,0 @@
1
- # Licensing
2
-
3
- This repository contains code under two different licenses:
4
-
5
- - **Core**: MIT License (applies to most files)
6
- - **Pro**: React on Rails Pro License (applies to specific directories)
7
-
8
- ## License Scope
9
-
10
- ### MIT Licensed Code
11
-
12
- The following directories and all their contents are licensed under the **MIT License** (see full text below):
13
-
14
- - `react_on_rails/` (entire directory, including lib/, spec/, sig/)
15
- - `packages/react-on-rails/` (entire package)
16
- - All other directories in this repository not explicitly listed as Pro-licensed
17
-
18
- ### Pro Licensed Code
19
-
20
- The following directories and all their contents are licensed under the **React on Rails Pro License**:
21
-
22
- - `packages/react-on-rails-pro/` (entire package)
23
- - `packages/react-on-rails-pro-node-renderer/` (entire package)
24
- - `react_on_rails_pro/` (entire directory)
25
-
26
- See [REACT-ON-RAILS-PRO-LICENSE.md](./REACT-ON-RAILS-PRO-LICENSE.md) for complete Pro license terms.
27
-
28
- **Important:** Pro-licensed code is included in this package but requires a valid React on Rails Pro subscription to use. Using Pro features without a valid license violates the React on Rails Pro License.
29
-
30
- ---
31
-
32
- ## MIT License
33
-
34
- This license applies to all MIT-licensed code as defined above.
35
-
36
- Copyright (c) 2017, 2018 Justin Gordon and ShakaCode
37
- Copyright (c) 2015–2025 ShakaCode, LLC
38
-
39
- Permission is hereby granted, free of charge, to any person obtaining a copy
40
- of this software and associated documentation files (the "Software"), to deal
41
- in the Software without restriction, including without limitation the rights
42
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
43
- copies of the Software, and to permit persons to whom the Software is
44
- furnished to do so, subject to the following conditions:
45
-
46
- The above copyright notice and this permission notice shall be included in
47
- all copies or substantial portions of the Software.
48
-
49
- ---
50
-
51
- ## Disclaimer
52
-
53
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
54
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
55
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
56
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
57
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
58
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
59
- SOFTWARE.
60
-
61
- ---
62
-
63
- ## React on Rails Pro License
64
-
65
- For Pro-licensed code (as defined in the "License Scope" section above), see:
66
- [REACT-ON-RAILS-PRO-LICENSE.md](./REACT-ON-RAILS-PRO-LICENSE.md)
67
-
68
- **Key Points:**
69
-
70
- - Pro features require a valid React on Rails Pro subscription for production use
71
- - Free use is permitted for educational, personal, and non-production purposes
72
- - Modifying MIT-licensed interface files is permitted under MIT terms
73
- - However, using those modifications to access Pro features without a valid license violates the Pro License
74
-
75
- ### License Validation Mechanisms
76
-
77
- **License validation mechanisms** include but are not limited to:
78
-
79
- - Runtime checks for valid Pro subscriptions
80
- - Authentication systems in `react_on_rails/lib/react_on_rails/utils.rb` and Pro TypeScript modules
81
- - The `react_on_rails_pro?` method and `rorPro` field generation
82
-
83
- While MIT-licensed code may be modified under MIT terms, using such modifications to access Pro features without a valid license violates the React on Rails Pro License.