Skip to main content

6.14.0

· 5 min read
kellymears
Developer

Top-level await, lazy compilation of async modules, CLI improvements, performance enhancements, and more.

Updates available

There are patches available for this release. Please update to 6.14.3.

🚨 Potentially breaking changes

  • deprecated: @roots/merged-manifest-webpack-plugin
  • deprecated: @roots/bud-wordpress-manifests
  • bud.console: removed. old methods consolidated with bud.dashboard.
  • bud.context.files: interface has changed. The module property for each value in bud.context.files is now an async function that returns the module. This is an undocumented internal, but some people might be using it.

Key changes

  • ✨ feature: top level await (enabled for ESM projects only)
  • ✨ feature: creates aliases from imports field of package.json
  • ✨ feature: dynamic modules now compiled lazily in development
  • 🏎️ performance: multi-config builds are now built in parallel
  • ✨ improve: config files now lazy loaded
  • ✨ improve(@roots/wordpress-theme-json-webpack-plugin): theme.json included in compilation module graph
  • ✨ improve(@roots/bud-tailwindcss-theme-json): Edits to tailwind.config.js now result in rebuild of theme.json
  • ✨ improve(@roots/entrypoints-webpack-plugin): entrypoints.json included in compilation module graph
  • ✨ improve(@roots/bud-dashboard): improved UI
  • ✨ add flag: --entrypoints.html (same as calling bud.entrypoints.set('emitHtml', true); emits partials containing <script> and <style> tags)
  • ✨ add flag: --dashboard (use dashboard stats vs. simple stats output)
  • ✨ add flag: --dashboard.assets (show/hide presentation of assets)
  • ✨ add flag: --dashboard.compact (truncated build summary)
  • ✨ add flag: --dashboard.entrypoints (show/hide presentation of entrypoints)
  • ✨ add flag: --dashboard.server (show/hide server info)
  • ✨ feature: for multi-compiler builds 1-9 will show stats isolated by compiler. 0 shows all compilers.
  • ✨ feature: d when viewing the dashboard will show detailed debug stats
  • ✨ feature: c when viewing the dashboard will present output with compact formatting
  • 🩹 fix: issues with bud.js cli error output
  • 🩹 fix: issues with bud.js internal module resolution cache
  • 📦 pkg(@roots/wordpress-transforms): small utility for translating @wordpress/* signifiers to wp-* enqueue handles and wp.* window references
  • 🗂️ typings(@roots/bud-framework): flatten organization of typings

Additional Notes

bud.js module resolution cache is now self-healing

The bud.js module resolution cache is now self-healing. If a build dependency was previously available at some path but is now unresolvable its entry will be updated while still preserving the rest of the cache. There should now be limited reason to use --force to manually flush the cache; it will probably only serve to make your next build slower.

--no-clean will be a future default

You can get a surprising performance boost by using the --no-clean flag (some test projects are >15% faster). Why delete and rewrite modules which have not been modified? This will be default in the next major release of bud.js.

You might not want to make a vendor chunk

If you are doing a lot of code splitting with imports, try disabling chunking and see if it improves initial page load (bud.splitChunks(false) or --no-splitChunks). The extra runtime code might not be worth it if you are already importing modules conditionally.

--ci will soon mean more than "run this without fanciness"

If you are using --ci solely to not display stats consider switching to --no-dashboard. There may be changes in the future to the behavior of this flag which are focused on CI environments specifically.

bud.js instance is now importable

The bud.js instance is now available as a named import from @roots/bud (import {bud} from '@roots/bud'). This allows for a bunch of stuff you couldn't do before. Like, as an example, configuring bud.js without an exported callback:

import {bud} from '@roots/bud'

bud.entry('app', ['app.js', 'app.css'])

You can also import the instance into other config modules or custom scripts. Not all tools will play nicely. Tailwindcss, for example, will try to bundle bud.js along with your tailwind config using jiti. It won't succeed (jiti can't handle import.meta).

Full Changelog

https://github.com/roots/bud/compare/v6.13.1...v6.14.0