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

Change custom precompile to check ReactOnRails.configuration.build_production_command present? #1402

Conversation

justin808
Copy link
Member

@justin808 justin808 commented Nov 3, 2021

Update logic on what build command to use in assets:precompile to be based on whether or not
config.build_production_command is defined.

This change is Reviewable

@justin808
Copy link
Member Author

@gscarv13 pick this up.

@gscarv13 gscarv13 force-pushed the justin808-change-check-for-using-ReactOnRails-configuration-build_production_command branch from 5be2095 to 5eaf115 Compare November 4, 2021 15:27
Copy link
Member Author

@justin808 justin808 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r1, 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions


CHANGELOG.md, line 21 at r2 (raw file):

#### Changed
- Remove the documentation entries that asked to delete the `config/webpack/production.js` file if `config.build_production_command` is present [PR 1402](https://github.com/shakacode/react_on_rails/pull/1402)by [justin808](https://github.com/justin808) and [gscarv13](https://github.com/gscarv13).

Changed logic of determining the usage of the default rails/webpacker webpack config or a custom command to only check if the config.build_production_command is defined.

The point of the PR is to change the logic. We don't update the changelog with documentation commands.


docs/deployment/heroku-deployment.md, line 24 at r2 (raw file):

If you're a custom webpack configuration, and you **do not have the default
`config/webpack/production.js`** file, then the `config/initializers/react_on_rails.rb`
configuration `config.build_production_command` will be used.

Reword this for the change in logic.


docs/guides/configuration.md, line 70 at r2 (raw file):

if you don't want react_on_rails building this file for you.

if you don't want react_on_rails invoking this command


lib/tasks/assets.rake, line 12 at r2 (raw file):

skip_react_on_rails_precompile = %w[no false n f].include?(ENV["REACT_ON_RAILS_PRECOMPILE"])

if !skip_react_on_rails_precompile && ReactOnRails.configuration.build_production_command.present?

Test this logic for 4 cases:

  1. build_production_command script set, no /config/webpack/production.js exists ==> runs script
  2. build_production_command script set, and /config/webpack/production.js exists ==> runs script
  3. build_production_command script not set, and /config/webpack/production.js exists ==> runs this
  4. build_production_command script not set, and /config/webpack/production.js not existing ==> prints warning message? (check what it does)

@justin808 justin808 force-pushed the justin808-change-check-for-using-ReactOnRails-configuration-build_production_command branch from 593aeb2 to 78e5b99 Compare December 24, 2021 23:57
@justin808 justin808 force-pushed the justin808-change-check-for-using-ReactOnRails-configuration-build_production_command branch from f0a94ab to 1a2bcbf Compare December 26, 2021 07:16
@justin808 justin808 merged commit 07dd4dc into master Dec 26, 2021
@justin808 justin808 deleted the justin808-change-check-for-using-ReactOnRails-configuration-build_production_command branch December 26, 2021 07:49
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 this pull request may close these issues.

None yet

2 participants