Repository navigation
refactor(bundler): separate the client queries from the client and server targets, remove the SWC clientBrowserslistQueries param (AI-assisted) - #12778
Conversation
…es, remove the SWC `clientBrowserslistQueries` param (AI-assisted)
- getTargets({isServer, bundlerName}) returns getServerTargets() or
getClientTargets()
- getBrowserslistQueries() is renamed getClientTargets()
- getServerBrowserslistQueries() is renamed getServerTargets() and moves
next to it, to avoid a circular import with swc.ts
- getSwcLoaderOptions() reads the targets itself: the
clientBrowserslistQueries param was a leftover from when the SWC options
lived in @docusaurus/faster (#12604)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
…s (AI-assisted) - getClientQueries() returns the Browserslist queries - getClientTargets() returns the browsers they match - SWC keeps receiving the client queries: Rspack resolves them with its own Browserslist data - getTargets() moves to the cache eviction PR, its only user Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
getTargets() for the client and server bundles, remove the SWC clientBrowserslistQueries param (AI-assisted)clientBrowserslistQueries param (AI-assisted)
Motivation
getSwcLoaderOptions()received the client Browserslist queries as aclientBrowserslistQueriesparam, but computed the server targets itself. The param is a leftover from when the SWC options lived in@docusaurus/faster, which didn't own the Browserslist config (#12604). They now live in@docusaurus/bundlernext to it.This refactor also separates the client queries from the targets, for the stacked cache eviction PR #12774:
getBrowserslistQueries()is renamedgetClientQueries(), including its@docusaurus/bundlerexport added by fix(core): evict the bundler persistent cache when the Browserslist queries change (AI-assisted) #12727, which no release contains yet.getClientTargets(): the browsers that the client queries match. The Webpack Lightning CSS minimizer uses it.getServerBrowserslistQueries()is renamedgetServerTargets(): these targets aren't Browserslist queries, and Browserslist doesn't know all the Node.js patch releases they can contain. It moves fromswc.tstobrowserslist.tswith its helpers.getSwcLoaderOptions()reads the targets itself, without the param. SWC keeps receiving the client queries, not the resolved targets: Rspack resolves them with its own Browserslist data. Browserslist caches its config lookups, so reading the client queries for each loader costs nothing.No behavior change.
Test Plan
Existing tests. The SWC and Lightning CSS options are the same as before:
['baseline widely available']for the client and['node 26.0.0']for the server (Rspack).Test links
Deploy preview: https://deploy-preview-12778--docusaurus-2.netlify.app/
Related issues/PRs
future.faster.lightningCssMinimizer(AI-assisted) #12604🤖 Generated with Claude Code
Summary by CodeRabbit