react-manifest-rails 0.2.19 → 0.2.20

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d392f2b6bf13451773d9e12b51a3b1cf1048c407058cb60cbdb2db48cfa79acc
4
- data.tar.gz: ff2acfbd5ddc4b0b1e048fea664211ed62d04890fcdbcb555324f4ce3bbfa0bd
3
+ metadata.gz: 573c8f1d4441a029cdc192ceef3e3e140702e55a17fc367e195243752f3970d6
4
+ data.tar.gz: d02437b64aeee8fb45879b9b5d1f740e4eea85b42023ac8fadb84c3c6c491e97
5
5
  SHA512:
6
- metadata.gz: 2df51348498e3778af7048c4a7d3090d1223ab0683e4bac4a0443dff6ad2b4ec47eca9bb50a492b35a012cb5ce126521839540a58171cddd67651c0da50e56e8
7
- data.tar.gz: b7f9300e03f28a274b33f62c3500add16249aa0e4d52607d6c359527ca36c3f53ba00d69d840021c954ec87bcf7b6aa36682122349ada050f0f74e7d11a481a0
6
+ metadata.gz: f4aaf9bc43e9cc067c47790eb98061a0af8ad58efaa61c7c9a663749ca1d3e5cb464881987ca9ee31e015c820578780857cf5b15c9fae2a5d2b7bd0e0ce3038c
7
+ data.tar.gz: 34273febe66a2821de77756baad5be6e3193234746db4f0ded7ba80d180ba1ce3d0d7a7c01e67456060ae743d5cab2723914ec5e163f1eaefb885f3504177569
data/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ### Fixed
11
+ - `react_component` now emits only `ux_shared` plus the direct owning bundle for the requested component symbol, instead of also emitting transitive controller manifests as separate script tags. This prevents unnecessary network requests for additional `ux_*.js` manifests while preserving dependency loading through generated manifest `require` directives.
12
+
8
13
  ## [0.2.10] - 2026-04-16
9
14
 
10
15
  ### Fixed
@@ -1,3 +1,3 @@
1
1
  module ReactManifest
2
- VERSION = "0.2.19".freeze
2
+ VERSION = "0.2.20".freeze
3
3
  end
@@ -37,7 +37,7 @@ module ReactManifest
37
37
  html = super
38
38
 
39
39
  component_name = args.first
40
- bundles = ReactManifest.resolve_bundles_for_component(component_name)
40
+ bundles = ReactManifest.resolve_bundles_for_component_direct(component_name)
41
41
  return html if bundles.empty?
42
42
 
43
43
  emitted = (@_react_manifest_emitted_bundles ||= [])
@@ -15,6 +15,7 @@ require "react_manifest/watcher"
15
15
  require "react_manifest/reporter"
16
16
  require "react_manifest/view_helpers"
17
17
 
18
+ # rubocop:disable Metrics/ModuleLength
18
19
  module ReactManifest
19
20
  class << self
20
21
  def configuration
@@ -65,7 +66,32 @@ module ReactManifest
65
66
  # where the requested component name is known and may not align 1:1 with
66
67
  # controller_path-derived bundle names.
67
68
  def resolve_bundle_for_component(component_name)
68
- resolve_bundles_for_component(component_name).last
69
+ resolve_bundles_for_component_direct(component_name).last
70
+ end
71
+
72
+ # Resolve the direct bundle list needed for a React component symbol.
73
+ # Returns shared first (if present), then the component's owning bundle.
74
+ #
75
+ # Unlike resolve_bundles_for_component, this does not include transitive
76
+ # controller dependencies because generated controller manifests already
77
+ # inline those files via Sprockets require directives.
78
+ def resolve_bundles_for_component_direct(component_name)
79
+ name = component_name.to_s
80
+ return [] if name.empty?
81
+
82
+ config = configuration
83
+ maps = component_maps(config)
84
+ root_bundle = maps[:symbol_to_bundle][name]
85
+ return [] unless root_bundle
86
+
87
+ bundles = []
88
+ shared = resolve_bundle_reference(config, config.shared_bundle)
89
+ bundles << shared if shared
90
+
91
+ root = resolve_bundle_reference(config, root_bundle)
92
+ bundles << root if root && !bundles.include?(root)
93
+
94
+ bundles
69
95
  end
70
96
 
71
97
  # Resolve all controller bundles needed for a React component symbol.
@@ -220,3 +246,4 @@ module ReactManifest
220
246
  end
221
247
  end
222
248
  end
249
+ # rubocop:enable Metrics/ModuleLength
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react-manifest-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.19
4
+ version: 0.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Noonan