Skip to content

Commit 349e334

Browse files
justin808claude
andcommitted
Improve method naming: use public_bundles_full_path instead of public_assets_full_path
- Rename public_assets_full_path → public_bundles_full_path for specificity - "public_bundles" is clearer than "public_assets" in Rails context - Avoids confusion with general Rails public assets (images, stylesheets, etc.) - Method specifically handles webpack bundles, not general assets - Update all internal references to use the more specific naming - Maintain backwards compatibility through generated_assets_full_path alias This creates clear semantic distinction: - public_bundles_full_path → webpack bundles in public directories - server_bundle_private_path → server bundles in private directories 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 50117e2 commit 349e334

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/react_on_rails/utils.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def self.bundle_js_file_path(bundle_name)
103103
# Default to the non-hashed name in the specified output directory, which, for legacy
104104
# React on Rails, this is the output directory picked up by the asset pipeline.
105105
# For Shakapacker, this is the public output path defined in the (shaka/web)packer.yml file.
106-
File.join(public_assets_full_path, bundle_name)
106+
File.join(public_bundles_full_path, bundle_name)
107107
end
108108
end
109109

@@ -124,7 +124,7 @@ def self.bundle_js_file_path(bundle_name)
124124
fallback_locations << File.join("public", "packs", bundle_name)
125125

126126
# 3. Generated assets path (for legacy setups)
127-
fallback_locations << File.join(public_assets_full_path, bundle_name)
127+
fallback_locations << File.join(public_bundles_full_path, bundle_name)
128128

129129
fallback_locations.uniq!
130130

@@ -176,7 +176,7 @@ def self.react_client_manifest_file_path
176176
@react_client_manifest_path = if ReactOnRails::PackerUtils.using_packer?
177177
ReactOnRails::PackerUtils.asset_uri_from_packer(file_name)
178178
else
179-
File.join(public_assets_full_path, file_name)
179+
File.join(public_bundles_full_path, file_name)
180180
end
181181
end
182182

@@ -191,7 +191,7 @@ def self.react_server_client_manifest_file_path
191191
"react_server_client_manifest_file is nil, ensure it is set in your configuration"
192192
end
193193

194-
@react_server_manifest_path = File.join(public_assets_full_path, asset_name)
194+
@react_server_manifest_path = File.join(public_bundles_full_path, asset_name)
195195
end
196196

197197
def self.running_on_windows?
@@ -233,17 +233,17 @@ def self.using_packer_source_path_is_not_defined_and_custom_node_modules?
233233
ReactOnRails.configuration.node_modules_location.present?
234234
end
235235

236-
def self.public_assets_full_path
236+
def self.public_bundles_full_path
237237
if ReactOnRails::PackerUtils.using_packer?
238238
ReactOnRails::PackerUtils.packer_public_output_path
239239
else
240240
File.expand_path(ReactOnRails.configuration.generated_assets_dir)
241241
end
242242
end
243243

244-
# DEPRECATED: Use public_assets_full_path for clarity about public vs private asset paths
244+
# DEPRECATED: Use public_bundles_full_path for clarity about public vs private bundle paths
245245
def self.generated_assets_full_path
246-
public_assets_full_path
246+
public_bundles_full_path
247247
end
248248

249249
def self.gem_available?(name)

0 commit comments

Comments
 (0)