Skip to content

Sass deprecation probe: compile through sass-embedded's async API - #2897

Merged
chalin merged 2 commits into
docsy:mainfrom
chalin:chalin-m24-sass-test-async-2026-1027
Oct 28, 2026
Merged

chalin merged 2 commits into
docsy:mainfrom
chalin:chalin-m24-sass-test-async-2026-1027

Conversation

@chalin

@chalin chalin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

- The package's own guidance for sass-embedded: the sync API emulates blocking over a worker and is slower; that emulation corrupts large outputs under Node 24.22 on Linux (sass/embedded-host-node#451), which blocked the Node bump
- Same warning and loaded-file counts per fixture as before; a deprecated construct planted in a theme partial still fails the test
@chalin chalin added this to the 0.19.0 milestone Oct 28, 2026
@chalin
chalin requested a review from a team October 28, 2026 00:52
@netlify

netlify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for docsydocs ready!

Name Link
🔨 Latest commit 9cee275
🔍 Latest deploy log https://app.netlify.com/projects/docsydocs/deploys/6ae14f546f42fbcb719a353c
😎 Deploy Preview https://deploy-preview-2897--docsydocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@chalin

chalin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

Why the async API, with evidence

  • Sass's own guidance is package-specific. The compile() docstring, in the installed sass-embedded typings and verbatim on sass-lang.com: "When using the sass-embedded npm package for single compilations, compileAsync is almost always faster than compile, due to the overhead of emulating synchronous messaging with worker threads and concurrent compilations being blocked on main thread." The mirror note on compileAsync(): for the pure-JS sass package, "compile is almost twice as fast as compileAsync".
  • The emulation is what broke. sass/embedded-host-node#451 and sass/sync-child-process#37: since Node 24.22.0, the sync API's message stream gets corrupted (Invalid protobuf: illegal tag …) when many small messages arrive, which this probe's ~370 verbose warnings per compile do; the async API is unaffected. Since stream: reduce allocations in StreamBase reads and writes nodejs/node#64455 stream chunks are views over a shared slab, and the sync path's Buffer.from(message.data.buffer) takes the whole slab. Fixed in sync-child-process 1.1.1 (sass/sync-child-process#38, 2026-10-26), which this repo's 7-day cooldown admits from 2026-11-02.
  • Reproduced. Update all minor versions #2871 (Node 24.22.1 among other bumps) failed this test on ubuntu twice; the bisect CI bisect: Node 24.22.1 alone (do not merge) #2896 (Node 24.22.1 alone) failed it the same way (run 40608285680); Windows passed every time; a reviewer reproduced it on macOS arm64 under Node 24.22.0 (sync red 6/6, async green 6/6). Consuming sites are unaffected: Hugo's Sass pipeline talks to the Dart Sass binary itself, and the node_modules/.bin/sass launcher that npm-based sites hand Hugo only spawns that binary with inherited stdio, never reading the protocol stream.
  • Equivalence. Per-fixture diagnostics identical to the sync baseline: default/dark-off/fonts-on 370 warnings, 141 loaded files; maximal 378, 151; a reviewer also compared the full warning streams, loadedUrls and CSS bytes: identical. Locally 1.9 s → 1.5 s.
  • The guard still bites. A darken(#f00, 10%) appended to a copied theme partial fails the test through the async API (global-builtin and color-functions in every fixture).

- Moves the rationale off the helper's contract comment to the line a revert would touch
- Drops the platform and present-tense claims: the corruption reproduces on macOS too and ends with the sync-child-process 1.1.1 refresh (r2.1, r2.2)
@chalin
chalin merged commit 24c87f5 into docsy:main Oct 28, 2026
14 checks passed
@chalin
chalin deleted the chalin-m24-sass-test-async-2026-1027 branch October 28, 2026 11:27
@chalin chalin modified the milestones: 0.19.0, 0.18.1 Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant