Live data from Hacker News

Mako – fast, production-grade web bundler based on Rust

makojs.dev

101–110 of 215 posts

Re: Mako – fast, production-grade web bundler based on Rust

#101

Earlier quoted context omitted.

Dead code elimination is related to but distinct from tree shaking - it also means that unused code branches get removed, for example constants like NODE_ENV get replaced with a static value, and if you have a static condition that always results to true, the else branch is removed.

In my book that's all covered by the term 'dead code elimination', e.g. removing (or not including in the first place) any code that can be statically proven to be unreachable at runtime. Some JS minifiers (like Google's Closure) can do the same thing in Javascript on the AST level (AFAIK Closure essentially breaks the input code down into an AST, then does static control flow analysis on the AST, removes any unreach…

Yep, that's how it works - you first perform dead code elimination and then tree shaking exactly because it wouldn't remove everything otherwise. Agreed that you need both done one after another in most cases; however you can usually disable either one in bundler configuration and it's a separate step.

Re: Mako – fast, production-grade web bundler based on Rust

#102
post #88

Every bundler these days boasts "Rust" and "fast". What people really want is webpack feature parity. For a large enough organization with complex use cases and resource management, I yet need to see a real webpack equivalent. (Meanwhile, swc parser can't yet pass all tests in test262 according to their website: https://docs.rs/swc_ecma_parser/latest/swc_ecma_parser/ )

What features do they want? In my experience people always welcome webpack alternatives and not having CPU starvation issues or having to wait for minutes to webpack to work.

The problem is that we have already n-thousands alternatives, so it's a slightly different setup everytime - but generally as long as it's not webpack, it's all good.

Recently someone disabled turbopack on a next.js project because one new dependency wasn't supported and the developers started complaining right away the app was unbearably slow. The team couldn't work on latest for a week, they were just reverting the latest changes breaking turbopack support, working and then pushing.

Re: Mako – fast, production-grade web bundler based on Rust

#103
post #88

Every bundler these days boasts "Rust" and "fast". What people really want is webpack feature parity. For a large enough organization with complex use cases and resource management, I yet need to see a real webpack equivalent. (Meanwhile, swc parser can't yet pass all tests in test262 according to their website: https://docs.rs/swc_ecma_parser/latest/swc_ecma_parser/ )

how’s esbuild? I’ve yet to hit something I had in webpack that isn’t a couple line plugin away from being present in esbuild

Re: Mako – fast, production-grade web bundler based on Rust

#104
post #46
post #20

I was confused by the "Rust" denotion in the title and presumed it was an alternative builder to compile rust for web (wasm?). It's "yet another" bundler for javascript. Built in rust.

If they didn’t tell us it was built in Rust how would we ever know how smart the developers are?

Yeah, that's how I ended up using prisma... until I realised they didn't have joins

All this aside, knowing something is in Rust tells me: - It's fast - It's maintainable (imagine the same project but in C)

Re: Mako – fast, production-grade web bundler based on Rust

#106
post #103
post #88

Every bundler these days boasts "Rust" and "fast". What people really want is webpack feature parity. For a large enough organization with complex use cases and resource management, I yet need to see a real webpack equivalent. (Meanwhile, swc parser can't yet pass all tests in test262 according to their website: https://docs.rs/swc_ecma_parser/latest/swc_ecma_parser/ )

how’s esbuild? I’ve yet to hit something I had in webpack that isn’t a couple line plugin away from being present in esbuild

Intrestingly esbuild isn't included in their benchmarks.

Esbuild is the only current build-tool that keeps one sane. The serve-mode is excellent and elegant with no brittle constantly breaking hacks like HMR or file watching.

Sadly configuring especially the serve-mode is a bit badly documented, and not usable via CLI flags if one needs plugins.

Re: Mako – fast, production-grade web bundler based on Rust

#107
post #53
post #18

I've recently taken a legacy Typescript clientside codebase that was using webpack to generate tens of js packages from minutes to seconds by using bun [0] for both dev and build: For dev I replaced webpack with "bun vite": it loads scripts ad hoc and is thus super fast at startup, and it still supports hot reloading. For build I use "bun build". I've created a small script where I don't specify the output folder, bu…

Bun.build actually has a `define:` option that does the same thing as your replace. If you use it, it'll even propagate the value, and treeshake away any `if(import.meta.hot)` you have.

Very good tip; thank you!

Re: Mako – fast, production-grade web bundler based on Rust

#108

Earlier quoted context omitted.

The situation with the tooling constantly changing isn't nearly as bad as the front-end frameworks themselves. I've been updating my knowledge of front-end, and it's an absolute shambles. The official React documentation( https://react.dev/learn/start-a-new-react-project ) is telling me that in order to use their framework, I need to use another framework to solve (quote)"common problems such as code-splitting, routi…

Nextjs is the trojan horse sent to destroy React and it worked

Yep, it’s terrible and everyone is going for it.

Re: Mako – fast, production-grade web bundler based on Rust

#109
post #88

Every bundler these days boasts "Rust" and "fast". What people really want is webpack feature parity. For a large enough organization with complex use cases and resource management, I yet need to see a real webpack equivalent. (Meanwhile, swc parser can't yet pass all tests in test262 according to their website: https://docs.rs/swc_ecma_parser/latest/swc_ecma_parser/ )

no one mentions rolldown by the author of vue and vitejs?

Re: Mako – fast, production-grade web bundler based on Rust

#110
post #46

Earlier quoted context omitted.

If they didn’t tell us it was built in Rust how would we ever know how smart the developers are?

Personally, I appreciate knowing when something is written in Rust. I know it is very likely I can easily install it and try it out immediately and that it is likely faster than any non-native tool I'm currently using. However, I do find "based on Rust" instead of "written in Rust" to be an odd choice of terms.

Just looking at their benchmarks, it's not particularly fast. es-build looks much better in benchmarks, but it's not written in Rust. It seems they wanted a tool in Rust just-because (experience on the team, preference foe the language...), and then only compared against those.

As for the language "based on Rust", it's likely bad wording due to them not being native English speakers.

Post reply on HN