Live data from Hacker News

Rails 6 with Webpacker 6, Tailwind 2 with JIT, Postcss 8 and some default setup

nauman.medium.com

31–40 of 101 posts

Re: Rails 6 with Webpacker 6, Tailwind 2 with JIT, Postcss 8 and some default setup

#31
post #5

It's telling that most instructions deal with the Javascript toolchain and not Rails itself. And let's hope that everything works and none of the 2000 imported node_modules blow up when this tutorial is 3 months old. I'm looking forward to Phoenix 1.6 which ditches Webpack for esbuild. Every step away from the insane churn of the modern frontend world is welcome.

Rails will soon default to using ESM instead of Webpack. https://world.hey.com/dhh/modern-web-apps-without-javascript...

Wow that sounds great. It looks like it's still quite new, but I love having webpacker as optional in Rails 7 and just using ESM instead, which seems much more sane.

Still, there's the need to install NPM packages. You can use Skypack as a patch, but ideally you should be able to host all of your JavaScript. I guess you could use `npm` and manually link to those files in your configuration map, there could even be an automated Rake task to do it, but I don't know if that's the direction DHH has in mind.

Re: Rails 6 with Webpacker 6, Tailwind 2 with JIT, Postcss 8 and some default setup

#32
post #5

It's telling that most instructions deal with the Javascript toolchain and not Rails itself. And let's hope that everything works and none of the 2000 imported node_modules blow up when this tutorial is 3 months old. I'm looking forward to Phoenix 1.6 which ditches Webpack for esbuild. Every step away from the insane churn of the modern frontend world is welcome.

This is why Phoenix is ditching webpack! The story on the Elixir side is more compelling. I'm glad the team made this decision.

https://sergiotapia.com/phoenix-160-liveview-esbuild-tailwin...

Also medium sucks, please don't use it to write developer blogs. People can't read your article!

Re: Rails 6 with Webpacker 6, Tailwind 2 with JIT, Postcss 8 and some default setup

#33
post #7
post #5

It's telling that most instructions deal with the Javascript toolchain and not Rails itself. And let's hope that everything works and none of the 2000 imported node_modules blow up when this tutorial is 3 months old. I'm looking forward to Phoenix 1.6 which ditches Webpack for esbuild. Every step away from the insane churn of the modern frontend world is welcome.

It's still perfectly possible and valid to use Sprockets instead of webpack in a Rails app. That's what i do with every one of my applications and it works flawlesly

It works until you try using a library not available with Sprocket...

Re: Rails 6 with Webpacker 6, Tailwind 2 with JIT, Postcss 8 and some default setup

#34
post #14

Another reason to move to Elixir from Ruby...

Elixir is like the alternate town in Blazing Saddles. It looks great but you find out there aren’t really people nor library depth there. After it blows up your staffing and project plans you end up moving back.

I built my startup in elixir. yes, there aren't as many libraries but the ones I've needed have been available and reasonably documented in most cases.

one thing I like in elixir is that the whole language (and thus libraries) are more composable. its easier forme to break and reform functionality from libraries in ways the authors didnt envision. Takes more time to integrate but the end result is way more maintainable.

Re: Rails 6 with Webpacker 6, Tailwind 2 with JIT, Postcss 8 and some default setup

#35
post #5

It's telling that most instructions deal with the Javascript toolchain and not Rails itself. And let's hope that everything works and none of the 2000 imported node_modules blow up when this tutorial is 3 months old. I'm looking forward to Phoenix 1.6 which ditches Webpack for esbuild. Every step away from the insane churn of the modern frontend world is welcome.

If rails is only used as an API, I found it much cleaner to have a separate codebase for the SPA and run webpack separately (or nowadays maybe use something like esbuild instead?).

I was able to work with rails & webpacker precisely because I had experience with webpack separately, but webpacker had some weird limitations.

Re: Rails 6 with Webpacker 6, Tailwind 2 with JIT, Postcss 8 and some default setup

#36
post #5

It's telling that most instructions deal with the Javascript toolchain and not Rails itself. And let's hope that everything works and none of the 2000 imported node_modules blow up when this tutorial is 3 months old. I'm looking forward to Phoenix 1.6 which ditches Webpack for esbuild. Every step away from the insane churn of the modern frontend world is welcome.

> I'm looking forward to Phoenix 1.6 which ditches Webpack for esbuild. Every step away from the insane churn of the modern frontend world is welcome.

I don't like the churn either, but ditching X for Y only contributes to the churn.

Re: Rails 6 with Webpacker 6, Tailwind 2 with JIT, Postcss 8 and some default setup

#38
post #20

Earlier quoted context omitted.

Where setting up a new app with Tailwind JIT is substantially easier?

Where Phoenix does a better job with all this and you don't have Ruby's baggage anymore.

It's literally the same process and it still uses webpacker...

Re: Rails 6 with Webpacker 6, Tailwind 2 with JIT, Postcss 8 and some default setup

#39
post #5

It's telling that most instructions deal with the Javascript toolchain and not Rails itself. And let's hope that everything works and none of the 2000 imported node_modules blow up when this tutorial is 3 months old. I'm looking forward to Phoenix 1.6 which ditches Webpack for esbuild. Every step away from the insane churn of the modern frontend world is welcome.

It seems that swc is gaining more traction than esbuild, deno is using it, nextjs hired swc dev and rome is using swc too.

Also one limitation by design of esbuild is lack of customization, you cannot hook into esbuild and do your own things, but I read you could with swc.

But either way, both are way faster than the most popular ones.

Post reply on HN