I created a Vite.js plugin: https://t.co/JCPQ9gzF3I for faster HTML reloading in the browser using Hotwire Turbo (for Rails apps and beyond) instead of a full page refresh. It also supports HMR for Tailwind CSS.
Inspired by (forked from) @MaximoMussini vite-plugin-full-reload.
Why I think Vite (Ruby) is the only viable option (among available today) for Rails apps?
It the only one that is capable* of surviving major framework upgrades, DHH mood swings and uncontrolled frontend tooling evolution.
Vite is kinda meta builder: it relies on esbuild and rollup for dirty work. Whenever a new shiny frontend builder appears and overcomes esbuild (which is a great builder, for sure), Vite would switch under the hood without enforcing you to migrate yourself.
Using Vite Rails instead of sprockets|propshaft+importmap|jsbundling|cssbundling|tailwindcss-rails|esbuild|bun (pick your own combination) allows you to stay independent of Rails frontend “evolution”. More major versions covered, less painful upgrades.
I switched to Vite ~3 years ago and forgot about asset pipeline stack upgrades. It works today in a similar fashion it worked back then.
JS frameworks are just the better tradeoff for long-session productivity apps. Much higher upper-limit for the UX.
And the DX is not as complicated as some anti-JS folks claim to be - reminder that there are easy ways to integrate Vite in Rails: https://t.co/k9K8Hkjefz
@owaiswiz @joeldrapper Thanks for sharing, that's what I use with Phlex:
// vite.config.ts
import reloadOnChange from 'vite-plugin-full-reload'
export default defineConfig({
plugins: [
reloadOnChange([
'app/views/components/**/*',
]),
]
})
@manufaktor Nice!
@inertiajs is great for this kind of integration, and has the advantage of not requiring Vue Router.
Check https://t.co/LZzbiFtCQa for an example (a bit outdated).
Upgraded types_from_serializers to support oj_serializers v.2.0 ✨
🤖 Automatically generate TypeScript
✅ Minimize bugs in the frontend
🕶 Infer native types from your SQL schema
🚀 Generated instantly on file changes
#ruby#rails
https://t.co/kClquG6u4Z
@palkan_tula Would love to support Hanami 2 out of the box!
Haven't received any related comments in the repo; it's likely that folks using @hanamirb are not using Vite.
Should be easy to adjust the installer, @jodosha let me know if you are interested.
https://t.co/kBZ6HHkIdt
⚡️ Join @MaximoMussini to learn how @vite_js can improve your development workflow, how to use it in Ruby web applications, and how it compares to other tools that are available in @rails!
❤️ https://t.co/j8KfD4IxlJ
💎✨New Release✨💎
Happy to announce that Vite Ruby will now install @vitejs 4 by default.
You can upgrade your #ruby and #rails projects by running:
⌨️ bin/vite upgrade
⚡️ Vite 4 is out!
From all of us on the Vite team, thanks a lot to everyone that contributed to Core, pushed improvements from your frameworks upstream, expanded the ever-growing plugin ecosystem, and triaged, tested, or helped others in our community 💜
https://t.co/yZTwuKPpl9
@ilesjs@JLarky@nickemccurdy@reactjs@preactjs Using a framework with a large bundle size is not ideal if your goal is to do partial hydration, but you do you 😄
As a reminder, preact/compat is great, and you can configure Vite so that you can keep typing `from 'react'`.
So excited to be a part of ViteConf this year! 😃
If you've heard of @vite_js but haven't gotten around to trying it yet, this talk has got you covered!
#vite#ruby#rails
❤️ We're happy to announce @MaximoMussini, creator of https://t.co/azMdTrNaUh, as ViteConf's next speaker! Join Maximo as he explains how to bringing joy to your @rails experience with @vite_js!
Join https://t.co/OQdQqHilpE on Oct 11th to chat with Maximo and other speakers! 🙌