react_on_rails_pro 16.2.0.beta.12 → 16.2.0.beta.13

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.
data/package-scripts.yml CHANGED
@@ -1,39 +1,22 @@
1
1
  scripts:
2
- test:
3
- default:
4
- description: Run all JS tests
5
- script: jest packages/node-renderer
6
- ci:
7
- description: Run all JS tests in CI mode
8
- # https://circleci.com/docs/collect-test-data/#jest
9
- script: jest --ci --runInBand --reporters=default --reporters=jest-junit -- packages/node-renderer
10
- debug:
11
- description: Debug all JS tests
12
- script: ndb jest --runInBand packages/node-renderer
13
- check:
14
- description: Run all checks
15
- script: nps lint && nps format.listDifferent && nps test && nps check-typescript
16
- check-typescript:
17
- description: Check for TypeScript errors
18
- script: nps "build --noEmit" && tsc --project packages/node-renderer/tests && cd spec/dummy && yarn run tsc -p ./tsconfig.json --noEmit
19
2
  fix:
20
3
  description: Run all code fixes before committing
21
4
  script: nps eslint.fix && nps format
22
5
  node-renderer:
23
6
  default:
24
7
  description:
25
- script: nps build && node --enable-source-maps packages/node-renderer/dist/default-node-renderer.js
8
+ script: nps build && node --enable-source-maps ../packages/react-on-rails-pro-node-renderer/lib/default-node-renderer.js
26
9
  debug:
27
10
  description: Debug Node Renderer
28
- script: rm -rf /tmp/react-on-rails-pro-node-renderer-bundles && nps build && RENDERER_LOG_LEVEL=info NODE_DEBUG=ROR node --enable-source-maps packages/node-renderer/dist/default-node-renderer.js
11
+ script: rm -rf /tmp/react-on-rails-pro-node-renderer-bundles && nps build && RENDERER_LOG_LEVEL=info NODE_DEBUG=ROR node --enable-source-maps ../packages/react-on-rails-pro-node-renderer/lib/default-node-renderer.js
29
12
  lint:
30
13
  description: Run all linters
31
- script: concurrently --prefix "[{name}]" --names "ESLINT, RUBOCOP, PRETTIER" -c "blue,yellow,magenta,orange" "nps eslint" "bundle exec rubocop" "nps format.listDifferent"
14
+ script: npx concurrently --prefix "[{name}]" --names "ESLINT, RUBOCOP, PRETTIER" -c "blue,yellow,magenta,orange" "nps eslint" "bundle exec rubocop" "nps format.listDifferent"
32
15
 
33
16
  build:
34
17
  default:
35
18
  description: Build the project
36
- script: echo "building the project" && rm -rf packages/node-renderer/dist && tsc --project packages/node-renderer/src
19
+ script: echo "building the project" && rm -rf ../packages/react-on-rails-pro-node-renderer/lib && npx tsc --project ../packages/react-on-rails-pro-node-renderer/src
37
20
  prepack:
38
21
  description: Build the project in the prepack/prepare scripts
39
22
  # This is necessary when used as a Git dependency since we don't have the dist directory in the repo.
@@ -44,34 +27,34 @@ scripts:
44
27
  # 3. Check if the project is built now;
45
28
  # 4. If it failed, print an error message (still follow https://docs.npmjs.com/cli/v8/using-npm/scripts#best-practices).
46
29
  script: >
47
- [ -f packages/node-renderer/dist/ReactOnRailsProNodeRenderer.js ] ||
30
+ [ -f ../packages/react-on-rails-pro-node-renderer/lib/ReactOnRailsProNodeRenderer.js ] ||
48
31
  (nps build >/dev/null 2>&1 || true) &&
49
- [ -f packages/node-renderer/dist/ReactOnRailsProNodeRenderer.js ] ||
32
+ [ -f ../packages/react-on-rails-pro-node-renderer/lib/ReactOnRailsProNodeRenderer.js ] ||
50
33
  { echo 'Building react-on-rails-pro-node-renderer seems to have failed!'; }
51
34
 
52
35
  clean:
53
36
  description: Clean the project
54
- script: rm -rf packages/node-renderer/dist
37
+ script: rm -rf ../packages/react-on-rails-pro-node-renderer/lib
55
38
 
56
39
  eslint:
57
40
  default:
58
41
  description: Run eslint.
59
- script: eslint . --report-unused-disable-directives
42
+ script: npx eslint . --report-unused-disable-directives
60
43
  fix:
61
44
  description: Run eslint and auto-fix.
62
- script: nps "eslint --fix"
45
+ script: npx eslint . --report-unused-disable-directives --fix
63
46
  debug:
64
47
  description: Run eslint in debug mode.
65
- script: DEBUG=eslint:cli-engine nps eslint
48
+ script: DEBUG=eslint:cli-engine npx eslint . --report-unused-disable-directives
66
49
 
67
50
  format:
68
51
  default:
69
52
  description: Format files using prettier.
70
- script: concurrently --prefix "[{name}]" --names "js,ts,json" -c "yellow,magenta,green" "nps format.js" "nps format.ts" "nps format.json"
53
+ script: npx concurrently --prefix "[{name}]" --names "js,ts,json" -c "yellow,magenta,green" "nps format.js" "nps format.ts" "nps format.json"
71
54
  listDifferent:
72
55
  description: Check that all files were formatted using prettier.
73
56
  script: |
74
- concurrently \
57
+ npx concurrently \
75
58
  --prefix "[{name}]" \
76
59
  --names "js,ts,json" \
77
60
  -c "yellow,magenta,green" \
@@ -81,29 +64,29 @@ scripts:
81
64
  js:
82
65
  default:
83
66
  description: Run prettier on JS.
84
- script: prettier "**/*.@(js|jsx|mjs)" --write
67
+ script: npx prettier "**/*.@(js|jsx|mjs)" --write
85
68
  listDifferent:
86
69
  description: Check if any JS files would change by running prettier.
87
- script: prettier "**/*.@(js|jsx|mjs)" --list-different
70
+ script: npx prettier "**/*.@(js|jsx|mjs)" --list-different
88
71
  ts:
89
72
  default:
90
73
  description: Run prettier on TS.
91
- script: prettier "**/*.@(ts|tsx)" --write
74
+ script: npx prettier "**/*.@(ts|tsx)" --write
92
75
  listDifferent:
93
76
  description: Check if any TS files would change by running prettier.
94
- script: prettier "**/*.@(ts|tsx)" --list-different
77
+ script: npx prettier "**/*.@(ts|tsx)" --list-different
95
78
  json:
96
79
  default:
97
80
  description: Run prettier on JSON files.
98
- script: rm -rf packages/node-renderer/tests/tmp && prettier "**/*.json" --write
81
+ script: rm -rf ../packages/react-on-rails-pro-node-renderer/tests/tmp && npx prettier "**/*.json" --write
99
82
  listDifferent:
100
83
  description: Check if any JSON files would change by running prettier.
101
- script: prettier "**/*.json" --list-different
84
+ script: npx prettier "**/*.json" --list-different
102
85
 
103
86
  renderer:
104
87
  default:
105
88
  description: Starts the node renderer.
106
- script: nps build && RENDERER_PORT=3800 RENDERER_SUPPORT_MODULES=TRUE node ./packages/node-renderer/dist/default-node-renderer.js
89
+ script: nps build && RENDERER_PORT=3800 RENDERER_SUPPORT_MODULES=TRUE node ../packages/react-on-rails-pro-node-renderer/lib/default-node-renderer.js
107
90
  debug:
108
91
  description: Starts the node renderer with debugging enabled. See Node.js V8 --inspector Manager (NiM)
109
- script: nps build && RENDERER_WORKERS_COUNT=1 RENDERER_PORT=3800 RENDERER_SUPPORT_MODULES=TRUE ndb ./packages/node-renderer/dist/default-node-renderer.js
92
+ script: nps build && RENDERER_WORKERS_COUNT=1 RENDERER_PORT=3800 RENDERER_SUPPORT_MODULES=TRUE ndb ../packages/react-on-rails-pro-node-renderer/lib/default-node-renderer.js
data/package.json CHANGED
@@ -1,159 +1,14 @@
1
1
  {
2
- "name": "react-on-rails-pro-node-renderer",
3
- "version": "16.2.0-beta.12",
4
- "protocolVersion": "2.0.0",
5
- "description": "react-on-rails-pro JavaScript for react_on_rails_pro Ruby gem",
6
- "exports": {
7
- ".": {
8
- "types": "./packages/node-renderer/dist/ReactOnRailsProNodeRenderer.d.ts",
9
- "default": "./packages/node-renderer/dist/ReactOnRailsProNodeRenderer.js"
10
- },
11
- "./integrations/*": {
12
- "types": "./packages/node-renderer/dist/integrations/*.d.ts",
13
- "default": "./packages/node-renderer/dist/integrations/*.js"
14
- },
15
- "./package.json": "./package.json"
16
- },
17
- "bin": {
18
- "react-on-rails-pro-node-renderer": "packages/node-renderer/dist/default-node-renderer.js"
19
- },
20
- "directories": {
21
- "doc": "docs"
22
- },
23
- "resolutions": {
24
- "sentry-testkit/body-parser": "npm:empty-npm-package@1.0.0",
25
- "sentry-testkit/express": "npm:empty-npm-package@1.0.0"
26
- },
27
- "dependencies": {
28
- "@fastify/formbody": "^7.4.0 || ^8.0.2",
29
- "@fastify/multipart": "^8.3.1 || ^9.0.3",
30
- "fastify": "^4.29.0 || ^5.2.1",
31
- "fs-extra": "^11.2.0",
32
- "jsonwebtoken": "^9.0.2",
33
- "lockfile": "^1.0.4"
34
- },
35
- "devDependencies": {
36
- "@babel/core": "^7.26.10",
37
- "@babel/eslint-parser": "^7.27.0",
38
- "@babel/plugin-syntax-import-attributes": "^7.27.1",
39
- "@babel/preset-env": "^7.26.9",
40
- "@babel/preset-react": "^7.26.3",
41
- "@babel/preset-typescript": "^7.27.0",
42
- "@eslint/compat": "^1.2.8",
43
- "@honeybadger-io/js": "^6.10.1",
44
- "@sentry/node": "^7.120.0",
45
- "@tsconfig/node14": "^14.1.2",
46
- "@types/fs-extra": "^11.0.4",
47
- "@types/jest": "^29.5.12",
48
- "@types/jsonwebtoken": "^9.0.10",
49
- "@types/lockfile": "^1.0.4",
50
- "@types/touch": "^3.1.5",
51
- "babel-jest": "^29.7.0",
52
- "concurrently": "^9.1.0",
53
- "eslint": "^9.24.0",
54
- "eslint-config-prettier": "^10.1.1",
55
- "eslint-config-shakacode": "^19.0.0",
56
- "eslint-import-resolver-alias": "^1.1.2",
57
- "eslint-import-resolver-typescript": "^4.3.2",
58
- "eslint-plugin-import": "^2.31.0",
59
- "eslint-plugin-jest": "^28.11.0",
60
- "eslint-plugin-jsx-a11y": "^6.10.2",
61
- "eslint-plugin-prettier": "^5.2.6",
62
- "eslint-plugin-react": "^7.37.5",
63
- "eslint-plugin-react-hooks": "^5.2.0",
64
- "form-auto-content": "^3.2.1",
65
- "form-data": "^4.0.1",
66
- "globals": "^16.0.0",
67
- "husky": "^4.3.6",
68
- "jest": "^29.7.0",
69
- "jest-junit": "^16.0.0",
70
- "jsdom": "^16.5.0",
71
- "ndb": "^1.1.5",
72
- "node-html-parser": "^7.0.1",
73
- "nps": "^5.9.12",
74
- "pino-pretty": "^13.0.0",
75
- "prettier": "^3.2.5",
76
- "react-on-rails": "link:.yalc/react-on-rails",
77
- "redis": "^5.0.1",
78
- "sentry-testkit": "^5.0.6",
79
- "touch": "^3.1.0",
80
- "typescript": "^5.4.3",
81
- "typescript-eslint": "^8.29.1",
82
- "yalc": "^1.0.0-pre.53"
83
- },
84
- "peerDependencies": {
85
- "@honeybadger-io/js": ">=4.0.0",
86
- "@sentry/node": ">=5.0.0 <9.0.0",
87
- "@sentry/tracing": ">=5.0.0"
88
- },
89
- "peerDependenciesMeta": {
90
- "@honeybadger-io/js": {
91
- "optional": true
92
- },
93
- "@sentry/node": {
94
- "optional": true
95
- },
96
- "@sentry/tracing": {
97
- "optional": true
98
- }
99
- },
100
- "files": [
101
- "packages/node-renderer/dist",
102
- "script/preinstall.js"
103
- ],
2
+ "name": "react-on-rails-pro-dev",
3
+ "version": "16.2.0-test.2",
4
+ "private": true,
5
+ "description": "Development workspace for react-on-rails-pro (not published)",
104
6
  "scripts": {
105
- "preinstall": "node ./script/preinstall.js",
106
- "postinstall": "test -f post-yarn-install.local && ./post-yarn-install.local || true",
107
- "link-source": "cd ../packages/react-on-rails && yarn && yalc publish",
108
- "test": "nps test",
109
- "prepack": "nps build.prepack",
110
- "prepare": "nps build.prepack",
111
- "prepublishOnly": "nps build",
7
+ "nps": "nps",
112
8
  "start": "nps",
113
- "developing": "nps node-renderer.debug",
114
- "eslint": "eslint .",
115
- "check": "nps lint && nps format && nps test"
116
- },
117
- "repository": {
118
- "type": "git",
119
- "url": "git+https://github.com/shakacode/react_on_rails.git"
120
- },
121
- "keywords": [
122
- "react",
123
- "webpack",
124
- "JavaScript",
125
- "Ruby",
126
- "on",
127
- "Rails"
128
- ],
129
- "author": "justin@shakacode.com",
130
- "license": "UNLICENSED",
131
- "bugs": {
132
- "url": "https://github.com/shakacode/react_on_rails/issues"
9
+ "prettier": "npx prettier"
133
10
  },
134
- "homepage": "https://github.com/shakacode/react_on_rails/tree/master/react_on_rails_pro#readme",
135
- "jest": {
136
- "clearMocks": true,
137
- "collectCoverageFrom": [
138
- "packages/node-renderer/tests/**/*.{js,jsx,ts,tsx}"
139
- ],
140
- "coverageReporters": [
141
- "lcov"
142
- ],
143
- "resetModules": true,
144
- "resetMocks": true,
145
- "setupFiles": [
146
- "./packages/node-renderer/tests/helper.ts"
147
- ],
148
- "testEnvironment": "node",
149
- "transform": {
150
- "^.+\\.[jt]sx?$": "babel-jest"
151
- }
152
- },
153
- "husky": {
154
- "hooks": {
155
- "pre-commit": "yalc check"
156
- }
157
- },
158
- "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
11
+ "devDependencies": {
12
+ "nps": "^5.9.3"
13
+ }
159
14
  }
@@ -41,7 +41,7 @@ task :js_tests do
41
41
  sh "yarn run test"
42
42
  end
43
43
 
44
- msg = <<-DESC.strip_heredoc
44
+ msg = <<~DESC
45
45
  Runs all tests, run `rake -D run_rspec` to see all available test options.
46
46
  DESC
47
47
  desc msg
@@ -6,7 +6,7 @@ require "react_on_rails_pro/version"
6
6
 
7
7
  # Load the core react_on_rails version for dependency
8
8
  # This is evaluated at build time, not on user machines
9
- require_relative "../lib/react_on_rails/version"
9
+ require_relative "../react_on_rails/lib/react_on_rails/version"
10
10
 
11
11
  Gem::Specification.new do |s|
12
12
  s.name = "react_on_rails_pro"
@@ -20,12 +20,11 @@ Gem::Specification.new do |s|
20
20
  s.license = "UNLICENSED"
21
21
  s.metadata["rubygems_mfa_required"] = "true"
22
22
 
23
- s.files = `git ls-files -z`.split("\x0")
24
- .reject { |f|
25
- f.match(
26
- %r{^(test|spec|features|tmp|node_modules|packages|coverage|Gemfile.lock|lib/tasks)/}
27
- )
28
- }
23
+ s.files = Dir.chdir(__dir__) do
24
+ `git ls-files -z`.split("\x0").reject do |f|
25
+ f.match(%r{^(test|spec|features|tmp|node_modules|packages|coverage|Gemfile.lock|lib/tasks)/})
26
+ end
27
+ end
29
28
  s.bindir = "exe"
30
29
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
30
  s.require_paths = ["lib"]
@@ -36,6 +35,9 @@ Gem::Specification.new do |s|
36
35
  s.add_runtime_dependency "connection_pool"
37
36
  s.add_runtime_dependency "execjs", "~> 2.9"
38
37
  s.add_runtime_dependency "httpx", "~> 1.5"
38
+ # Needed to avoid this bug at httpx versions >= 1.6.0:
39
+ # https://github.com/HoneyryderChuck/httpx/issues/118
40
+ s.add_runtime_dependency "http-2", ">= 1.1.1"
39
41
  s.add_runtime_dependency "jwt", "~> 2.7"
40
42
  s.add_runtime_dependency "async", ">= 2.6"
41
43
  s.add_runtime_dependency "rainbow"
@@ -0,0 +1,15 @@
1
+ module ReactOnRailsPro
2
+ class AsyncValue
3
+ @task: untyped
4
+
5
+ def initialize: (task: untyped) -> void
6
+
7
+ def value: () -> untyped
8
+
9
+ def resolved?: () -> bool
10
+
11
+ def to_s: () -> String
12
+
13
+ def html_safe: () -> untyped
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module ReactOnRailsPro
2
+ module AsyncRendering
3
+ module ClassMethods
4
+ def enable_async_react_rendering: (**untyped options) -> void
5
+ end
6
+
7
+ @react_on_rails_async_barrier: untyped
8
+
9
+ private
10
+
11
+ def wrap_in_async_react_context: () { () -> untyped } -> untyped
12
+
13
+ def check_for_unresolved_async_components: () -> void
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module ReactOnRailsPro
2
+ class ImmediateAsyncValue
3
+ attr_reader value: untyped
4
+
5
+ @value: untyped
6
+
7
+ def initialize: (untyped value) -> void
8
+
9
+ def resolved?: () -> bool
10
+
11
+ def to_s: () -> String
12
+
13
+ def html_safe: () -> untyped
14
+ end
15
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react_on_rails_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.2.0.beta.12
4
+ version: 16.2.0.beta.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-11-21 00:00:00.000000000 Z
11
+ date: 2025-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: http-2
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 1.1.1
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 1.1.1
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: jwt
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +128,14 @@ dependencies:
114
128
  requirements:
115
129
  - - '='
116
130
  - !ruby/object:Gem::Version
117
- version: 16.2.0.beta.12
131
+ version: 16.2.0.beta.13
118
132
  type: :runtime
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
136
  - - '='
123
137
  - !ruby/object:Gem::Version
124
- version: 16.2.0.beta.12
138
+ version: 16.2.0.beta.13
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: bundler
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -250,13 +264,16 @@ files:
250
264
  - eslint.config.mjs
251
265
  - lib/react_on_rails_pro.rb
252
266
  - lib/react_on_rails_pro/assets_precompile.rb
267
+ - lib/react_on_rails_pro/async_value.rb
253
268
  - lib/react_on_rails_pro/cache.rb
269
+ - lib/react_on_rails_pro/concerns/async_rendering.rb
254
270
  - lib/react_on_rails_pro/concerns/rsc_payload_renderer.rb
255
271
  - lib/react_on_rails_pro/concerns/stream.rb
256
272
  - lib/react_on_rails_pro/configuration.rb
257
273
  - lib/react_on_rails_pro/constants.rb
258
274
  - lib/react_on_rails_pro/engine.rb
259
275
  - lib/react_on_rails_pro/error.rb
276
+ - lib/react_on_rails_pro/immediate_async_value.rb
260
277
  - lib/react_on_rails_pro/license_public_key.rb
261
278
  - lib/react_on_rails_pro/license_validator.rb
262
279
  - lib/react_on_rails_pro/prepare_node_renderer_bundles.rb
@@ -283,15 +300,16 @@ files:
283
300
  - react_on_rails_pro.gemspec
284
301
  - readme-gen-docs.md
285
302
  - script/bootstrap
286
- - script/preinstall.js
287
303
  - script/setup
288
304
  - script/test
289
305
  - sig/react_on_rails_pro.rbs
306
+ - sig/react_on_rails_pro/async_value.rbs
290
307
  - sig/react_on_rails_pro/cache.rbs
308
+ - sig/react_on_rails_pro/concerns/async_rendering.rbs
291
309
  - sig/react_on_rails_pro/configuration.rbs
292
310
  - sig/react_on_rails_pro/error.rbs
311
+ - sig/react_on_rails_pro/immediate_async_value.rbs
293
312
  - sig/react_on_rails_pro/utils.rbs
294
- - yarn.lock
295
313
  homepage: https://github.com/shakacode/react_on_rails_pro
296
314
  licenses:
297
315
  - UNLICENSED
data/script/preinstall.js DELETED
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const path = require('path');
4
- const cp = require('child_process');
5
-
6
- const inNodeModules = __dirname.split(path.sep).includes('node_modules');
7
-
8
- if (inNodeModules) {
9
- console.log('preinstall: running inside node_modules — skipping link steps.');
10
- process.exit(0);
11
- }
12
-
13
- function runCommand(cmd, args) {
14
- const res = cp.spawnSync(cmd, args, { stdio: 'inherit' });
15
- if (res.error) throw res.error;
16
- if (res.status !== 0) throw new Error(`${cmd} ${args.join(' ')} exited with status ${res.status}`);
17
- }
18
-
19
- try {
20
- // Run the original optional link steps sequentially in a cross-platform way.
21
- // First run the package script `link-source` via yarn, which will run any shell ops inside the script
22
- // (yarn itself will handle invoking a shell for the script body), then call yalc.
23
- runCommand('yarn', ['run', 'link-source']);
24
- runCommand('yalc', ['add', '--link', 'react-on-rails']);
25
- } catch (err) {
26
- // Don't fail the overall install if these optional commands aren't available or fail,
27
- // just log the error.
28
- console.error('preinstall: optional link steps failed or are unavailable — continuing.', err);
29
- // Keep the exit code 0 so the install doesn't fail.
30
- process.exit(0);
31
- }