Skip to content

Commit f862aa7

Browse files
justin808claude
authored 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 <[email protected]>
1 parent e7db6de commit f862aa7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/react_on_rails/utils.rb

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

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

127127
# 3. Generated assets path (for legacy setups)
128-
fallback_locations << File.join(public_assets_full_path, bundle_name)
128+
fallback_locations << File.join(public_bundles_full_path, bundle_name)
129129

130130
fallback_locations.uniq!
131131

@@ -188,7 +188,7 @@ def self.react_server_client_manifest_file_path
188188
"react_server_client_manifest_file is nil, ensure it is set in your configuration"
189189
end
190190

191-
@react_server_manifest_path = File.join(public_assets_full_path, asset_name)
191+
@react_server_manifest_path = File.join(public_bundles_full_path, asset_name)
192192
end
193193

194194
def self.running_on_windows?
@@ -224,13 +224,13 @@ def self.using_packer_source_path_is_not_defined_and_custom_node_modules?
224224
ReactOnRails.configuration.node_modules_location.present?
225225
end
226226

227-
def self.public_assets_full_path
227+
def self.public_bundles_full_path
228228
ReactOnRails::PackerUtils.packer_public_output_path
229229
end
230230

231-
# DEPRECATED: Use public_assets_full_path for clarity about public vs private asset paths
231+
# DEPRECATED: Use public_bundles_full_path for clarity about public vs private bundle paths
232232
def self.generated_assets_full_path
233-
public_assets_full_path
233+
public_bundles_full_path
234234
end
235235

236236
def self.gem_available?(name)

0 commit comments

Comments
 (0)