-
Notifications
You must be signed in to change notification settings - Fork 140
Yarn and Webpacker? #847
Comments
Can I start whispering "React" 😍 now? |
👍 for keeping the asset pipeline clean |
@F3PiX trying to keep js as much confined to the frontend as possible here 😂 I think the biggest upside is that one can get rid of using gems that just wrap javascript code and just use npm packages instead. Of course the implication also is that people then have to learn to use yarn which might be a new hurdle (but a rather small one imho). |
I suppose going to yarn is not a big deal for Rails devs, because they are used to the gemfile. |
I thought webpacker was shipped with Rails v5.1 by default now? If that is so, this is definitely not too much to ask of a dev. And in any event, we need a line or two in our README anyway, so people should be able to just copy/paste it into the terminal. |
@carpodaster it ships but it is not the default. If you want to use it on a new project you run |
@F3PiX if it's fine I'd write create a pull request and add fitting sections to the readme, I think the wiki is somewhat too detached for this kind of thing. |
@michaelem 👍 for the readme and the initial setup. I was thinking that the wiki is a nice place for a short notice on how to add new JS libraries. But no fuzz, just an idea. |
@michaelem @carpodaster I don't know if everyone but me uses Foreman to start the app? We can add webpack to Foreman, right? Saves the very hard and painful process 😂 of starting up two processes before you can start... |
@F3PiX with webpacker 3.0 webpack is anyway automatically started in the background if it's not running - so no need to start it manually unless you want live-reloading of javascript code: http://weblog.rubyonrails.org/2017/8/30/webpacker-3-0/ |
COOL!!!! I didn't know that! (And that while it is almost 5 days old news!! 😉 ) |
➕ on moving to "modern JS"™ |
@michaelem Did you mean that you would like to take this on? |
@F3PiX yes, hopefully I'll get around to finish #846 today, then I can embark on this. |
@michaelem Is it correct that ES lint is a better choice for working with ES6 than JSlint? |
Edit: we are currently using jsHint. 🙈 |
Hey @michaelem – just wanted to ping you if you were able to advance this. Anything one can help you with? |
Hey, as signified by my response time I did not really manage to carve out time for this, although I think I can actually give it another try next week, since that should be a bit more quiet. |
Only 65% related to this ticket but I didn't want to open up a new one 🙈 Looking at this PR 👉 #877, seeing how changing a single line in a view template fully decouples its necessary Javascript functionality made me question if we should do something about the general structure of JS in the app as well. Right now it's just randomly placed, named and formatted files - all untested which makes it hard for people new to the project to see whether a page requires certain JS code and also where to put new code. I was thinking we could at least go for "page / controller specific JS" which has been sort of a pattern in Rails if an app did not use client-side frameworks. Does anyone of you know of any other common patterns for this? |
@klappradla I stumbled upon this: https://evilmartians.com/chronicles/evil-front-part-1 |
Yes, fully agree @F3PiX ✌️ I know this tutorial and I also really like what they're doing. But as you wrote, especially putting the HTML files into what is normally called Having a What I plan to have is:
|
Last week I did spend a while migrating some projects to Webpacker 3.0 and I have to say it's pretty much as simple to use as the asset pipeline now.
Should we move the project to those two?
This would also allow us to use modern javascript and babel for backwards compatibility.
The text was updated successfully, but these errors were encountered: