Bud v6.14.0 released

bud v6.14.0 released

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

:rotating_light: 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

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

1 Like