Bud v5.2.0 released

Bud v5.2.0 has been released

A big change for dependency management with a couple very important bug fixes.

Deprecations

setPublicPath (when using @roots/sage)

bud.setPublicPath is deprecated when using the @roots/sage preset.

Setting the public path in roots/sage will break builds now that it is no longer needed (it’ll end up doubling up URLs in Acorn). We know that’s annoying so @roots/sage (the extension) overrides setPublicPath with a function that intentionally lets the passed value fall through.

The function is flagged as @deprecated and will be marked as such in most modern IDEs. You should remove it from your config before roots/sage leaves beta.

See improve(server) proxy middleware (#1008)

Directly installing dependencies is optional

In Bud v5.0.0 and v5.1.0 it became very clear that the framework’s way of handling dependency management was not working anywhere near as well as we had hoped it would. I’d estimate over half of the problems brought up had to do with mismatched dependencies.

The bud install command was meant to make it easy. I wouldn’t say it made it harder, but it definitely didn’t make it easy.

For v5.2.0 we’re doing something really different and much more in keeping with other tools that work similarly to bud (nextjs, create-react-app, etc). We’re going to include the batteries.

This means users do not need to specify anything in package.json outside of the extension they want to use. So, if you want to try @roots/bud-sass you just install the extension. No need to run bud install or manually add sass. It should already be at the top level of node_modules, a proper peer to your project, ready to be resolved.

Compare the roots/sage manifest from 5.1.0:

"devDependencies": {
    "@babel/eslint-parser": "^7.16.5",
    "@roots/bud": "^5.1.0",
    "@roots/bud-eslint": "^5.1.0",
    "@roots/bud-postcss": "^5.1.0",
    "@roots/bud-prettier": "^5.1.0",
    "@roots/bud-stylelint": "^5.1.0",
    "@roots/bud-tailwindcss": "^5.1.0",
    "@roots/sage": "^5.1.0",
    "@wordpress/browserslist-config": "4.1.0",
    "eslint": "8.6.0",
    "postcss": "8.4.5",
    "postcss-import": "14.0.2",
    "postcss-nested": "5.0.6",
    "postcss-preset-env": "7.1.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "tailwindcss": "3.0.8",
    "prettier": "2.5.1"
}

to the one for 5.2.0:

"devDependencies": {
  "@roots/bud": "5.2.0",
  "@roots/bud-eslint": "5.2.0",
  "@roots/bud-postcss": "5.2.0",
  "@roots/bud-prettier": "5.2.0",
  "@roots/bud-stylelint": "5.2.0",
  "@roots/bud-tailwindcss": "52.0",
  "@roots/sage": "5.2.0"
}

It seems like it’s going to be a lot more manageable. For bud users and maintainers.

Users can still override the installed version of any dependency by installing it themselves. Bud has also relaxed its verison requirements to be much more tolerant of discrepencies.

See improve(bud) dependency strategy (#1005)

Easier stylelint configs

When relevant, all extensions now come with a stylelint export for you to use as a starting point.

Here’s a config that works well with tailwindcss:

{
  "extends": [
    "@roots/bud-stylelint/config",
    "@roots/bud-tailwindcss/stylelint-config"
  ]
}

And if a user wants to try tailwindcss in a sass stylesheet, they no longer need to figure out how to do that themselves.

{
  "extends": [
    "@roots/sage/stylelint-config",
    "@roots/bud-tailwindcss/stylelint-config",
    "@roots/bud-sass/stylelint-config"
  ]
}

This release should be able to close the door on issues like [#731] CSS lint errors for SCSS stylesheet files (e.g. Unknown word; …)

Here’s the list of modules:

extension export
@roots/bud-stylelint '@roots/bud-stylelint/config'
@roots/bud-tailwindcss '@roots/bud-tailwindcss/stylelint-config'
@roots/bud-sass '@roots/bud-sass/stylelint-config'
@roots/sage '@roots/sage/stylelint-config'

Easier eslint configs

There are a number of configs available to use in your eslint config as a base:

module.exports = {
  root: true,
  extends: [
    require.resolve('@roots/sage/eslint-config'),
    require.resolve('@roots/bud-prettier/eslint-config'),
  ],
}

Here’s the list of modules:

extension export
@roots/bud-eslint '@roots/bud-eslint/eslint-config'
@roots/bud-babel '@roots/bud-babel/eslint-config'
@roots/bud-preset-wordpress '@roots/bud-preset-wordpress/eslint-config'
@roots/bud-preset-recommend '@roots/bud-preset-recommend/eslint-config'
@roots/bud-prettier '@roots/bud-prettier/eslint-config'
@roots/bud-react '@roots/bud-react/eslint-config'
@roots/sage '@roots/sage/eslint-config'

Fixes and improvements

  • Setting a publicPath no longer needed for proxy :tada:
  • Fixes INVALID_URL error message emitted by HPM logger
  • bud.use was not configured behind a facade. It is now a synchronous interface over an asynchronous function (like the rest of the async fns in @roots/bud-api). This was obviously causing issues (see The dev server doesn't start when using a plugin · Issue #1003 · roots/bud · GitHub). A unit test has been added to make sure it returns Framework and not Promise<Framework>
  • bud.splitChunks now breaks all of the “dev boilerplate” (think: hot reload scripts, core-js polyfills, webpack client code, ansi parsers, bud’s client scripts, etc.) into a separate chunkGroup: vendor/bud.js. This cleanly separates vendor code (being used by the app), “bud” code, and the application code. This doesn’t effect production at all since none of the packages in the bud chunk group are used outside of dev.
  • Fixes bud.watch.

Changelog

Compare: Comparing v5.1.0...v5.2.0 · roots/bud · GitHub

Contributors

Thanks to everyone who contributed to this release!

4 Likes

:tada:

Upgrade path for Sage users that were on v5.1.0 or earlier: Bud v5.2.0 by retlehs · Pull Request #2959 · roots/sage · GitHub

1 Like