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
Version advice for starting with webpacker #2879
Comments
My advice would depend on your familiarity with webpack. If you're comfortable, start with Webpacker v6. If this is your first time using webpack, stick with the latest stable Webpacker v5. Docs should help with the upgrade. I've been using yarn v1 for awhile now without any issues. I can't speak to how well yarn v2 works with Webpacker yet. |
Thanks @rossta that sounds like a great advice ^^ There are some more upcoming changes to Webpacker 6.0 to smoothen switch from sprockets and make defaults simpler like Sprockets. I will share more updates later in the week. |
Thank you for your comments so far.
Funny enough, my thought was the other way round: If I am familiar with webpack (v5) then start with what I know. But as I am mostly unfamiliar with webpack, why start learning something that will be outdated soon? But I will surely reconsider
Sounds great! I am looking forward to see your updates. Maybe this will already help me. Does anyone know if yarn 2 is supported by webpacker on Rails 5.2? |
Hey, @diesl ! 👋 A important note: The webpacker 6.x is not stable yet, but the 5.x is stable and ready for use in production environments 👍 I will try to answer your question about compatibility of yarn v2 in Rails and in webpacker, separately. Yarn 2 is supported by Rails itself only in 6.x version (6.0 and 6.1). For more details, you can check the discussion in PR related to it: rails/rails#40722 Yarn 2 is supported by Webpacker in 6.x version (#2799). Recently, few days ago, we also added support in 5.x version of webpacker (#2889). In next release of 5.x version (maybe v5.2.2 or v5.3.0), yarn 2 support will be available! 🎉 |
Thanks @pedrofurtado for your additional comments and links for further reading 👍 I did some further research and came to conclusion that we will update to Rails 6.x first, as the migration seems to work fine and without big problems in our dev environment. As yarn 2 will be available in both webpacker 5 (soon) and 6, we will likely go with yarn 2 then. Last but not least, when it comes to decide which webpacker version we will choose, I think we will likely pick the new 6.x branch. Since I started this ticket, already 2 new beta versions have been released, so I think a stable version is not half a year away and we are not in a big hurry.
@gauravtiwari Do you have any news here? |
@pedrofurtado Just a Question with Rails patches for yarn2 backported to 5.2 i guess yarn 2 can work with webpacker 5.x (already merged) ? |
We have a dockerized Rails 5.2 web app and we are planning to start using webpacker.
However, after having read quite a few tickets around here, I am not sure what is the best way to begin this journey. I see that the new versions of webpack and yarn have quite big (breaking) changes in code and philosophy. Because of that I wonder whether I should start with the brand new versions or stick to the "old" stable versions where I have to upgrade to new versions with possibly lots of work again at some point of time.
Let's make it more concrete:
Would it be clever to start using webpacker with
Or should I stick to the stable version:
Some more questions are:
Thanks for your advice!
The text was updated successfully, but these errors were encountered: