Skip to content

fix: await child compilation snapshots - #1896

Open
OskarEichler wants to merge 1 commit into
jantimon:mainfrom
OskarEichler:codex/html-webpack-plugin-snapshot
Open

fix: await child compilation snapshots#1896
OskarEichler wants to merge 1 commit into
jantimon:mainfrom
OskarEichler:codex/html-webpack-plugin-snapshot

Conversation

@OskarEichler

Copy link
Copy Markdown

What does this change?

Return snapshot creation through the existing child-compilation promise chain instead of launching it as detached work.

A delayed snapshot can currently outlive the child compilation and allow optimization to continue before the cache snapshot is ready. Snapshot failures also have no consumer and surface as unhandled rejections. Awaiting the snapshot keeps the cached state ordered with the compilation that produced it and propagates failures through Webpack’s existing async hooks.

How was it tested?

  • Added a caching regression that delays only the child-compilation snapshot and verifies optimization waits for it. The test fails on unchanged 5.6.8 and passes with this fix.
  • Full Jest suite: 162/162 passed.
  • ESLint, Prettier, and cspell passed.
  • node --check and git diff --check passed.
  • Repository tsc still reports its pre-existing index.js Set<never> / ES target error; the same error reproduces on clean main at cf9c701.

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