Uh oh!
There was an error while loading. Please reload this page.
Remove gulp - #2432
Merged
Merged
Conversation
Removes the last of the gulp toolchain: 280 lines across 5 tasks, and 8
packages (gulp, gulp-postcss, gulp-rename, gulp-run, gulp-sass, gulp-svgmin,
through2, tiny-glob), which takes 199 packages out of the tree.
Each task moves to a script in `scripts/`, matching the `.mjs` convention
`.style-dictionary/build.mjs` already set:
- `buildJS` and `buildTypes` were already plain Rollup API, so they only
needed converting to ESM. They share the virtual root entry via
`rollup-root-entry.mjs`.
- `buildSass` calls sass and postcss directly, matching what gulp-sass and
gulp-postcss were doing: compile, run `postcss.config.js`, write
`standalone.css`, then minify that with cssnano.
- `buildTokens` was a 5-line wrapper shelling out to `preprocess:tokens`, so
it is simply gone; the watcher runs the token build directly.
- `watchPreprocess` uses `node:fs.watch` with `recursive: true` rather than
taking on a watcher dependency. It was the only thing in the build needing
one.
`tiny-glob` is replaced by `node:fs.glob`, which finds the same 63 files. The
results are now sorted explicitly: the entry file is built by joining those
paths, so the published bundle and type declarations were quietly depending
on one glob library's traversal order. Sorting reproduces the previous order
exactly.
All of `dist` is byte-identical, as are the generated token files.
The SVG task is the exception. `gulp-svgmin` pins SVGO 2, so taking svgo as a
direct dependency means SVGO 4 -- and SVGO 4 rejects the `.svgo.yml` plugin
format outright rather than warning, so the config fix and the upgrade cannot
be separated. `.svgo.yml` now uses the current format, which has three
consequences:
- `removeXMLNS` finally applies. It has been silently dropped for years,
because it is not a `preset-default` plugin and the old format could only
express preset overrides. These partials are only `{% include %}`d into
HTML, where the namespace is implied.
- `removeViewBox: false` is no longer needed. SVGO 4 dropped that plugin from
`preset-default`, so viewBox is preserved by default -- which is what this
config already asked for, and what #2422 restored in the minified CSS.
- Coordinates round slightly differently. Rendered and compared pixel for
pixel, 55 of the 72 partials are unchanged, and the largest difference in
the rest is 0.53% of pixels at the edges of curves.
Verified with a headless sweep: all 337 entries (249 stories, 82 docs) render
with content and zero page errors.🦋 Changeset detectedLatest commit: f0a0ff8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for cloudfour-patterns ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
7 tasks
Uh oh!
There was an error while loading. Please reload this page.
Merged
This was referenced Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This is item 6 of #2391, and the last of the sequence. Gulp goes away: 280 lines across five tasks, eight packages, and 199 packages out of the dependency tree. Each task becomes a plain script in
scripts/, matching the.mjsconvention.style-dictionary/build.mjsalready set. Two of the five were already plain Rollup API and only needed converting to ESM, one was a five-line wrapper that shelled out to an npm script and is simply deleted, and the watcher usesnode:fs.watchrather than taking on a watcher dependency — it was the only thing in the build that needed one.The one part that is not a like-for-like port is the SVG task, and the coupling is worth knowing before reviewing it.
gulp-svgminpins SVGO 2, so takingsvgoas a direct dependency means SVGO 4 — and SVGO 4 rejects the.svgo.ymlplugin format outright where SVGO 2 only warned. Fixing that config and removing gulp are therefore the same change; the only way to avoid it would be depending on an end-of-life major directly. Once the config is in the current format,removeXMLNSstarts applying for the first time. It has been silently dropped for years, because it is not apreset-defaultplugin and the old format could only express preset overrides. These partials are only ever{% include %}d into HTML, where the namespace is implied, so that was always the intent.Everything in
distis byte-identical, verified after each task rather than only at the end, as are the generated token files. The 72 templatized SVG partials do change — they losexmlnsand pick up small coordinate rounding from the newer SVGO — and they are published, so there is a patch changeset. Rendered and compared pixel for pixel, 55 of the 72 are unchanged and the largest difference in the rest is 0.53% of pixels at the edges of curves.One thing fixed in passing: the Rollup entry is built by joining globbed paths, so the published bundle and type declarations were quietly depending on
tiny-glob's traversal order.node:fs.globfinds the same files but returns them reversed. Sorting explicitly reproduces the previous order exactly and removes the dependency on undocumented behaviour.Screenshots
Testing
Nothing here should look any different. The SVG partials are the only output that changed, so the checks worth doing are on the things that render them.
The build scripts themselves, locally. These replace tasks that CI does exercise, except for the watcher, which nothing covers:
npm start. Storybook should come up as usual.src/assetsending in.svg, make a trivial edit such as adding a space, and save. The terminal should report that it templatized 72 SVG files.src/tokens, save it without changes, and confirm the terminal reports the design token files being rebuilt.npm run build. It should complete without errors, andgit statusshould show no changes to anything indist.