Make webpacker build available in production#7915
Conversation
|
👍🏾 to merge this before #7733 and I'll adapt that PR, now I'm in the middle of what we discussed in the comments and I'm a bit stuck. BTW I've no issues in changing to npm, but there are some parts of Rails that won't be as smooth (i.e the script |
|
@beagleknight thanks for your work! We already discussed this offline, I think the current approach is fine. Apparently, GitHub Actions are all updated, right? Thanks @ferblape for reviewing this, too! |
|
@beagleknight @mrcasals what version of npm are you using? Mine is |
|
I'm using 6.14.11 @ferblape but we should update if there's a newer version. Could you take care of this? 🙏 |
|
Can I do it in my branch or in develop?
El El vie, 30 abr 2021 a las 8:30, Marc Riera ***@***.***>
escribió:
I'm using 6.14.11 @ferblape <https://github.com/ferblape> but we should
update if there's a newer version. Could you take care of this? 🙏
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7915 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEJUAV4UDDXM56GBP46S3TLJE6XANCNFSM43ZTN4BQ>
.
--
Fernando Blat
***@***.***
+34 660825001
Populate / Tools for civic engagement
https://populate.tools
Project stories
twitter.com/populate_ & populate.tools/blog
|
I was using Node 14.x and npm 6.x. I updated our staging application with those https://github.com/codegram/decidim-staging/blob/main/package.json#L21. +1 to upgrade to Node 15.x and npm 7.x (it is much faster 😄 ). @ferblape Can you update the |
@ferblape as you prefer, whatever works better for you! |
|
Ok thanks, I'll do it in my branch because I have to solve a few conflicts there.
|
|
Awesome, thank you @ferblape! ❤️ |
* develop: Remove creation date from meeting card (#7922) Use NPM instead of yarn on CI (#7919) Validate nickname using correct regexp (#7900) Make webpacker build available in production (#7915) New Crowdin updates (#7911) Open attachments in new tab (#7912) Fix JS errors in the admin panel (#7903) Fix editor: remove br tags from inside a tags (#7901) Authorizable comment action for proposals (#6916) NoMethodError raised when voting comments from threads (#7880) Fix not signed in needs permission redirect for internal links (#7890) Fix meeting registrations questionnaire free text choice answers export (#7892) Store election verifiable results data in election (#7882) New Crowdin updates (#7884)
🎩 What? Why?
To make the webpacker build available in production environments we should add a rake task that compiles the assets when we run
bundle exec rake assets:precompile.In this PR I also included some changes related to the deployment test I did:
yarnwithnpmagain 😅 (see Update js dependencies using npm #1628). I was having problems in my Heroku environment and I decided to go back tonpm. This is something that we can discuss with @decidim/mantainers, but I would like to give my opinion: even ifyarnis the package manager that come with Rails by default I strongly advise to use the official one:npm.package-lock.json(oryarn.lock) should be included in the gem."6.0.0.beta.7"and there are two good reasons for this: we should always use released versions and for some reason if you try to use"~> 6.0.0.beta.7"it always install apre.2version. It could be related to some strange order in https://rubygems.org/gems/webpackerdependenciesblock. The reason for that is when you are in a production environment usually theNODE_ENVvariable is set toproduction. That means that if you runnpm installyou don't install thedevDependenciesmaking the build impossible. Since it is not a Node.js application it doesn't make any sense having dependencies and devDependencies. A possible workaround is specifying theNODE_ENVtodevelopmentwhen building the assets, but I don't feel ok about that.And that's it! @decidim/mantainers feel free to discuss anything related to this 😄 . After merging this PR we will be able to create review apps again and I strongly advise to have it working as soon as possible.
📌 Related Issues
Link your PR to an issue
Testing
Describe the best way to test or validate your PR.
📋 Checklist
🚨 Please review the guidelines for contributing to this repository.
docs/.📷 Screenshots
Please add screenshots of the changes you're proposing
