react_on_rails 14.0.4 → 14.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 990382215a33db46c9f5b8bdf0e5db38fba4e6233da6ff1a5f3840428ac9e092
4
- data.tar.gz: 21e052cfea0a8121d8c6ebd4fd3f4688ced23ef7b0b40df653889f6388f95834
3
+ metadata.gz: ca8ba0235b9256e1b24f5afc2c874f258cf239d78ad6490e86ce4d918b26ecf4
4
+ data.tar.gz: 54796b7b8067b98180bf0e41eb20c4d6bb0a4ea54594af8365eb95c74158d1b7
5
5
  SHA512:
6
- metadata.gz: 4c37af672c59bf60b452af1684a25fdc75caf8a48a115a84179816a16a9933120628b4e516dd593f60550d6ecd3df8a4ee8e5ba4a670c2bd5cc9d43dfeea870b
7
- data.tar.gz: ddda7ad407c195b32d15fcbad434e34b9fa0e5003666ddded2953c369a0081f1f14a9fd3b03bf8ba5678b97ac09402a1fdfe123815a0c4a895caabeb518c548b
6
+ metadata.gz: c081c9e1b626d9c986f212c2c351fd1774fddaa9be301ae05d6c890b41c30f21871acb56002001b2bf64584da3932457ffc9da522463f3d49f7b73dd62852032
7
+ data.tar.gz: 005f0dc9f274c6ba9edc8784efb679e6ba5bc7610b708c7c072f4301f4fe25d3a4bf887ad2e9449284f2bbce346dfec54f0e7bd54192ab8d3532c7d5b3004267
data/CHANGELOG.md CHANGED
@@ -18,6 +18,7 @@ Please follow the recommendations outlined at [keepachangelog.com](http://keepac
18
18
  ### [Unreleased]
19
19
  Changes since the last non-beta release.
20
20
 
21
+ ### [14.0.4] - 2024-07-02
21
22
 
22
23
  #### Improved
23
24
  - Improved dependency management by integrating package_json. [PR 1639](https://github.com/shakacode/react_on_rails/pull/1639) by [vaukalak](https://github.com/vaukalak).
@@ -25,7 +26,6 @@ Changes since the last non-beta release.
25
26
  #### Changed
26
27
  - Update outdated GitHub Actions to use Node.js 20.0 versions instead [PR 1623](https://github.com/shakacode/react_on_rails/pull/1623) by [adriangohjw](https://github.com/adriangohjw).
27
28
 
28
-
29
29
  ### [14.0.3] - 2024-06-28
30
30
 
31
31
  #### Fixed
@@ -1148,7 +1148,8 @@ Best done with Object destructing:
1148
1148
  ##### Fixed
1149
1149
  - Fix several generator-related issues.
1150
1150
 
1151
- [Unreleased]: https://github.com/shakacode/react_on_rails/compare/14.0.3...master
1151
+ [Unreleased]: https://github.com/shakacode/react_on_rails/compare/14.0.4...master
1152
+ [14.0.4]: https://github.com/shakacode/react_on_rails/compare/14.0.3...14.0.4
1152
1153
  [14.0.3]: https://github.com/shakacode/react_on_rails/compare/14.0.2...14.0.3
1153
1154
  [14.0.2]: https://github.com/shakacode/react_on_rails/compare/14.0.1...14.0.2
1154
1155
  [14.0.1]: https://github.com/shakacode/react_on_rails/compare/14.0.0...14.0.1
@@ -22,6 +22,8 @@ gem "sprockets", "~> 4.0"
22
22
 
23
23
  gem "amazing_print"
24
24
 
25
+ gem "turbo-rails"
26
+
25
27
  group :development, :test do
26
28
  gem "package_json"
27
29
  gem "listen"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- react_on_rails (14.0.3)
4
+ react_on_rails (14.0.4)
5
5
  addressable
6
6
  connection_pool
7
7
  execjs (~> 2.5)
@@ -369,6 +369,10 @@ GEM
369
369
  tins (1.33.0)
370
370
  bigdecimal
371
371
  sync
372
+ turbo-rails (2.0.6)
373
+ actionpack (>= 6.0.0)
374
+ activejob (>= 6.0.0)
375
+ railties (>= 6.0.0)
372
376
  turbolinks (5.2.1)
373
377
  turbolinks-source (~> 5.2)
374
378
  turbolinks-source (5.2.0)
@@ -431,6 +435,7 @@ DEPENDENCIES
431
435
  spring (~> 4.0)
432
436
  sprockets (~> 4.0)
433
437
  sqlite3 (~> 1.6)
438
+ turbo-rails
434
439
  turbolinks
435
440
  uglifier
436
441
  webdrivers (= 5.3.0)
@@ -39,7 +39,9 @@ module ReactOnRails
39
39
  i18n_output_format: nil,
40
40
  components_subdirectory: nil,
41
41
  make_generated_server_bundle_the_entrypoint: false,
42
- defer_generated_component_packs: true
42
+ defer_generated_component_packs: true,
43
+ # forces the loading of React components
44
+ force_load: false
43
45
  )
44
46
  end
45
47
 
@@ -53,7 +55,8 @@ module ReactOnRails
53
55
  :server_render_method, :random_dom_id, :auto_load_bundle,
54
56
  :same_bundle_for_client_and_server, :rendering_props_extension,
55
57
  :make_generated_server_bundle_the_entrypoint,
56
- :defer_generated_component_packs
58
+ :defer_generated_component_packs,
59
+ :force_load
57
60
 
58
61
  # rubocop:disable Metrics/AbcSize
59
62
  def initialize(node_modules_location: nil, server_bundle_js_file: nil, prerender: nil,
@@ -68,7 +71,7 @@ module ReactOnRails
68
71
  same_bundle_for_client_and_server: nil,
69
72
  i18n_dir: nil, i18n_yml_dir: nil, i18n_output_format: nil,
70
73
  random_dom_id: nil, server_render_method: nil, rendering_props_extension: nil,
71
- components_subdirectory: nil, auto_load_bundle: nil)
74
+ components_subdirectory: nil, auto_load_bundle: nil, force_load: nil)
72
75
  self.node_modules_location = node_modules_location.present? ? node_modules_location : Rails.root
73
76
  self.generated_assets_dirs = generated_assets_dirs
74
77
  self.generated_assets_dir = generated_assets_dir
@@ -106,6 +109,7 @@ module ReactOnRails
106
109
  self.auto_load_bundle = auto_load_bundle
107
110
  self.make_generated_server_bundle_the_entrypoint = make_generated_server_bundle_the_entrypoint
108
111
  self.defer_generated_component_packs = defer_generated_component_packs
112
+ self.force_load = force_load
109
113
  end
110
114
  # rubocop:enable Metrics/AbcSize
111
115
 
@@ -441,6 +441,14 @@ module ReactOnRails
441
441
  "data-trace" => (render_options.trace ? true : nil),
442
442
  "data-dom-id" => render_options.dom_id)
443
443
 
444
+ if render_options.force_load
445
+ component_specification_tag.concat(
446
+ content_tag(:script, %(
447
+ ReactOnRails.reactOnRailsComponentLoaded('#{render_options.dom_id}');
448
+ ).html_safe)
449
+ )
450
+ end
451
+
444
452
  load_pack_for_generated_component(react_component_name, render_options)
445
453
  # Create the HTML rendering part
446
454
  result = server_rendered_react_component(render_options)
@@ -91,6 +91,10 @@ module ReactOnRails
91
91
  retrieve_configuration_value_for(:logging_on_server)
92
92
  end
93
93
 
94
+ def force_load
95
+ retrieve_configuration_value_for(:force_load)
96
+ end
97
+
94
98
  def to_s
95
99
  "{ react_component_name = #{react_component_name}, options = #{options}, request_digest = #{request_digest}"
96
100
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReactOnRails
4
- VERSION = "14.0.4"
4
+ VERSION = "14.0.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.0.4
4
+ version: 14.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-03 00:00:00.000000000 Z
11
+ date: 2024-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable