react-on-rails-pro 16.2.0-beta.8 → 16.2.0-test.2
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.
- package/LICENSE.md +83 -0
- package/lib/streamingUtils.js +7 -2
- package/package.json +15 -18
package/LICENSE.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
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.
|
package/lib/streamingUtils.js
CHANGED
|
@@ -15,7 +15,7 @@ import * as React from 'react';
|
|
|
15
15
|
import { PassThrough, Readable } from 'stream';
|
|
16
16
|
import createReactOutput from 'react-on-rails/createReactOutput';
|
|
17
17
|
import { isPromise, isServerRenderHash } from 'react-on-rails/isServerRenderResult';
|
|
18
|
-
import
|
|
18
|
+
import { consoleReplay } from 'react-on-rails/buildConsoleReplay';
|
|
19
19
|
import { createResultObject, convertToError, validateComponent } from 'react-on-rails/serverRenderUtils';
|
|
20
20
|
import { assertRailsContextWithServerComponentMetadata, } from 'react-on-rails/types';
|
|
21
21
|
import * as ComponentRegistry from "./ComponentRegistry.js";
|
|
@@ -92,7 +92,12 @@ export const transformRenderStreamChunksToResultObject = (renderState) => {
|
|
|
92
92
|
const transformStream = new PassThrough({
|
|
93
93
|
transform(chunk, _, callback) {
|
|
94
94
|
const htmlChunk = chunk.toString();
|
|
95
|
-
|
|
95
|
+
// Get unwrapped console replay JavaScript (not wrapped in <script> tags)
|
|
96
|
+
// We use consoleReplay() instead of buildConsoleReplay() because streaming
|
|
97
|
+
// contexts handle script tag wrapping separately (e.g., with CSP nonces).
|
|
98
|
+
// This returns pure JavaScript without wrapping, which is then embedded
|
|
99
|
+
// into the result object JSON payload.
|
|
100
|
+
const consoleReplayScript = consoleReplay(consoleHistory, previouslyReplayedConsoleMessages);
|
|
96
101
|
previouslyReplayedConsoleMessages = consoleHistory?.length || 0;
|
|
97
102
|
const jsonChunk = JSON.stringify(createResultObject(htmlChunk, consoleReplayScript, renderState));
|
|
98
103
|
this.push(`${jsonChunk}\n`);
|
package/package.json
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-on-rails-pro",
|
|
3
|
-
"version": "16.2.0-
|
|
3
|
+
"version": "16.2.0-test.2",
|
|
4
4
|
"description": "React on Rails Pro package with React Server Components support",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "yarn run clean && yarn run tsc",
|
|
8
|
-
"build-watch": "yarn run clean && yarn run tsc --watch",
|
|
9
|
-
"clean": "rm -rf ./lib",
|
|
10
|
-
"test": "yarn test:non-rsc && yarn test:rsc",
|
|
11
|
-
"test:non-rsc": "jest tests --testPathIgnorePatterns=\".*(.rsc.test.).*\"",
|
|
12
|
-
"test:rsc": "NODE_CONDITIONS=react-server jest tests/*.rsc.test.*",
|
|
13
|
-
"type-check": "yarn run tsc --noEmit --noErrorTruncation",
|
|
14
|
-
"prepack": "nps build.prepack",
|
|
15
|
-
"prepare": "nps build.prepack",
|
|
16
|
-
"prepublishOnly": "yarn run build",
|
|
17
|
-
"yalc:publish": "yalc publish",
|
|
18
|
-
"yalc": "yalc"
|
|
19
|
-
},
|
|
20
6
|
"repository": {
|
|
21
7
|
"type": "git",
|
|
22
8
|
"url": "git+https://github.com/shakacode/react_on_rails.git"
|
|
@@ -29,7 +15,7 @@
|
|
|
29
15
|
"react-on-rails",
|
|
30
16
|
"pro"
|
|
31
17
|
],
|
|
32
|
-
"author": "justin
|
|
18
|
+
"author": "justin@shakacode.com",
|
|
33
19
|
"license": "UNLICENSED",
|
|
34
20
|
"exports": {
|
|
35
21
|
".": {
|
|
@@ -56,7 +42,7 @@
|
|
|
56
42
|
"./ServerComponentFetchError": "./lib/ServerComponentFetchError.js"
|
|
57
43
|
},
|
|
58
44
|
"dependencies": {
|
|
59
|
-
"react-on-rails": "16.2.0-
|
|
45
|
+
"react-on-rails": "16.2.0-test.2"
|
|
60
46
|
},
|
|
61
47
|
"peerDependencies": {
|
|
62
48
|
"react": ">= 16",
|
|
@@ -79,5 +65,16 @@
|
|
|
79
65
|
"devDependencies": {
|
|
80
66
|
"@types/mock-fs": "^4.13.4",
|
|
81
67
|
"mock-fs": "^5.5.0"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"build": "pnpm run clean && tsc",
|
|
71
|
+
"build-watch": "pnpm run clean && tsc --watch",
|
|
72
|
+
"clean": "rm -rf ./lib",
|
|
73
|
+
"test": "pnpm run test:non-rsc && pnpm run test:rsc",
|
|
74
|
+
"test:non-rsc": "jest tests --testPathIgnorePatterns=\".*(RSC|stream|registerServerComponent|serverRenderReactComponent|SuspenseHydration).*\"",
|
|
75
|
+
"test:rsc": "node scripts/check-react-version.cjs || NODE_CONDITIONS=react-server jest tests/*.rsc.test.*",
|
|
76
|
+
"type-check": "tsc --noEmit --noErrorTruncation",
|
|
77
|
+
"yalc:publish": "yalc publish",
|
|
78
|
+
"yalc": "yalc"
|
|
82
79
|
}
|
|
83
|
-
}
|
|
80
|
+
}
|