Planning upgrade from Rails 3 to 5. How to transition assets from pipeline to webpack gracefully ? Coffee & ES6
Hello,
We plan to upgrade a production app from Rails 3 to 5.2.
We basically plan to use a mirror app since the production app is untested.
Current app is using jquery, coffee and asset pipeline
My primary concern is focused on assets management. Since we target a rails 5 app we want to use ES6, webpacker and react, and want to get rid of coffee.
How can we plan this transition ? Can we use both webpacker and old pipeline (sprocket) the time of the transition, using both javascript_tag and javascript pack_tag ?
I have the same interrogation about the css assets.
Can someone point me good resources explaining how to transition from one to another assets management please ?
Thank you in advance :)
For information purpose, I find thoses articles from EvilMartian which are great resources understanding the new webpacker way :
Part 1 https://evilmartians.com/chronicles/evil-front-part-1
Part 2 https://evilmartians.com/chronicles/evil-front-part-2
Part 3 https://evilmartians.com/chronicles/evil-front-part-3
Kind regards,
Thom
Hey Thomas,
You probably already found an answer to this, but one of my co-workers wrote a couple of articles about this topic:
- https://www.fastruby.io/blog/rails/webpack/from-sprockets-to-webpacker.html
- https://www.ombulabs.com/blog/learning/webpack/webpack-vs-sprockets.html
Can we use both webpacker and old pipeline (sprocket) the time of the transition, using both javascript_tag and javascript pack_tag ?
Yes, I think you can use both at the same time, but I wouldn't recommend it.