Skip to content
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

react_on_rails:generate_packs should add the import statement to the entry point even if the packs already exist #1609

Closed
alexeyr-ci opened this issue Apr 11, 2024 · 0 comments · Fixed by #1610
Assignees

Comments

@alexeyr-ci
Copy link

alexeyr-ci commented Apr 11, 2024

A bug is a crash or incorrect behavior. If you have a debugging or troubleshooting question, please open a discussion.

Environment

  1. Ruby version: 3.3.0
  2. Rails version: 7.1.3.2
  3. Shakapacker/Webpacker version: 6.5.6
  4. React on Rails version: 13.4.0

Expected behavior

  1. Running bin/rake react_on_rails:generate_packs should always add the import like
// import statement added by react_on_rails:generate_packs rake task
import "./../generated/server-bundle-generated.js"

to the server_bundle_js_file if it's missing there.
2. On the other hand, if the import is present already, it shouldn't be added.
3. The comment could include suggestion to rerun the task if the generated file is missing.

Actual behavior

When the generated files already exist, the import isn't added.

Small, reproducible repo

  1. Run bin/rake react_on_rails:generate_packs in the dummy app. The import line is added.
  2. Run git reset --hard HEAD
  3. Run bin/rake react_on_rails:generate_packs again. The import line is not added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants