-
-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Helper to Check for Bundle with correct Extension #1511
Conversation
ea1769b
to
f57a4e3
Compare
f57a4e3
to
51a86c3
Compare
51a86c3
to
5fb4f35
Compare
lib/react_on_rails/helper.rb
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this customizable? Why not always .js
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not configurable! It's always js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then why not a constant?
CHANGELOG.md
Outdated
@@ -17,6 +17,7 @@ Changes since last non-beta release. | |||
|
|||
*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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does the manifest have to do with the changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it to:
Fixed pack not found warning while using `react_component` and `react_component_hash` helpers, even when corresponding chunks are present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no tests?
lib/react_on_rails/helper.rb
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then why not a constant?
Added Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -109,8 +108,10 @@ def load_pack_for_component(component_name) | |||
append_stylesheet_pack_tag "generated/#{component_name}" | |||
end | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be part of the helper? or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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