5 ms·
We (Laravel) have just switched the frontend tooling from Laravel Mix (a webpack wrapper) for Vite. https://laravel.com/docs/9.x/vite#main-content https://larav
by jbrooksuk 4y ago
We (Laravel) have just switched the frontend tooling from Laravel Mix (a webpack wrapper) for Vite. https://laravel.com/docs/9.x/vite#main-content https://laravel.com/docs/9.x/vite#main-content
The speed gains are super impressive from Vite.
- config_yml 4y agoI think Rails should have done the same, vite_ruby is amazing. Thankfully it's easy enough to replace the current options, which feel a bit half-hearted.
- gedy 4y agoIt feels like DHH really doesn't want this tooling at all in Rails, but did so reluctantly because so much view tech and mindshare had moved to the client.
- redbar0n 4y agohttps://world.hey.com/dhh/rails-7-will-have-three-great-answers-to-javascript-in-2021-8d68191b https://world.hey.com/dhh/rails-7-will-have-three-great-answ...
- yeskia 4y agoesbuild through jsbundling-rails is very quick too.
- porker 4y agoInteresting you've made the change. Does that mean that Vite source maps for TS/JS and CSS are now up to scratch?
- ksec 4y agoEven if I have no interest in Vite, but if laravel is using it as default, that is saying something. May be Rails should take a look as well.
- nickjj 4y ago> May be Rails should take a look as well. I don't know what's involved with Laravel's front-end stuff but Rails is using https://github.com/rails/jsbundling-rails https://github.com/rails/jsbundling-rails which lets you pick whichever front-end tool you want to use that's supported (esbuild + webpack + rollup at the moment). You're no longer bound to a specific tool that's been modified to work with Rails like the old Webpacker, instead you can use the native tool with its native configuration. Although DHH has already given an opinion on not adding Vite support in https://github.com/rails/jsbundling-rails/issues/25#issuecomment-961981357 https://github.com/rails/jsbundling-rails/issues/25#issuecom..., but there is third party support for it at https://vite-ruby.netlify.app/guide/introduction.html https://vite-ruby.netlify.app/guide/introduction.html. Technically the Rails default is not to use any of that and instead you can use a Node-less import maps solution (personally I've gone with esbuild because there's certain things you can't do with Tailwind's pre-built binary). esbuild with Rails 7 is extremely easy nowadays. It's pretty much running a single esbuild command with a couple of flags, there's not even a config file you need to mess around with. They did the same thing with css with https://github.com/rails/cssbundling-rails https://github.com/rails/cssbundling-rails, there's tailwind, bootstrap, bulma, postcss and dart sass that works out of the box all with their native configuration. It's the best of both worlds. You have flexibility in being able to pick whatever you want but Rails pulls it all together to make using them easy without breaking away from using the native tool's configuration.