react_on_rails 16.2.0.beta.4 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -8
- data/CONTRIBUTING.md +1 -1
- data/Gemfile.development_dependencies +0 -1
- data/Gemfile.lock +1 -9
- data/bin/ci-rerun-failures +39 -16
- data/bin/ci-run-failed-specs +1 -1
- data/bin/ci-switch-config +8 -2
- data/bin/lefthook/ruby-autofix +2 -1
- data/knip.ts +35 -9
- data/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt +32 -52
- data/lib/generators/react_on_rails/templates/base/base/config/shakapacker.yml +5 -1
- data/lib/react_on_rails/dev/server_manager.rb +11 -4
- data/lib/react_on_rails/doctor.rb +245 -0
- data/lib/react_on_rails/helper.rb +9 -0
- data/lib/react_on_rails/version.rb +1 -1
- data/react_on_rails_pro/CHANGELOG.md +7 -0
- data/react_on_rails_pro/CONTRIBUTING.md +2 -13
- data/react_on_rails_pro/Gemfile.lock +21 -3
- data/react_on_rails_pro/docs/code-splitting-loadable-components.md +1 -1
- data/react_on_rails_pro/docs/contributors-info/releasing.md +2 -2
- data/react_on_rails_pro/docs/installation.md +106 -104
- data/react_on_rails_pro/docs/node-renderer/basics.md +3 -3
- data/react_on_rails_pro/docs/node-renderer/error-reporting-and-tracing.md +8 -8
- data/react_on_rails_pro/docs/node-renderer/js-configuration.md +1 -1
- data/react_on_rails_pro/docs/updating.md +209 -15
- data/react_on_rails_pro/lib/react_on_rails_pro/concerns/stream.rb +58 -4
- data/react_on_rails_pro/lib/react_on_rails_pro/configuration.rb +17 -3
- data/react_on_rails_pro/lib/react_on_rails_pro/license_public_key.rb +9 -9
- data/react_on_rails_pro/lib/react_on_rails_pro/request.rb +41 -25
- data/react_on_rails_pro/lib/react_on_rails_pro/stream_request.rb +27 -7
- data/react_on_rails_pro/lib/react_on_rails_pro/utils.rb +3 -3
- data/react_on_rails_pro/lib/react_on_rails_pro/version.rb +1 -1
- data/react_on_rails_pro/package-scripts.yml +1 -1
- data/react_on_rails_pro/package.json +5 -8
- data/react_on_rails_pro/packages/node-renderer/src/integrations/api.ts +1 -1
- data/react_on_rails_pro/rakelib/public_key_management.rake +6 -5
- data/react_on_rails_pro/react_on_rails_pro.gemspec +1 -0
- data/react_on_rails_pro/spec/dummy/Gemfile.lock +20 -3
- data/react_on_rails_pro/spec/dummy/app/controllers/pages_controller.rb +3 -3
- data/react_on_rails_pro/spec/dummy/bin/dev +4 -8
- data/react_on_rails_pro/spec/dummy/client/node-renderer.js +3 -3
- data/react_on_rails_pro/spec/dummy/config/environments/production.rb +1 -1
- data/react_on_rails_pro/spec/dummy/config/initializers/react_on_rails.rb +28 -12
- data/react_on_rails_pro/spec/dummy/config.ru +1 -1
- data/react_on_rails_pro/spec/dummy/package.json +2 -2
- data/react_on_rails_pro/spec/dummy/spec/helpers/react_on_rails_pro_helper_spec.rb +40 -11
- data/react_on_rails_pro/spec/dummy/spec/rails_helper.rb +1 -1
- data/react_on_rails_pro/spec/dummy/spec/requests/renderer_console_logging_spec.rb +5 -5
- data/react_on_rails_pro/spec/dummy/spec/system/integration_spec.rb +20 -14
- data/react_on_rails_pro/spec/dummy/spec/system/renderer_integration_spec.rb +3 -3
- data/react_on_rails_pro/spec/dummy/yarn.lock +4 -4
- data/react_on_rails_pro/spec/execjs-compatible-dummy/config/environments/production.rb +1 -1
- data/react_on_rails_pro/spec/execjs-compatible-dummy/config/initializers/react_on_rails.rb +16 -43
- data/react_on_rails_pro/spec/react_on_rails_pro/assets_precompile_spec.rb +15 -18
- data/react_on_rails_pro/spec/react_on_rails_pro/cache_spec.rb +1 -1
- data/react_on_rails_pro/spec/react_on_rails_pro/configuration_spec.rb +5 -3
- data/react_on_rails_pro/spec/react_on_rails_pro/license_validator_spec.rb +27 -12
- data/react_on_rails_pro/spec/react_on_rails_pro/request_spec.rb +0 -27
- data/react_on_rails_pro/spec/react_on_rails_pro/spec_helper.rb +1 -1
- data/react_on_rails_pro/spec/react_on_rails_pro/stream_decorator_spec.rb +89 -0
- data/react_on_rails_pro/spec/react_on_rails_pro/stream_spec.rb +144 -0
- data/react_on_rails_pro/spec/react_on_rails_pro/support/caching.rb +1 -1
- data/react_on_rails_pro/spec/react_on_rails_pro/support/mock_block_helper.rb +4 -2
- metadata +2 -3
- data/react_on_rails_pro/spec/dummy/client/app/ror-auto-load-components/TestingStreamableComponent.jsx +0 -15
|
@@ -154,6 +154,7 @@ module ReactOnRails
|
|
|
154
154
|
def check_configuration_details
|
|
155
155
|
check_shakapacker_configuration_details
|
|
156
156
|
check_react_on_rails_configuration_details
|
|
157
|
+
check_server_bundle_prerender_consistency
|
|
157
158
|
end
|
|
158
159
|
|
|
159
160
|
def check_bin_dev_launcher
|
|
@@ -166,6 +167,7 @@ module ReactOnRails
|
|
|
166
167
|
|
|
167
168
|
def check_testing_setup
|
|
168
169
|
check_rspec_helper_setup
|
|
170
|
+
check_build_test_configuration
|
|
169
171
|
end
|
|
170
172
|
|
|
171
173
|
def check_development
|
|
@@ -173,6 +175,7 @@ module ReactOnRails
|
|
|
173
175
|
check_procfile_dev
|
|
174
176
|
check_bin_dev_script
|
|
175
177
|
check_gitignore
|
|
178
|
+
check_async_usage
|
|
176
179
|
end
|
|
177
180
|
|
|
178
181
|
def check_javascript_bundles
|
|
@@ -1110,6 +1113,124 @@ module ReactOnRails
|
|
|
1110
1113
|
end
|
|
1111
1114
|
end
|
|
1112
1115
|
|
|
1116
|
+
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
|
1117
|
+
def check_server_bundle_prerender_consistency
|
|
1118
|
+
config_path = "config/initializers/react_on_rails.rb"
|
|
1119
|
+
return unless File.exist?(config_path)
|
|
1120
|
+
|
|
1121
|
+
checker.add_info("\n🔍 Server Rendering Consistency:")
|
|
1122
|
+
|
|
1123
|
+
begin
|
|
1124
|
+
content = File.read(config_path)
|
|
1125
|
+
|
|
1126
|
+
# Check for server bundle configuration
|
|
1127
|
+
server_bundle_match = content.match(/config\.server_bundle_js_file\s*=\s*["']([^"']+)["']/)
|
|
1128
|
+
server_bundle_set = server_bundle_match && server_bundle_match[1].present?
|
|
1129
|
+
|
|
1130
|
+
# Check for global prerender setting
|
|
1131
|
+
prerender_match = content.match(/config\.prerender\s*=\s*(true)/)
|
|
1132
|
+
prerender_set = prerender_match
|
|
1133
|
+
|
|
1134
|
+
# Check if prerender is used in views
|
|
1135
|
+
uses_prerender = uses_prerender_in_views?
|
|
1136
|
+
|
|
1137
|
+
# Analyze the configuration
|
|
1138
|
+
if (prerender_set || uses_prerender) && !server_bundle_set
|
|
1139
|
+
checker.add_warning(" ⚠️ Server rendering is enabled but server_bundle_js_file is not configured")
|
|
1140
|
+
checker.add_info(" 💡 Set config.server_bundle_js_file = 'server-bundle.js' to enable SSR")
|
|
1141
|
+
checker.add_info(" 💡 See: https://www.shakacode.com/react-on-rails/docs/guides/server-rendering")
|
|
1142
|
+
elsif server_bundle_set && !prerender_set && !uses_prerender
|
|
1143
|
+
checker.add_info(" ℹ️ server_bundle_js_file is configured but prerender doesn't appear to be used")
|
|
1144
|
+
checker.add_info(" 💡 Either use prerender: true in react_component calls or remove server_bundle_js_file")
|
|
1145
|
+
else
|
|
1146
|
+
checker.add_success(" ✅ Server rendering configuration is consistent")
|
|
1147
|
+
end
|
|
1148
|
+
rescue StandardError => e
|
|
1149
|
+
checker.add_warning(" ⚠️ Could not analyze server rendering configuration: #{e.message}")
|
|
1150
|
+
end
|
|
1151
|
+
end
|
|
1152
|
+
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
|
1153
|
+
|
|
1154
|
+
def uses_prerender_in_views?
|
|
1155
|
+
# Check view files for prerender: true
|
|
1156
|
+
view_files = Dir.glob("app/views/**/*.{erb,haml,slim}")
|
|
1157
|
+
view_files.any? do |file|
|
|
1158
|
+
next unless File.exist?(file)
|
|
1159
|
+
|
|
1160
|
+
File.read(file).match?(/prerender:\s*true/)
|
|
1161
|
+
end
|
|
1162
|
+
rescue StandardError
|
|
1163
|
+
false
|
|
1164
|
+
end
|
|
1165
|
+
|
|
1166
|
+
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
|
|
1167
|
+
def check_build_test_configuration
|
|
1168
|
+
config_path = "config/initializers/react_on_rails.rb"
|
|
1169
|
+
shakapacker_yml = "config/shakapacker.yml"
|
|
1170
|
+
|
|
1171
|
+
return unless File.exist?(config_path)
|
|
1172
|
+
|
|
1173
|
+
checker.add_info("\n🧪 Test Asset Compilation:")
|
|
1174
|
+
|
|
1175
|
+
begin
|
|
1176
|
+
config_content = File.read(config_path)
|
|
1177
|
+
has_build_test_command = config_content.match(/^\s*config\.build_test_command\s*=\s*["']([^"']+)["']/)
|
|
1178
|
+
uses_test_helper = uses_react_on_rails_test_helper?
|
|
1179
|
+
|
|
1180
|
+
if File.exist?(shakapacker_yml)
|
|
1181
|
+
shakapacker_content = File.read(shakapacker_yml)
|
|
1182
|
+
# Match test section and look for compile: true
|
|
1183
|
+
has_compile_true = shakapacker_content.match(/^test:.*?^\s+compile:\s*true/m)
|
|
1184
|
+
|
|
1185
|
+
if has_build_test_command && has_compile_true
|
|
1186
|
+
checker.add_warning(" ⚠️ Both build_test_command and shakapacker compile: true are configured")
|
|
1187
|
+
checker.add_info(" 💡 These are mutually exclusive - use only one approach")
|
|
1188
|
+
checker.add_info(" 💡 Recommended: Use compile: true in shakapacker.yml (simpler)")
|
|
1189
|
+
checker.add_info(" 💡 Alternative: Use build_test_command with ReactOnRails::TestHelper (explicit control)")
|
|
1190
|
+
checker.add_info(" 📖 See: https://github.com/shakacode/react_on_rails/blob/master/docs/guides/testing-configuration.md")
|
|
1191
|
+
elsif has_build_test_command && !uses_test_helper
|
|
1192
|
+
checker.add_warning(" ⚠️ build_test_command is set but ReactOnRails::TestHelper is not configured")
|
|
1193
|
+
checker.add_info(" 💡 Add to spec/rails_helper.rb:")
|
|
1194
|
+
checker.add_info(" ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)")
|
|
1195
|
+
checker.add_info(" 💡 Or remove build_test_command and use compile: true in shakapacker.yml")
|
|
1196
|
+
elsif !has_build_test_command && uses_test_helper
|
|
1197
|
+
checker.add_error(" 🚫 ReactOnRails::TestHelper is configured but build_test_command is not set")
|
|
1198
|
+
checker.add_info(" 💡 Add to config/initializers/react_on_rails.rb:")
|
|
1199
|
+
checker.add_info(" config.build_test_command = 'RAILS_ENV=test bin/shakapacker'")
|
|
1200
|
+
checker.add_info(" 💡 Or remove TestHelper and use compile: true in shakapacker.yml")
|
|
1201
|
+
elsif !has_build_test_command && !has_compile_true && !uses_test_helper
|
|
1202
|
+
checker.add_warning(" ⚠️ No test asset compilation configured")
|
|
1203
|
+
checker.add_info(" 💡 Recommended: Add to shakapacker.yml test section:")
|
|
1204
|
+
checker.add_info(" compile: true")
|
|
1205
|
+
checker.add_info(" 📖 See: https://github.com/shakacode/react_on_rails/blob/master/docs/guides/testing-configuration.md")
|
|
1206
|
+
elsif has_compile_true
|
|
1207
|
+
checker.add_success(" ✅ Test assets configured via Shakapacker auto-compilation")
|
|
1208
|
+
checker.add_info(" (compile: true in shakapacker.yml)")
|
|
1209
|
+
elsif has_build_test_command && uses_test_helper
|
|
1210
|
+
checker.add_success(" ✅ Test assets configured via React on Rails test helper")
|
|
1211
|
+
checker.add_info(" (build_test_command + ReactOnRails::TestHelper)")
|
|
1212
|
+
end
|
|
1213
|
+
else
|
|
1214
|
+
checker.add_warning(" ⚠️ config/shakapacker.yml not found")
|
|
1215
|
+
end
|
|
1216
|
+
rescue StandardError => e
|
|
1217
|
+
checker.add_warning(" ⚠️ Could not analyze test configuration: #{e.message}")
|
|
1218
|
+
end
|
|
1219
|
+
end
|
|
1220
|
+
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
|
|
1221
|
+
|
|
1222
|
+
def uses_react_on_rails_test_helper?
|
|
1223
|
+
spec_helpers = ["spec/rails_helper.rb", "spec/spec_helper.rb", "test/test_helper.rb"]
|
|
1224
|
+
spec_helpers.any? do |helper|
|
|
1225
|
+
next unless File.exist?(helper)
|
|
1226
|
+
|
|
1227
|
+
content = File.read(helper)
|
|
1228
|
+
content.include?("configure_rspec_to_compile_assets") || content.include?("ensure_assets_compiled")
|
|
1229
|
+
end
|
|
1230
|
+
rescue StandardError
|
|
1231
|
+
false
|
|
1232
|
+
end
|
|
1233
|
+
|
|
1113
1234
|
def relativize_path(absolute_path)
|
|
1114
1235
|
return absolute_path unless absolute_path.is_a?(String)
|
|
1115
1236
|
|
|
@@ -1146,6 +1267,130 @@ module ReactOnRails
|
|
|
1146
1267
|
checker.add_info(" #{label}: <error reading value: #{e.message}>")
|
|
1147
1268
|
end
|
|
1148
1269
|
end
|
|
1270
|
+
|
|
1271
|
+
# Comment patterns used for filtering out commented async usage
|
|
1272
|
+
ERB_COMMENT_PATTERN = /<%\s*#.*javascript_pack_tag/
|
|
1273
|
+
HAML_COMMENT_PATTERN = /^\s*-#.*javascript_pack_tag/
|
|
1274
|
+
SLIM_COMMENT_PATTERN = %r{^\s*/.*javascript_pack_tag}
|
|
1275
|
+
HTML_COMMENT_PATTERN = /<!--.*javascript_pack_tag/
|
|
1276
|
+
|
|
1277
|
+
def check_async_usage
|
|
1278
|
+
# When Pro is installed, async is fully supported and is the default behavior
|
|
1279
|
+
# No need to check for async usage in this case
|
|
1280
|
+
return if ReactOnRails::Utils.react_on_rails_pro?
|
|
1281
|
+
|
|
1282
|
+
async_issues = []
|
|
1283
|
+
|
|
1284
|
+
# Check 1: javascript_pack_tag with :async in view files
|
|
1285
|
+
view_files_with_async = scan_view_files_for_async_pack_tag
|
|
1286
|
+
unless view_files_with_async.empty?
|
|
1287
|
+
async_issues << "javascript_pack_tag with :async found in view files:"
|
|
1288
|
+
view_files_with_async.each do |file|
|
|
1289
|
+
async_issues << " • #{file}"
|
|
1290
|
+
end
|
|
1291
|
+
end
|
|
1292
|
+
|
|
1293
|
+
# Check 2: generated_component_packs_loading_strategy = :async
|
|
1294
|
+
if config_has_async_loading_strategy?
|
|
1295
|
+
async_issues << "config.generated_component_packs_loading_strategy = :async in initializer"
|
|
1296
|
+
end
|
|
1297
|
+
|
|
1298
|
+
return if async_issues.empty?
|
|
1299
|
+
|
|
1300
|
+
# Report errors if async usage is found without Pro
|
|
1301
|
+
checker.add_error("🚫 :async usage detected without React on Rails Pro")
|
|
1302
|
+
async_issues.each { |issue| checker.add_error(" #{issue}") }
|
|
1303
|
+
checker.add_info(" 💡 :async can cause race conditions. Options:")
|
|
1304
|
+
checker.add_info(" 1. Upgrade to React on Rails Pro (recommended for :async support)")
|
|
1305
|
+
checker.add_info(" 2. Change to :defer or :sync loading strategy")
|
|
1306
|
+
checker.add_info(" 📖 https://www.shakacode.com/react-on-rails/docs/guides/configuration/")
|
|
1307
|
+
end
|
|
1308
|
+
|
|
1309
|
+
def scan_view_files_for_async_pack_tag
|
|
1310
|
+
view_patterns = ["app/views/**/*.erb", "app/views/**/*.haml", "app/views/**/*.slim"]
|
|
1311
|
+
files_with_async = view_patterns.flat_map { |pattern| scan_pattern_for_async(pattern) }
|
|
1312
|
+
files_with_async.compact
|
|
1313
|
+
rescue Errno::ENOENT, Encoding::InvalidByteSequenceError, Encoding::UndefinedConversionError => e
|
|
1314
|
+
# Log the error if Rails logger is available
|
|
1315
|
+
log_debug("Error scanning view files for async: #{e.message}")
|
|
1316
|
+
[]
|
|
1317
|
+
end
|
|
1318
|
+
|
|
1319
|
+
def scan_pattern_for_async(pattern)
|
|
1320
|
+
Dir.glob(pattern).filter_map do |file|
|
|
1321
|
+
next unless File.exist?(file)
|
|
1322
|
+
|
|
1323
|
+
content = File.read(file)
|
|
1324
|
+
next if content_has_only_commented_async?(content)
|
|
1325
|
+
next unless file_has_async_pack_tag?(content)
|
|
1326
|
+
|
|
1327
|
+
relativize_path(file)
|
|
1328
|
+
end
|
|
1329
|
+
end
|
|
1330
|
+
|
|
1331
|
+
def file_has_async_pack_tag?(content)
|
|
1332
|
+
# Match javascript_pack_tag with :async symbol or async: true hash syntax
|
|
1333
|
+
# Examples that should match:
|
|
1334
|
+
# - javascript_pack_tag "app", :async
|
|
1335
|
+
# - javascript_pack_tag "app", async: true
|
|
1336
|
+
# - javascript_pack_tag "app", :async, other_option: value
|
|
1337
|
+
# Examples that should NOT match:
|
|
1338
|
+
# - javascript_pack_tag "app", defer: "async" (async is a string value, not the option)
|
|
1339
|
+
# - javascript_pack_tag "app", :defer
|
|
1340
|
+
# Note: Theoretical edge case `data: { async: true }` would match but is extremely unlikely
|
|
1341
|
+
# in real code and represents a harmless false positive (showing a warning when not needed)
|
|
1342
|
+
# Use word boundary \b to ensure :async is not part of a longer symbol like :async_mode
|
|
1343
|
+
# [^<]* allows matching across newlines within ERB tags but stops at closing ERB tag
|
|
1344
|
+
content.match?(/javascript_pack_tag[^<]*(?::async\b|async:\s*true)/)
|
|
1345
|
+
end
|
|
1346
|
+
|
|
1347
|
+
def content_has_only_commented_async?(content)
|
|
1348
|
+
# Check if all occurrences of javascript_pack_tag with :async are in comments
|
|
1349
|
+
# Returns true if ONLY commented async usage exists (no active async usage)
|
|
1350
|
+
|
|
1351
|
+
# First check if there's any javascript_pack_tag with :async in the full content
|
|
1352
|
+
return true unless file_has_async_pack_tag?(content)
|
|
1353
|
+
|
|
1354
|
+
# Strategy: Remove all commented lines, then check if any :async remains
|
|
1355
|
+
# This handles both single-line and multi-line tags correctly
|
|
1356
|
+
uncommented_lines = content.each_line.reject do |line|
|
|
1357
|
+
line.match?(ERB_COMMENT_PATTERN) ||
|
|
1358
|
+
line.match?(HAML_COMMENT_PATTERN) ||
|
|
1359
|
+
line.match?(SLIM_COMMENT_PATTERN) ||
|
|
1360
|
+
line.match?(HTML_COMMENT_PATTERN)
|
|
1361
|
+
end
|
|
1362
|
+
|
|
1363
|
+
uncommented_content = uncommented_lines.join
|
|
1364
|
+
# If no async found in uncommented content, all async usage was commented
|
|
1365
|
+
!file_has_async_pack_tag?(uncommented_content)
|
|
1366
|
+
end
|
|
1367
|
+
|
|
1368
|
+
def config_has_async_loading_strategy?
|
|
1369
|
+
config_path = "config/initializers/react_on_rails.rb"
|
|
1370
|
+
return false unless File.exist?(config_path)
|
|
1371
|
+
|
|
1372
|
+
content = File.read(config_path)
|
|
1373
|
+
# Check if generated_component_packs_loading_strategy is set to :async
|
|
1374
|
+
# Filter out commented lines (lines starting with # after optional whitespace)
|
|
1375
|
+
content.each_line.any? do |line|
|
|
1376
|
+
# Skip lines that start with # (after optional whitespace)
|
|
1377
|
+
next if line.match?(/^\s*#/)
|
|
1378
|
+
|
|
1379
|
+
# Match: config.generated_component_packs_loading_strategy = :async
|
|
1380
|
+
# Use word boundary \b to ensure :async is the complete symbol, not part of :async_mode etc.
|
|
1381
|
+
line.match?(/config\.generated_component_packs_loading_strategy\s*=\s*:async\b/)
|
|
1382
|
+
end
|
|
1383
|
+
rescue Errno::ENOENT, Encoding::InvalidByteSequenceError, Encoding::UndefinedConversionError => e
|
|
1384
|
+
# Log the error if Rails logger is available
|
|
1385
|
+
log_debug("Error checking async loading strategy: #{e.message}")
|
|
1386
|
+
false
|
|
1387
|
+
end
|
|
1388
|
+
|
|
1389
|
+
def log_debug(message)
|
|
1390
|
+
return unless defined?(Rails.logger) && Rails.logger
|
|
1391
|
+
|
|
1392
|
+
Rails.logger.debug(message)
|
|
1393
|
+
end
|
|
1149
1394
|
end
|
|
1150
1395
|
# rubocop:enable Metrics/ClassLength
|
|
1151
1396
|
end
|
|
@@ -587,6 +587,15 @@ module ReactOnRails
|
|
|
587
587
|
# It doesn't make any transformation, it listens and raises error if a chunk has errors
|
|
588
588
|
chunk_json_result
|
|
589
589
|
end
|
|
590
|
+
|
|
591
|
+
result.rescue do |err|
|
|
592
|
+
# This error came from the renderer
|
|
593
|
+
raise ReactOnRails::PrerenderError.new(component_name: react_component_name,
|
|
594
|
+
# Sanitize as this might be browser logged
|
|
595
|
+
props: sanitized_props_string(props),
|
|
596
|
+
err: err,
|
|
597
|
+
js_code: js_code)
|
|
598
|
+
end
|
|
590
599
|
elsif result["hasErrors"] && render_options.raise_on_prerender_error
|
|
591
600
|
raise_prerender_error(result, react_component_name, props, js_code)
|
|
592
601
|
end
|
|
@@ -19,6 +19,12 @@ You can find the **package** version numbers from this repo's tags and below in
|
|
|
19
19
|
|
|
20
20
|
_Add changes in master not yet tagged._
|
|
21
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
|
+
|
|
22
28
|
### Added
|
|
23
29
|
|
|
24
30
|
- Added `cached_stream_react_component` helper method, similar to `cached_react_component` but for streamed components.
|
|
@@ -48,6 +54,7 @@ _Add changes in master not yet tagged._
|
|
|
48
54
|
|
|
49
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)`.
|
|
50
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.
|
|
51
58
|
|
|
52
59
|
## [4.0.0-rc.15] - 2025-08-11
|
|
53
60
|
|
|
@@ -347,24 +347,13 @@ Contact Justin Gordon, [justin@shakacode.com](mailto:justin@shakacode.com) for r
|
|
|
347
347
|
|
|
348
348
|
## Prerequisites
|
|
349
349
|
|
|
350
|
-
You need authentication for
|
|
350
|
+
You need authentication for public package registries:
|
|
351
351
|
|
|
352
352
|
**Public packages (npmjs.org + rubygems.org):**
|
|
353
353
|
- NPM: Run `npm login`
|
|
354
354
|
- RubyGems: Standard credentials via `gem push`
|
|
355
355
|
|
|
356
|
-
|
|
357
|
-
- Get a GitHub personal access token with `write:packages` scope
|
|
358
|
-
- Configure `~/.npmrc`:
|
|
359
|
-
```ini
|
|
360
|
-
//npm.pkg.github.com/:_authToken=<TOKEN>
|
|
361
|
-
always-auth=true
|
|
362
|
-
```
|
|
363
|
-
- Configure `~/.gem/credentials`:
|
|
364
|
-
```yaml
|
|
365
|
-
:github: Bearer <GITHUB_TOKEN>
|
|
366
|
-
```
|
|
367
|
-
- Set environment variable: `export GITHUB_TOKEN=<TOKEN>`
|
|
356
|
+
All React on Rails and React on Rails Pro packages are now published publicly to npmjs.org and RubyGems.org.
|
|
368
357
|
|
|
369
358
|
## Release Command
|
|
370
359
|
|
|
@@ -9,7 +9,7 @@ GIT
|
|
|
9
9
|
PATH
|
|
10
10
|
remote: ..
|
|
11
11
|
specs:
|
|
12
|
-
react_on_rails (16.2.0.beta.
|
|
12
|
+
react_on_rails (16.2.0.beta.8)
|
|
13
13
|
addressable
|
|
14
14
|
connection_pool
|
|
15
15
|
execjs (~> 2.5)
|
|
@@ -20,14 +20,15 @@ PATH
|
|
|
20
20
|
PATH
|
|
21
21
|
remote: .
|
|
22
22
|
specs:
|
|
23
|
-
react_on_rails_pro (16.2.0.beta.
|
|
23
|
+
react_on_rails_pro (16.2.0.beta.8)
|
|
24
24
|
addressable
|
|
25
|
+
async (>= 2.6)
|
|
25
26
|
connection_pool
|
|
26
27
|
execjs (~> 2.9)
|
|
27
28
|
httpx (~> 1.5)
|
|
28
29
|
jwt (~> 2.7)
|
|
29
30
|
rainbow
|
|
30
|
-
react_on_rails (= 16.2.0.beta.
|
|
31
|
+
react_on_rails (= 16.2.0.beta.8)
|
|
31
32
|
|
|
32
33
|
GEM
|
|
33
34
|
remote: https://rubygems.org/
|
|
@@ -107,6 +108,12 @@ GEM
|
|
|
107
108
|
public_suffix (>= 2.0.2, < 7.0)
|
|
108
109
|
amazing_print (1.6.0)
|
|
109
110
|
ast (2.4.2)
|
|
111
|
+
async (2.27.4)
|
|
112
|
+
console (~> 1.29)
|
|
113
|
+
fiber-annotation
|
|
114
|
+
io-event (~> 1.11)
|
|
115
|
+
metrics (~> 0.12)
|
|
116
|
+
traces (~> 0.15)
|
|
110
117
|
base64 (0.2.0)
|
|
111
118
|
benchmark (0.4.0)
|
|
112
119
|
bigdecimal (3.1.9)
|
|
@@ -134,6 +141,10 @@ GEM
|
|
|
134
141
|
commonmarker (1.1.4-x86_64-linux)
|
|
135
142
|
concurrent-ruby (1.3.5)
|
|
136
143
|
connection_pool (2.5.0)
|
|
144
|
+
console (1.33.0)
|
|
145
|
+
fiber-annotation
|
|
146
|
+
fiber-local (~> 1.1)
|
|
147
|
+
json
|
|
137
148
|
coveralls (0.8.23)
|
|
138
149
|
json (>= 1.8, < 3)
|
|
139
150
|
simplecov (~> 0.16.1)
|
|
@@ -158,6 +169,10 @@ GEM
|
|
|
158
169
|
ffi (1.17.0-arm64-darwin)
|
|
159
170
|
ffi (1.17.0-x86_64-darwin)
|
|
160
171
|
ffi (1.17.0-x86_64-linux-gnu)
|
|
172
|
+
fiber-annotation (0.2.0)
|
|
173
|
+
fiber-local (1.1.0)
|
|
174
|
+
fiber-storage
|
|
175
|
+
fiber-storage (1.0.1)
|
|
161
176
|
gem-release (2.2.2)
|
|
162
177
|
generator_spec (0.10.0)
|
|
163
178
|
activesupport (>= 3.0.0)
|
|
@@ -173,6 +188,7 @@ GEM
|
|
|
173
188
|
i18n (1.14.7)
|
|
174
189
|
concurrent-ruby (~> 1.0)
|
|
175
190
|
io-console (0.8.0)
|
|
191
|
+
io-event (1.12.1)
|
|
176
192
|
irb (1.15.1)
|
|
177
193
|
pp (>= 0.6.0)
|
|
178
194
|
rdoc (>= 4.0.0)
|
|
@@ -205,6 +221,7 @@ GEM
|
|
|
205
221
|
marcel (1.0.4)
|
|
206
222
|
matrix (0.4.2)
|
|
207
223
|
method_source (1.1.0)
|
|
224
|
+
metrics (0.14.0)
|
|
208
225
|
mini_mime (1.1.5)
|
|
209
226
|
minitest (5.25.4)
|
|
210
227
|
mize (0.4.1)
|
|
@@ -411,6 +428,7 @@ GEM
|
|
|
411
428
|
tins (1.33.0)
|
|
412
429
|
bigdecimal
|
|
413
430
|
sync
|
|
431
|
+
traces (0.18.1)
|
|
414
432
|
turbolinks (5.2.1)
|
|
415
433
|
turbolinks-source (~> 5.2)
|
|
416
434
|
turbolinks-source (5.2.0)
|
|
@@ -245,7 +245,7 @@ In your `node-renderer.js` file which runs node renderer, you need to specify `s
|
|
|
245
245
|
```js
|
|
246
246
|
const path = require('path');
|
|
247
247
|
const env = process.env;
|
|
248
|
-
const { reactOnRailsProNodeRenderer } = require('
|
|
248
|
+
const { reactOnRailsProNodeRenderer } = require('react-on-rails-pro-node-renderer');
|
|
249
249
|
|
|
250
250
|
const config = {
|
|
251
251
|
...
|
|
@@ -35,6 +35,6 @@ rake release[17.0.0,false,verdaccio]
|
|
|
35
35
|
This unified script releases all 5 packages together:
|
|
36
36
|
- react-on-rails (NPM)
|
|
37
37
|
- react-on-rails-pro (NPM)
|
|
38
|
+
- react-on-rails-pro-node-renderer (NPM)
|
|
38
39
|
- react_on_rails (RubyGem)
|
|
39
|
-
-
|
|
40
|
-
- react_on_rails_pro (RubyGem, GitHub Packages)
|
|
40
|
+
- react_on_rails_pro (RubyGem)
|