Releases: roots/bud
v6.7.2
Bugfixes and improvements
- 🩹 fix(@roots/bud): multiple browser tabs opening in dev mode #2045
- 🩹 fix(@roots/bud): CLI healthcheck complains when version is "latest" #2046
- ✨ improve(@roots/bud-typescript): improved typechecker #2038
- ✨ improve(@roots/bud): more performant rule ordering #2043
v6.7.0
A healthy mix of features and fixes.
⚠️ Possible breaking change
There are changes to the API of @roots/bud-imagemin to be aware of if you are using that extension and have customized generators or minimizers.
✨ feat(@roots/sage): process blade templates with @roots/blade-loader #2035
This is a cool feature.
Makes it possible to write client code in blade files. This is different than existing solutions because the code is parsed with other loaders (you can write postcss, sass, typescript, etc.)
Supports: js, ts, css, scss, vue.
Code is specified using @js
/@endjs
syntax (with whatever extension).
Example:
index.blade.php
:
@include('sections.header')
<main id="main" class="main">
@yield('content')
</main>
<img src=@asset('images/404.png?as=webp') />
<img src=@asset('images/404.png?as=webp&width=200') />
@hasSection('sidebar')
<aside class="sidebar">
@yield('sidebar')
</aside>
@endif
@include('sections.footer')
@js
import {render} from '@scripts/render'
render(
<h1>Hello, world!</h1>,
document.getElementById('target-el')
);
@endjs
@css
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
body {
@apply bg-blue-500;
}
@endcss
bud.config.js
:
bud.entry({
index: ['views/index']
})
Included in this PR (sources/@roots/blade-loader/vendor
) are directives that can be used to stop src from rendering (uses ob_start
and ob_end_clean
).
I imagine there will be first-party support added to Sage in the near future. For now, you could try out this feature using blade comments:
{{--
@js
console.log('not visible')
@endjs
--}}
If you use @roots/bud-imagemin you can now do image manipulation on-the-fly in blade templates:
<div class="test">
<img src=@asset('images/foo.png?as=webp&width=100&height=100') alt="foo image" />
</div>
WordPress dependencies which are imported are not included in entrypoints.json
. It's unclear as of yet why. Workaround is to do the imports from a legitimate js module and then import that from the blade file:
@js
import {render} from '@scripts/render'
render(...)
@endjs
// @scripts/render.js
import React from 'react'
import {render} from 'react-dom'
export {React, render}
🩹 fix(@roots/wordpress-hmr): duplicative block registrations #2023
Fixes issues in some setups where blocks would be registered more than once.
🩹 fix(cli): --cwd flag #2008
Fixes two related issues which caused the --cwd
/--basedir
flag to not work properly
📦 deps: bump node to v18 lts #1962
node.js has updated LTS version and so have we. It's fine to use Node 16 in your project for now, but you should upgrade sooner rather than later.
It's tentative but we'll likely drop support for older versions of Node in bud v7 (mainly so we can use the new built-in fetch). Previously we were blocked on this due to an issue in GoogleChromeLabs/squoosh but merging #2012 has gotten us back on track.
📦 deps(@roots/bud-imagemin): use sharp instead of squoosh #2012
squoosh was abandoned by google. we're using sharp internally now. See the PR for details. API changes are documented on bud.js.org.
✨ improve(@roots/bud-build): allow adding raw webpack rules #2010
Please don't do this in an extension you plan on distributing.
Do you just want to add a rule in your project config and don't need to worry about ecosystem compatibility? You can now add rules with standard webpack syntax. Example below but the loaders guide on bud.js.org has been updated to cover this in more detail:
bud.hooks.on(`build.module.rules.oneOf`, (rules = []) => {
rules.push({
test: /\.example$/,
use: [
{
loader: `babel-loader`,
options: {
presets: [`@babel/preset-env`],
},
},
],
})
return rules
})
🩹 fix: ensure process exit code is set on compilation error #1985
Fixes #1986.
Reproduction incorporated into testing suite to prevent future regressions.
v6.6.10
🔧 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
v6.6.8
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
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 withmini-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 invokingbud doctor
.
✨🩹 improve/fix: CLI flags #1967
- add:
bund
command (execute with bun binary) - improve: alternative binaries (
ts-bud
andbund
) 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
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
A bugfix release for bud v6.6.x.
🩹 fix: wordpress@6.?.? enqueues react-refresh on its own #1913
⚠️ breakingreact-refresh is no longer enqueued automatically. wordpress seems to be enqueuing it now; I'm guessing when
WP_ENV
isdevelopment
.bud.react.refresh.enable()
needs to be called in your config if you want to addreact-refresh
to entrypoints (but you'll wind up with two instances ofreact-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
withstring
values. - 📕 docs: update bud.provide documentation
- 🧪 test: add unit tests for
string
andarray
values
v6.6.3
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
A bugfix release for bud v6.6.x.
🩹 @roots/bud-imagemin — webp preset not working as intended #1886
- 🩹 fix #1888
- 🧪 improve unit test sources/@roots/bud-imagemin/src/extension.test.ts
- 🧪 add reproduction tests/reproductions/issue-1886.test.ts
- 📕 improve @roots/bud-imagemin docs
- 📕 add bud.imagemin.encode docs
- 📕 add bud.imagemin.configure docs
🩹 bud.entry — import syntax breaks with Bud 6.6.x #1890
- 🩹 fix #1891
- 🧪 add reproduction tests/reproductions/issue-1890.test.ts
- 🧪 improve unit test sources/@roots/bud-api/src/methods/entry/index.test.ts
ℹ️ Release information
For more information review the diff to see what's changed.