MithrilJS / mithril.js

A JavaScript Framework for Building Brilliant Applications

Home Page:https://mithril.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make vite the default

laoshaw opened this issue · comments

I like the fact that mithril now is the only SPA that does not get into the SSR side, which makes it complex for people who are only interested in SPA CSR, however the webpack is a bit "out of date" these days, hope Mithril can make vite the default

Mithril.js version:

Why

vite is faster, smaller and more importantly, easier to use. make it default will likely invite more new users too.

ESbuild FTW.

what does that mean, learned a little about mithril in the past, do you mean there is a way for esbuild to work with mithril now? Thanks. I want to pick up mithril but webpack is a non-starter for me at this point. the reason to switch from react to mithril is simplicity, and webpack in mithril does not help(react is recommending vite on the build side too, along with pretty much everybody else)

Vite adds a layer of DX (and a ton of marketing) on top of esbuild that you get the most out of for codebases that produce a visual result (like a site or an app). It only swaps out esbuild's bundling feature for rollup's because it is more full-featured if you want to do all sorts of live-reloadable, hot-module-replaced import preprocessing (eg JSX, MDX, SASS etc)

IMO for a library like mithril.js esbuild CLI/API would be enough.

do you mean there is a way for esbuild to work with mithril now?

Of course, why wouldn't there be?

Mithril does work with Vite (and esbuild) if you are writing .js or .ts, but for .jsx or .tsx, custom JSX transform needs to be set (see #2675, and I believe esbuild did not remove the feature in these years).

Though personally I agree that you might want to avoid using .tsx (either .ts with hyperscript or .jsx is okay) with mithril as the current development experience with .tsx is... not good. You can get things run with .tsx, but with lots of warnings on JSX typings...