Skip to content

Releases: roots/bud

v6.6.10

10 Jan 09:04
Compare
Choose a tag to compare

🔧 decouple theme json from @roots/sage (#1982)

Breaks the bud.wpjson feature from @roots/sage into two extensions and a webpack plugin to be combined as needed in projects. @roots/sage now includes these extensions as part of the preset it provides. See the PR for details.

🩹 fix(@roots/sage): serve options including hostname (#1983)

Fixes an issue where setting a proper hostname (fully qualified URL or string; rather than an interface or a port) would cause proxied assets to 500.

🩹 fix: ensure process exit code is set on compilation error (#1985)

Fixes an issue where process exit code would not be set to 1 even if an error is not explicitly thrown by compiler. Adds integration test to protect against regressions.

📦 dependencies: improve peer dependencies

Better defines peer dependencies. This should hep guarantee a flat node_modules and an easier time for users of package managers with stricter peer dependencies resolution strategies (like pnpm).

Associated PRs:

🙏🏼 Update package.json contributors

Now automatically pulling contributors from git history and crediting in each package's manifest. Thanks to everyone!

v6.6.9

02 Jan 23:55
Compare
Choose a tag to compare

This releases features fixes dependency collisions with React 18 and a TypeError in @roots/bud-server.

🩹 fix(@roots/bud-react): allow overriding react version #1974

🩹 fix: server is not a constructor #1976

v6.6.8

31 Dec 14:29
Compare
Choose a tag to compare

This is a quick fix for issues in 6.6.7 with dynamic paths and the bud upgrade command

Notes

  • The fix for dynamic paths deprecates bud.sage.setAcornVersion (great that we don't need it!) Keeping the call shouldn't break your build but it will emit a warning to the console telling you to remove it.
  • Both of these issues made into the 6.6.7 because of the complexities inherent to testing the proxy middleware and the CLI (particularly bud upgrade). These testing deficiencies will be rectified in the near future.

v6.6.7

31 Dec 00:52
Compare
Choose a tag to compare

Improved svg inlining, support for bun, and small quality-of-life fixes.

🎉 feat: svg mini data uri #1948

  • ?inline parameter on .svg files now encoded with mini-svg-data-uri #1941

📦 deps: update babel preset config #1947

  • Removes plugins already included in @babel/preset-env

🩹 fix: do not bud clean multi-config root #1963

  • When invoking bud clean the root project is ignored in a multi-instance context

🩹 fix: ^ version mismatch complaints #1966

  • The ^ character is ignored when doing preflight checks and when invoking bud doctor.

✨🩹 improve/fix: CLI flags #1967

  • add: bund command (execute with bun binary)
  • improve: alternative binaries (ts-bud and bund) execute shell operations with that binary
  • add: --port: specify dev server port
  • fix: --no-hot: no longer adds scripts, middleware, webpack plugins
  • fix: --browser: tolerates boolean
  • improve: bud webpack <args> filters --log (so webpack-cli doesn't throw an error but you can still get insight into bud build process)

🩹 fix(core): notifier in dev #1971

  • fix: notifier not firing in development after initial compilation
  • this could totally break again in the future because we still don't know how to test for it.

v6.6.6

22 Dec 04:19
Compare
Choose a tag to compare

bud@6.6.6 features bug fixes, performance improvements and a new ?inline query parameter for inlining static assets.

🚨 heads up: --verbose replaces -vvvv

It should be aliased but update it anyway

🚨 heads up: bud.template deprecated in favor of bud.html

You'll get feedback in your IDE about this. bud.template will be removed in a future major release.

🎉 feature: Inlining static assets as base64-encoded strings

You can inline static assets with the ?inline query parameter.

body {
  background: url(@src/test.svg?inline)
}

🩹 fix: default port

If left unspecified the default port value should be 3000.

🎉 jsconfig and tsconfig base configurations

Base configurations now provided by @roots/bud and @roots/sage for you to extend from:

  • @roots/bud/config/jsconfig.json
  • @roots/bud/config/tsconfig.json
  • @roots/sage/config/jsconfig.json
  • @roots/sage/config/tsconfig.json
{
  "extends": "@roots/bud/config/jsconfig.json"
}

✨ improve: handling of version inconsistencies and package manager conflicts

Most bud cli subcommands will do some basic checks on what you have installed and provide feedback if you have multiple lockfiles, mismatched versions of @roots/* packages, and other common project problems.

✨🩹 improve: bud upgrade subcommand

bud upgrade will now install packages for you (no need to run yarn/npm install as a second step). So, upgrading in the future should be as simple as running that command.

You can also pass in a specific command if you want to use a specific version:

yarn bud upgrade <version>

This release also fixes a bug related to running bud upgrade in projects with both yarn and npm lockfiles.

✨ improve: bud repl subcommand

bud repl is pretty stable now and has improved UI to make it easier to get started using it. Really helpful for confirming issues with your configuration.

🔥 performance

Everything should be much faster now!

v6.6.5

06 Dec 23:03
Compare
Choose a tag to compare

A bugfix release for bud v6.6.x.

🩹 fix: wordpress@6.?.? enqueues react-refresh on its own #1913

⚠️ breaking

react-refresh is no longer enqueued automatically. wordpress seems to be enqueuing it now; I'm guessing when WP_ENV is development. bud.react.refresh.enable() needs to be called in your config if you want to add react-refresh to entrypoints (but you'll wind up with two instances of react-refresh running in the browser if you don't do anything to account for the wordpress behavior!)

🩹 fix: @roots/bud-server proxy #1913

This fixes problems with 6.6.3 and 6.6.4's proxy server setup. It also makes a backwards compatible change to the bud.proxy API. The docs have been expanded, as well.

  • ✨ improve: bud.proxy api improvements
  • 📕 docs: add bud.proxy options
  • 🧪 test: expands unit tests for bud.proxy

🩹 fix: @roots/browserslist-config #1920

Fixes caniuse-lite upgrade notices and prevents lockfile conflicts. caniuse-lite now updated when @roots/bud is installed.

  • 🩹 fix: @roots/browserslist-config caniuse-lite upgrade issue
  • ✨ add: export exact copy of default wp config: @roots/browserslist-config/wordpress
  • ✨ add: export exact copy of default next.js config: @roots/browserslist-config/next

🩹 fix: bud.provide does not accept string values in object #1911

Surfaced by this discourse topic.

  • 🩹 fix: bud.provide should accept object with string values.
  • 📕 docs: update bud.provide documentation
  • 🧪 test: add unit tests for string and array values

v6.6.3

29 Nov 21:55
Compare
Choose a tag to compare

A bugfix release for bud v6.6.x.

@roots/browserslist-config — avoid shipping dynamic browserslist queries #1898

Dynamic browserslist queries are now resolved during the release process. Hopefully this results in less naging for projects using bud to update caniuse-lite.

bud.hooks — Improve bud.hooks #1903

  • ✨ improve bud.hooks getters for sync and async hooks
  • 🧪 add unit tests

@roots/bud-server — improve proxy middleware #1905

Improves reliability of proxy middleware.

  • 📦 bump: http-proxy-middleware to 3.0.0-beta.0
  • 📦 bump: webpack-dev-middleware to 6.0.1
  • ✨ improve: proxy response interceptor
  • 🧹 improve: bud.proxy config function

ℹ️ Release information

For more information review the diff to see what's changed.

v6.6.2

21 Nov 09:43
Compare
Choose a tag to compare

A bugfix release for bud v6.6.x.

🩹 @roots/bud-imagemin — webp preset not working as intended #1886

🩹 bud.entry — import syntax breaks with Bud 6.6.x #1890

ℹ️ Release information

For more information review the diff to see what's changed.

v6.6.1

17 Nov 14:27
Compare
Choose a tag to compare

A bugfix release for bud v6.6.x.

🩹 @roots/bud-extensions — direct use webpack plugins not being called

  • 🩹 fix direct use webpack plugins not being called
  • 🧪 add unit test covering plugins added by signifier: bud.extensions.add('some-webpack-plugin')
  • 🧪 add unit test covering plugins added as instance: bud.extensions.add(new SomeWebpackPlugin())
  • 🧪 add unit test covering plugins added as simple object: bud.extensions.add({apply: () => void 0})

ℹ️ Release information

For more information review the diff to see what's changed.

v6.6.0

15 Nov 19:06
Compare
Choose a tag to compare

Features, improvements and fixes. Strongly recommended for multi-compiler users.

Read the release notes on bud.js.org

🚨 Breaking: bud.entry no longer parses files as globs

You can use bud.glob if you have need for this.

Example:

export default async bud => {
  bud.entry(`app`, await bud.glob(`@src/*.{js,css}`))
}

🚨 Breaking: Built-in extension keys are normalized

label description exposed
@roots/bud-extensions/cdn Adds remote import functionality bud.cdn
@roots/bud-extensions/esm Adds ESM support functionality bud.esm
@roots/bud-extensions/clean-webpack-plugin Cleans output directory on build
@roots/bud-extensions/copy-webpack-plugin Copies assets (used by bud.assets)
@roots/bud-extensions/fix-style-only-entrypoints Removes JS output from entrypoints which only contain CSS
@roots/bud-extensions/html-webpack-plugin HTML functionality (used by bud.template)
@roots/bud-extensions/interpolate-html-webpack-plugin Adds create-react-app-like template variable support for HTML files
@roots/bud-extensions/mini-css-extract-plugin Optimized CSS loading
@roots/bud-extensions/webpack-define-plugin Defines variables which can be used in the application (used by bud.define)
@roots/bud-extensions/webpack-hot-module-replacement-plugin Adds HMR support
@roots/bud-extensions/webpack-manifest-plugin Emits manifest.json
@roots/bud-extensions/webpack-provide-plugin Provides import(s) globally to the application

If you were using one of these labels directly, you'll need to update it. The upshot of this is that your editor will likely not only tell you that it's wrong but also offer the new key as a suggestion.

✨ Use package signifiers with bud.extensions.add and bud.use

Very convenient! Works for webpack plugins or bud.js extensions.

export default async bud => {
  bud.use('browsersync-webpack-plugin')
}
export default async bud => {
  await bud.extensions.add('browsersync-webpack-plugin')
}

This will only work if the plugin/extension is the default export.

✨ Expand all env values

Variables sourced from .env files in the path to the project are now interpolated using env-expand.
Previously, only the project directory would be expanded.

If you have an unescaped string that causes the expansion to fail the error will be caught.

✨ Better support for hot reload when using multi-compiler

Each bud.js instance's entrypoints are now registered with @roots/bud-client/hot. This helps to prevent conflicts
with reloaded modules when using multiple bud instances.

Some notes:

  • Each instance now declares each previous instance as a dependency. This allows the bud.runtime to work even when using multiple instances.
  • If you are using bud.runtime you will need to make sure that you are specifying single.
  • If you want to modify the instance dependencies manually, you can use the (new) build.dependencies hook. Or, specify the dependencies in the context argument passed to bud.make.
  • The bud.make docs have been updated.

Example of a custom dependsOn when setting up a child instance:

export default async bud => {
  bud.make({
    label: `example`,
    basedir: bud.path(`example`),
    dependsOn: [`some-other-instance`],
  })
}

🎉 Easier upgrades with bud upgrade command

Run bud upgrade to bump bud dependencies to the latest available version.
You will need to run the install after the command completes. This is a new command and is not yet unit tested.

@roots/bud-swc

🎉 @roots/bud-swc plugins are configurable

Call bud.swc.plugins to manage @swc/core plugins. You can pass an array of plugins (as demonstrated in the swc docs) or a callback
if you want to modify what's already there:

export default async bud => {
  bud.swc.plugins(plugins => {
    plugins.push([`swc-plugin`, {option: true}])
  })
}

If you haven't tried @roots/bud-swc you should consider it. This extension is no longer considered experimental. There is a strong case to be made for it replacing @roots/bud-babel in @roots/bud-preset-recommend for version 7 of bud.js.

@roots/bud-emotion

🎉 Supports @roots/bud-emotion

If you have @roots/bud-swc installed, @roots/bud-emotion will register emotion support with @swc/core.

@roots/bud-criticalcss

🎉 Option to disable CSS extraction

Disable critical CSS extraction by calling bud.critical.extract(false). This isn't generally recommended.

@roots/bud-criticalcss remains an experimental extension.

@roots/sage

🩹 Fix: proxy assets load when in dev mode

This fix requires acorn v3 and you must set a public path. You can opt-in with bud.sage.setAcornVersion('v3').

With the acorn version set to v3 assets should load when using the proxy directly in dev mode. You will still see 404 errors for the /bud/hot endpoint.

Internal changes

Nothing is required of you, but if you're curious, here's what's changed:

🩹 Fix: reload browser on watched files add/unlink

When files are added or removed from a watched directory path the browser will now reload.

🏷️ Typings: mapped extension options

You should now get useful, accurate intellisense and typechecking when using the bud.extensions api directly.

✨ CLI: warn when using bud.serve in a child compiler

It warns you to move it to the parent context. For now it also does this for you since it's an understandable mistake and will result in a TypeError.

✨ CLI: cleaner stack traces

There should be less duplication of emitted errors, more meaningful stack traces, and highlighting of important
parts of the error message.

⚙️ use nodenext to resolve node modules

We're using the nodenext tsc module setting. This enables top-level await for core bud.js packages 🥳.

⚙️ @roots/bud-api is now fully type-safe

strict mode is enabled! We're beginning to implement runtime validation using zod.

🧪 migrate from jest to vitest (#1850)

We switched from jest to vitest because of esm compatibility issues. It's pretty nice!
Hopefully we'll be able to run unit tests on the CLI now.

ℹ️ Release information

For more information review the diff to see what's changed.