react-manifest-rails 0.2.17 → 0.2.19

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: da69c627b8ff77a1d2aa520b4b034aea63c230045ed2dccfcb0175dd9bd71e60
4
- data.tar.gz: bbd527c3f9fe99c4e2aa972d0cb8b0ddefef6c9bd61d5022e27b5619d7a3a19b
3
+ metadata.gz: d392f2b6bf13451773d9e12b51a3b1cf1048c407058cb60cbdb2db48cfa79acc
4
+ data.tar.gz: ff2acfbd5ddc4b0b1e048fea664211ed62d04890fcdbcb555324f4ce3bbfa0bd
5
5
  SHA512:
6
- metadata.gz: b064cc48119471dea358e9c1f428297b518df2b6861ee5b4d0876601a7f724c4d3da97bddfc3a86555a8219d3cfb28b8269671473cb6c3c543f4a3db13741714
7
- data.tar.gz: 62c98dbf7a8d0b15fd9cdb8ffa05090bf0929a75bd0259e5b64d84630378cd80df8176f9f49340d607a98765572ce6c5d6ec8126702f3f1324fd259aa26fcec2
6
+ metadata.gz: 2df51348498e3778af7048c4a7d3090d1223ab0683e4bac4a0443dff6ad2b4ec47eca9bb50a492b35a012cb5ce126521839540a58171cddd67651c0da50e56e8
7
+ data.tar.gz: b7f9300e03f28a274b33f62c3500add16249aa0e4d52607d6c359527ca36c3f53ba00d69d840021c954ec87bcf7b6aa36682122349ada050f0f74e7d11a481a0
@@ -1,3 +1,3 @@
1
1
  module ReactManifest
2
- VERSION = "0.2.17".freeze
2
+ VERSION = "0.2.19".freeze
3
3
  end
@@ -21,6 +21,10 @@ module ReactManifest
21
21
  bundles = ReactManifest.resolve_bundles(ctrl)
22
22
  return "".html_safe if bundles.empty?
23
23
 
24
+ # Record emitted bundles so react_component doesn't re-emit them.
25
+ emitted = (@_react_manifest_emitted_bundles ||= [])
26
+ bundles.each { |b| emitted << b unless emitted.include?(b) }
27
+
24
28
  asset_names = bundles.map { |bundle| "#{bundle}.js" }
25
29
  javascript_include_tag(*asset_names, extname: false, **html_options)
26
30
  end
@@ -186,10 +186,16 @@ module ReactManifest
186
186
  end
187
187
 
188
188
  def resolve_bundle_reference(config, bundle_name)
189
+ subdir = config.normalized_manifest_subdir
189
190
  manifest_path = File.join(config.abs_manifest_dir, "#{bundle_name}.js")
190
- return bundle_name if File.exist?(manifest_path)
191
+ if File.exist?(manifest_path)
192
+ # Return the full Sprockets logical path so javascript_include_tag resolves
193
+ # correctly: files in ux_manifests/ have logical path ux_manifests/<name>.
194
+ return subdir.empty? ? bundle_name : "#{subdir}/#{bundle_name}"
195
+ end
191
196
 
192
- # Backward compatibility for apps still holding legacy manifests in output_dir root.
197
+ # Backward compatibility: apps that wrote manifests directly to output_dir root
198
+ # before manifest_subdir was introduced keep working with bare bundle names.
193
199
  legacy_path = File.join(config.abs_output_dir, "#{bundle_name}.js")
194
200
  return bundle_name if File.exist?(legacy_path)
195
201
 
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.17
4
+ version: 0.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Noonan