Update Helper to Check for Bundle with correct Extension#1511
Update Helper to Check for Bundle with correct Extension#1511
Conversation
ea1769b to
f57a4e3
Compare
f57a4e3 to
51a86c3
Compare
51a86c3 to
5fb4f35
Compare
| def generated_components_pack(component_name) | ||
| "#{ReactOnRails::WebpackerUtils.webpacker_source_entry_path}/generated/#{component_name}" | ||
| def generated_components_pack_path(component_name) | ||
| extension = PacksGenerator.generated_pack_extension |
There was a problem hiding this comment.
Why is this customizable? Why not always .js?
There was a problem hiding this comment.
It's not configurable! It's always js
|
|
||
| *Please add entries here for your pull requests that are not yet released.* | ||
| - Added `./bin/dev` and `./bin/dev-static` executables to ease and standardize running the dev server. [PR 1491](https://github.com/shakacode/react_on_rails/pull/1491) by [ahangarha](https://github.com/ahangarha) | ||
| - Fixed pack not found warning while using `react_component` and `react_component_hash` helpers, even when corresponding chunks are present in `manifest` file [PR 1511](https://github.com/shakacode/react_on_rails/pull/1511) by [pulkitkkr](https://github.com/pulkitkkr) |
There was a problem hiding this comment.
what does the manifest have to do with the changes?
There was a problem hiding this comment.
Updated it to:
Fixed pack not found warning while using `react_component` and `react_component_hash` helpers, even when corresponding chunks are present.
| def generated_components_pack(component_name) | ||
| "#{ReactOnRails::WebpackerUtils.webpacker_source_entry_path}/generated/#{component_name}" | ||
| def generated_components_pack_path(component_name) | ||
| extension = PacksGenerator.generated_pack_extension |
|
Added Tests |
pulkitkkr
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @Judahmeek and @justin808)
lib/react_on_rails/helper.rb line 112 at r1 (raw file):
Previously, justin808 (Justin Gordon) wrote…
Then why not a constant?
Done.
|
|
||
| def generated_components_pack(component_name) | ||
| "#{ReactOnRails::WebpackerUtils.webpacker_source_entry_path}/generated/#{component_name}" | ||
| def generated_components_pack_path(component_name) |
There was a problem hiding this comment.
Should this be part of the helper? or not?
There was a problem hiding this comment.
It should be a private member
| @@ -94,8 +94,7 @@ def react_component(component_name, options = {}) | |||
| end | |||
|
|
|||
| def load_pack_for_component(component_name) | |||
There was a problem hiding this comment.
why is this part of the public helper?
there's no doc for this method load_pack_for_component
or generated_components_pack_path
There was a problem hiding this comment.
It should be private member as it is used internally by react_component and react_component_hash
Summary
This PR fixes the bug as described in the Issue: #1510
This change is