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

Remove webpacker #2424

Merged
merged 7 commits into from
Feb 1, 2023
Merged

Remove webpacker #2424

merged 7 commits into from
Feb 1, 2023

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Jan 31, 2023

What is this pull request for?

Remove Webpacker and detect either importmaps or jsbundling-rails during install

Closes #2388

Checklist

@tvdeyen tvdeyen added this to the 7.0 milestone Jan 31, 2023
Webpacker is not supported anymore by the Rails team and we have
plenty of other options nowadays.

The installer supports either jsbundling-rails or importmaps-rails and
will auto detect which one to use.

The dummy app uses jsbundling rails with esbuild as bundler for fast
CI builds.
If someone uses the alchemy admin with sourcemaps we
need a built package.
We do not have a bundler locally so we need to use the
bundled package.
We want to be sure yarn founds the package
@tvdeyen tvdeyen marked this pull request as ready for review January 31, 2023 18:01
log "Installed new npm package."
desc "Update npm package."
if File.exist? Rails.root.join("config/importmap.rb")
`bin/importmap pin @alchemy_cms/admin@~#{Alchemy.version}`

Check warning

Code scanning / Brakeman

Possible command injection.

Possible command injection.
if File.exist? Rails.root.join("config/importmap.rb")
`bin/importmap pin @alchemy_cms/admin@~#{Alchemy.version}`
elsif File.exist? Rails.root.join("package.json")
`yarn add @alchemy_cms/admin@~#{Alchemy.version}`

Check warning

Code scanning / Brakeman

Possible command injection.

Possible command injection.
Supports removing webpacker and adding jsbundling-rails
This is not a command injection because we now the
content of `Alchemy.version`.

It is a harmless string.
@tvdeyen tvdeyen requested a review from mamhoff February 1, 2023 07:19
Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

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

Goodbye webpacker 👋

@tvdeyen tvdeyen merged commit 72e36a9 into AlchemyCMS:main Feb 1, 2023
@tvdeyen tvdeyen deleted the remove-webpacker branch February 1, 2023 12:33
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.

Rails 7: Switch from Webpacker to Importmaps
2 participants