Releases: roots/bud
6.16.0
This update adds css module support for scss when using @roots/bud-sass
, improves the CLI dashboard, and adds experimental support for pnpm and yarn berry to the bud ugprade
and create-bud-app
commands. It also includes dependency updates, bug fixes and other internal improvements.
What's Changed
- 🩹 fix(patch): fix emotion plugin resolution (@roots/bud-emotion) by @kellymears in #2416
- 👍🏼 improve(patch): support
*.module.scss
(@roots/bud-sass) by @kellymears in #2421 - 📕 docs(none): syntax error when using default export -
filters.md
by @Hansanghyeon in #2420 - 👍🏼 improve(patch): prevent duplicate dashboard renders by @kellymears in #2422
- 👍🏼 improve(patch):
bud.watch
api by @kellymears in #2423 - 📕 docs(none): update
adding-postcss.mdx
by @nlemoine in #2425 - ✨ improve(patch): add
@roots/bud-support/jsx-runtime
by @kellymears in #2426 - 🩹 fix(patch): fix proxy url by @kellymears in #2427
- ✨ improve(patch): improve yarn berry and pnpm support by @kellymears in #2432
- 🩹 fix(patch): fix bud menu selection by @kellymears in #2433
- 📁 types(patch): fix @roots/bud-framework type exports by @kellymears in #2437
New Contributors
- @Hansanghyeon made their first contribution in #2420
Full Changelog: v6.15.2...v6.16.0
6.15.2
Patch: fixes a potential issue with resolving sass-loader
and improves bud.cache
interface and build dependency identification.
What's Changed
- ✨ improve(patch): improve cache.buildDependencies by @kellymears in #2410
- 🩹 fix(patch): sass-loader resolve by @kellymears in #2413
Full Changelog: v6.15.1...v6.15.2
6.15.1
Fixes issues with create- bud-app
when not specifying any features (totally vanilla project) and improves CLI command cache to be mostly self-healing.
What's Changed
- ✨ improve(patch): heal cli commands cache by @kellymears in #2400
- 🗂️ types(patch): include types directory (criticalcss) by @kellymears in #2401
- ✨ improve(patch): nested errors by @kellymears in #2402
- ✨ improve(patch): --use flag by @kellymears in #2403
- 🩹 fix(patch): create-bud-app fails when no dependencies are selected by @kellymears in #2404
- 📕 docs(none): wordpress preset code samples by @kellymears in #2405
- 📕 docs(none): entrypoints manifest by @kellymears in #2406
- 📦 deps(patch): upgrade dependencies by @kellymears in #2407
- ⚙️ internal(none): security.md by @kellymears in #2408
- 🩹 fix(patch): create-bud-app dependencies by @kellymears in #2409
Full Changelog: v6.15.0...v6.15.1
6.15.0
This release is mostly focused on maintaining and improving existing features. The one new feature lets you opt-out of externalizing certain WordPress dependencies (if you are using @roots/bud-preset-wordpress or @roots/sage). For more information check out the updated @roots/bud-preset-wordpress docs.
⚠️ Potentially breaking change
@roots/sage: previously bud.splitChunks('single')
was called for production builds. This is no longer the default for two reasons:
- If you have an editor entrypoint and an app entrypoint (common), it is possible that editor dependencies could be extracted into the common chunk. This can lead to Acorn enqueuing those dependencies for both
app
andeditor
, even if they were only used in one (since the shared vendor module contains references to the dependencies). - This is very easy to address as part of your application and that approach is preferred. Especially now that top-level async/await is available for bud.js application modules.
- If you really want a vendors chunk, just call
bud.splitChunks()
or pass the--splitChunks
flag.
What's Changed
- 📕 docs: improve docs by @kellymears in #2368
- 🩹 fix(patch): register command type error after extension uninstall by @kellymears in #2372
- 👍🏼 improve(minor): internals & tests by @kellymears in #2373
- 🧹 chore(none): cleanup by @kellymears in #2376
- 📦 deps(patch): bump vitest from 0.32.2 to 0.33.0 by @dependabot in #2375
- 📦 deps(deps): bump @babel/core from 7.22.5 to 7.22.9 by @dependabot in #2374
- 📦 deps(deps): bump ts-loader from 9.4.3 to 9.4.4 by @dependabot in #2356
- 📦 deps(deps): bump @babel/runtime from 7.22.5 to 7.22.6 by @dependabot in #2355
- 📦 deps(minor): upgrade by @kellymears in #2377
- 🩹 fix(none): readme generation by @kellymears in #2378
- 🩹 fix(none): nightly release by @kellymears in #2383
- 🩹 fix: parallelism by @kellymears in #2386
- 👍🏼 improve: build performance by @kellymears in #2387
- 📦 deps(deps): bump word-wrap from 1.2.3 to 1.2.4 by @dependabot in #2384
- 📦 deps(deps): bump esbuild from 0.18.13 to 0.18.14 by @dependabot in #2379
- 👍🏼 improve: error handling by @kellymears in #2388
- 📦 deps(deps): bump esbuild-wasm from 0.18.13 to 0.18.14 by @dependabot in #2380
- ✨ feat(minor): configurable wordpress externals by @kellymears in #2389
- 🩹 fix(patch):
--editor
warning when--editor
not used by @kellymears in #2390 - 🩹 fix(patch): multi-compiler uncaught errors in dev by @kellymears in #2392
- 📕 docs: fix @roots/bud-sass installation docs by @xeader in #2391
- ✨ improve: stricter typings by @kellymears in #2393
- 🗂️ types(patch): strict typings by @kellymears in #2394
- ✨ improve: typings & tests by @kellymears in #2395
- 🗂️ types(none): improve typechecking by @kellymears in #2396
- 📕 docs(none): wordpress enqueues by @kellymears in #2397
- 🩹 fix(patch): fix casing in dashboard of Dev by @kellymears in #2398
- ✨ improve(minor): no split chunks (@roots/sage) by @kellymears in #2399
New Contributors
Full Changelog: v6.14.3...v6.15.0
6.14.3
Fixes and improvements.
What's Changed
- 🩹 fix <alpha-value> Tailwind placeholder by @StudioRectangle in #2369
- ✨ improve: tighten y-padding of dashboard elements by @kellymears in #2371
New Contributors
- @StudioRectangle made their first contribution in #2369
Full Changelog: v6.14.2...v6.14.3
6.14.2
Fixes #2365: bud@16.4.1 incompatible with stylelint@15.10.1
What's Changed
- 👍🏼 improve:
bud stylelint
compatibility by @kellymears in #2367 - 📦 deps(deps): bump syncpack from 10.6.1 to 10.7.3 by @dependabot in #2358
Full Changelog: v6.14.1...v6.14.2
6.14.1
Quick turnaround for an issue in 6.14.0.
If you are effected by this you can work around it using --no-cache
until you can update.
What's Changed
- 🩹 fix(@roots/entrypoints-webpack-plugin): stale caching by @kellymears in #2363
6.14.0
Top-level await, lazy compilation of async modules, CLI improvements, performance enhancements, and more.
🚨 Potentially breaking changes
- deprecated:
@roots/merged-manifest-webpack-plugin
- deprecated:
@roots/bud-wordpress-manifests
bud.console
: removed. old methods consolidated withbud.dashboard
.bud.context.files
: interface has changed. Themodule
property for each value inbud.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 totailwind.config.js
now result in rebuild oftheme.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 callingbud.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 towp-*
enqueue handles andwp.*
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
- 🩹 fix: bud upgrade by @kellymears in #2323
- ✨ improve: bud error handling by @kellymears in #2326
- ✨ improve: error handling by @kellymears in #2327
- ✨ improve: dashboard by @kellymears in #2329
- 📦 deps(deps): bump @types/eslint from 8.40.1 to 8.40.2 by @dependabot in #2318
- 📦 deps(deps): bump @swc/plugin-emotion from 2.5.51 to 2.5.68 by @dependabot in #2320
- 📦 deps(deps): bump @swc/core from 1.3.42 to 1.3.66 by @dependabot in #2333
- 📦 deps(deps): bump semver from 7.5.1 to 7.5.3 by @dependabot in #2337
- 📦 deps(deps-dev): bump @aws-sdk/client-s3 from 3.348.0 to 3.357.0 by @dependabot in #2334
- ✨ improve: config module handling by @kellymears in #2336
- 📦 deps: upgrade packages by @kellymears in #2342
- 🧹 cleanup: streamline lifecycle/cli init by @kellymears in #2347
- 🧪 test: cli flags by @kellymears in #2348
- 📕 docs: update readme by @kellymears in #2354
- 🩹 fix: config.after by @kellymears in #2359
- 🧪 test: improve integration by @kellymears in #2361
- 🗂️ typings: @roots/bud/instance by @kellymears in #2360
6.13.1
A feature rich (and mostly backwards compatible) set of improvements and fixes for bud.js.
⚠️ Potentially breaking changes
single
runtimeChunk now enabled by default.- @roots/bud-eslint: warnings are not treated as errors by default.
- @roots/bud-eslint: errors will cause files to not emit in production.
- @roots/bud-stylelint: warnings are not treated as errors by default.
- @roots/bud-stylelint: errors will not emit in production.
- @roots/wordpress-theme-json-webpack-plugin: exported type
Theme
renamed toSchema
. - @roots/bud-terser: is replaced by @roots/bud-minify.
- you do not need to include this in your project; it is a transitive dependency of @roots/bud.
- bud.terser deprecated in favor of bud.minify.js
- bud.minimizeCss deprecated in favor of bud.minify.css
Core features
Enhanced support for tsconfig.json
You can now configure @src
, @dist
, compilation paths and aliases directly in tsconfig.json
. Also works with jsconfig.json
. This is nice for compatibility with the typescript compiler.
This feature is opt-in for now but will likely become a default in bud v7. To opt in set bud.useCompilerOptions
to true
in the config.
tsconfig key | value |
---|---|
compilerOptions.baseUrl |
Set @src directory |
compilerOptions.outDir |
Set @dist directory |
compilerOptions.paths |
Set bud path handles and aliases |
include |
Directories containing modules which should be treated as source. Same as calling bud.compilePaths |
Example annotated tsconfig.json
{
"extends": ["@roots/bud/config/tsconfig.json"],
"compilerOptions": {
/**
* Source directory
*
* @remarks
* This is the same as calling `bud.setPath(`@src`, `sources`)
*/
"baseUrl": “sources",
/**
* Output directory
*
* @remarks
* This is the same as calling `bud.setPath(`@dist`, `build`)
*/
"outDir": “build",
/**
* Path aliases
*
* @remarks
* This is the same as calling `bud.setPath()` and `bud.alias()`
* Only the first path in each value will be used.
*/
"paths": {
"@fonts": ["fonts"],
"@images": ["images"],
"@scripts": ["scripts"],
"@styles": ["styles"]
},
/**
* Include type definitions
*/
"types": [
"@roots/bud",
"@roots/bud-react",
"@roots/bud-postcss",
"webpack/module" // defines import.meta.webpackHot
]
},
/**
* Configuration files
*/
"files": ["bud.config.ts"],
/**
* Compiler paths
*
* @remarks
* This is the same as calling bud.compilePaths()
*/
"include": ["resources"],
/**
* Allow bud to reference tsconfig/jsconfig values
*/
"bud": {
"useCompilerOptions": true
}
}
TSC compatible module imports
With the TypeScript Compiler you can ensure your outputted code is compliant with esmodules by mapping extensions in your import statements. For example, if you want to import a module from ./some-module.ts
, you would likely want to import it like this:
import someModule from './some-module.js'
bud.js works the same way now, in practice. Now, if you want to write your import statements in a way that is compliant with TSC, you can.
bud.setPath
now automatically sets aliased paths
If you set a path handle with bud.setPath
it now sets up a path alias as well.
JSON schema available
JSON schema available at https://bud.js.org/bud.package.json
. You can optionally add it to package.json
for validation of package.json
fields (including bud specific ones):
{
"$schema": "https://bud.js.org/bud.package.json"
}
Improved extension options API
Every registered extension option now has a dedicated getter and setter. The getter prefixes the option key with get
and the setter prefixes it with set
.
Option | Getter | Setter |
---|---|---|
bud.extension.optionName | bud.extension.getOptionName() | bud.extension.setOptionName(value) |
Lastly, know that the setOptionName
always accepts a callback:
bud.extension.setOptionName(value => value)
Example
Let's say @roots/bud-eslint
has a new option defined (since it does):
lintDirtyModulesOnly: EslintPluginOptions['lintDirtyModulesOnly']
Previously you could get this value like so:
bud.eslint.get(`lintDirtyModulesOnly`)
That still works, but now you have some additional options:
/** Get the value via a property */
bud.eslint.lintDirtyModulesOnly
/** Get the value via a function */
bud.eslint.getLintDirtyModulesOnly()
Similarly, in addition to bud.eslint.set
:
bud.eslint.set(`lintDirtyModulesOnly`, true)
You can now set it with a dedicated setter method:
bud.eslint.setLintDirtyModulesOnly(true)
All such setter methods accept a callback:
bud.eslint.setLintDirtyModulesOnly(value => !value)
@roots/bud-postcss
- The postcss configuration API has gotten a rework.
Refer to the updated documentation for more information.
@roots/bud-eslint
- New options and methods exposed by
bud.eslint
- Configure eslint in your bud config
Refer to the updated documentation for more information.
@roots/bud-sass
- New options and methods exposed by
bud.sass
Refer to the updated documentation for more information.
@roots/bud-stylelint
- New options and methods exposed by
bud.stylelint
- Configure stylelint in your bud config
Refer to the updated documentation for more information.
@roots/bud-swc
- New options and methods exposed by
bud.swc
- Override base configuration for js and ts separately
Refer to the updated documentation for more information.
@roots/bud-tailwindcss
- New options and methods exposed by
bud.tailwind
- Supports configuring tailwindcss directly in bud config
Refer to the updated documentation for more information.
@roots/bud-wordpress-theme-json
- New options and methods exposed by
bud.wpjson
Other changes
experiments.backCompat
now set tofalse
. bud doesn't need backwards compatibility with webpack 4 and the compatibility fixes come with performance penalties related toArray
objects.snapshot.buildDependencies
uses a hash ifbud.env.get('CI')
istrue
; uses a timestamp otherwise.snapshot.module
uses a hash ifbud.env.get('CI')
istrue
; uses a timestamp otherwise.snapshot.resolve
uses a hash ifbud.env.get('CI')
istrue
; uses a timestamp otherwise.snapshot.resolveBuildDependencies
uses a hash ifbud.env.get('CI')
istrue
; uses a timestamp otherwise.resolveLoader.alias
defined for all registered loaders.resolve.unsafeCache
set toundefined
(wasfalse
). default behavior is forunsafeCache
to be used in development, and not used in production.profile
now set totrue
if--debug
flag istrue
.performance
now set tofalse
(was{hints: false}
).externalsType
set toundefined
(wasvar
).bud.context.logger
is removed.APP_TITLE
fallback set for projects which usebud.html
.NO_SCRIPT
fallback set for projects which usebud.html
.- Typings for WordPress
theme.json
updated using current schema. - Build script now in place to help with future updates to WordPress
theme.json
. - Default css minimizer is now lightningcss (css parser used by parcel).
- If using
@roots/bud-swc
css minification is handled by swc. - If using
@roots/bud-esbuild
css minification is handled by esbuild. - New documentation for bud.minify.
6.12.3
Bugfixes and bumped dependencies
Improvements
#2243 improves compatibility with pnpm
This change finishes work started in 6.12.2 make it less necessary to use the bud.js .pnpmfile.cjs compatibility shim.
You should also now be able to limit hoisting to @roots
packages, if desired:
pnpm install --public-hoist-pattern="@roots/*"
When only hoisting @roots/*
packages you will need to make sure your app dependencies are explicitly defined. Rule of thumb: if you import it in your app you will need to have it installed in your project.
The alternative is to hoist everything (same behavior as npm and yarn):
pnpm install --public-hoist-pattern="*"
Fixes
- Fixes module resolution cache validation when swapping package managers.
- Fixes issue with eslint not outputting to stdout/stderr in some configurations.