Bud v6.2.0 released

bud v6.2.0 released

If you prefer, read the v6.2.0 release notes on bud.js.org. If only for the table of contents.

:tada: SWC support

This release introduces a new extension: @roots/bud-swc.

The extension registers support for swc.

You can try it out by installing @roots/bud-swc. Hopefully it “just works” out of the box for you, but check out the docs for details on how to configure swc for your project.

If you have the extension installed @roots/bud will privilege it over @roots/bud-babel when it is available. So, you really can give it a go by just adding @roots/bud-swc to your project dependencies when upgrading.

The swc project claims upwards of a 70x performance improvement over babel. I don’t see that in testing (MacOS ARM arch), but it is definitely faster (~20%).

I hear the difference is particularly pronounced in WSL2, although my means to test that is limited. Let me know how it goes!

Better dev experience using @roots/bud-react

For projects using a combination of @roots/bud-react and either @roots/bud-typescript, @roots/bud-swc and/or @roots/bud-babel, react fast refresh is now enabled by default.

If you don’t want react fast refresh then you can disable it with:

bud.react.refresh.disable()

:warning: If you are currently configuring fast-refresh using bud.reactRefresh() you will need to update your call to use the new API.

Change this:

bud.reactRefresh(true)

to this:

bud.react.refresh.enable()

babel is now optional when using @roots/bud-typescript

Depending on your project you may be able to use typescript without babel. Why not try it and find out?

bud.typescript.useBabel(false)

If you disable babel react-refresh will be enabled using the react-refresh-typescript compiler plugin instead.

@roots/bud-terser is now a core extension

If you have installed this extension directly to your project you can remove it.

If you are using the new SWC extension terser will automatically be configured to use the swc minifier.

Fix: zero config hmr client script injection

There was an issue with client scripts not being injected in zero configuration setups (more specifically: any setup that didn’t explicitly set entrypoints with bud.entry).

It’s been corrected; see #1506 for details

New command: bud typecheck

TypeScript users can call bud typecheck to run typechecking outside of compilation. There are a couple requirements, at least for this initial effort:

  • You must have typescript installed
  • You must have a tsconfig.json in your project root

This is honestly not much more than a tsc --noEmit alias right now.

But, it might be useful for you as-is and it will get better and more useful in future releases.

More information

Thanks to @robrecord for a nice set of documentation fixes.

Review the diff to see what’s changed.

2 Likes