Skip to content

Commit 50117e2

Browse files
justin808claude
andcommitted
Clarify method naming: rename generated_assets_full_path → public_assets_full_path
- Add new `public_assets_full_path` method to be explicit about public asset paths - Keep `generated_assets_full_path` as backwards-compatible deprecated alias - Update internal references to use clearer `public_assets_full_path` method - Addresses naming ambiguity concern about whether paths are public or private - Prepares for future evolution toward simplified public-only asset resolution This improvement clarifies the distinction between: - Public asset paths (client bundles, manifests) → public_assets_full_path - Private asset paths (server bundles with enforcement) → server_bundle_private_path 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent bb5c8fa commit 50117e2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/react_on_rails/utils.rb

Lines changed: 10 additions & 5 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(generated_assets_full_path, bundle_name)
106+
File.join(public_assets_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(generated_assets_full_path, bundle_name)
127+
fallback_locations << File.join(public_assets_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(generated_assets_full_path, file_name)
179+
File.join(public_assets_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(generated_assets_full_path, asset_name)
194+
@react_server_manifest_path = File.join(public_assets_full_path, asset_name)
195195
end
196196

197197
def self.running_on_windows?
@@ -233,14 +233,19 @@ 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.generated_assets_full_path
236+
def self.public_assets_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
245+
def self.generated_assets_full_path
246+
public_assets_full_path
247+
end
248+
244249
def self.gem_available?(name)
245250
Gem.loaded_specs[name].present?
246251
rescue Gem::LoadError

0 commit comments

Comments
 (0)