From 77f2bffc20baa7cc03ffcadf5ccc2d120fe9d965 Mon Sep 17 00:00:00 2001 From: Liam Horne Date: Wed, 14 Oct 2026 10:07:59 -0700 Subject: [PATCH] chore(deps): upgrade Zyzz to 0.0.33 and drop the local patch Zyzz 0.0.28 through 0.0.33 ship the build fixes this repo patched into 0.0.27: reused import resolutions, cached contract and catalog reads, memoized exclusion and source-root checks, a Rust compiler with byte-identical output, empty module sheets omitted from builds, `exclude` support, and HMR for server-rendered stylesheet links. 0.0.33 links its Linux glibc addons against glibc 2.17. The 0.0.32 addon needed glibc 2.35 and failed to load on Vercel's build image (glibc 2.34). macOS and arm64 now load native addons instead of the WebAssembly fallback. - Remove patches/zyzz@0.0.27.patch. - Write `exclude` entries as globs, which upstream `exclude` matches. - Remove the plugin-rsc reference-scan wrapper. Since 0.0.32 it saves no measurable time, and it depends on plugin-rsc internals. - Exempt only zyzz@0.0.33 from minimumReleaseAge. It was published on 2026-10-15 with npm provenance from wevm/zyzz's main.yml at 306150dc. Co-Authored-By: Liam Horne <1933029+snario@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- package.json | 2 +- patches/zyzz@0.0.27.patch | 448 ------------------------------ pnpm-lock.yaml | 62 +++-- pnpm-workspace.yaml | 3 +- scripts/zyzz-build.ts | 22 -- src/test/zyzz-integration.test.ts | 6 +- vite.config.ts | 35 ++- 7 files changed, 67 insertions(+), 511 deletions(-) delete mode 100644 patches/zyzz@0.0.27.patch delete mode 100644 scripts/zyzz-build.ts diff --git a/package.json b/package.json index dce0fbe2d..05fbc8617 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "waku": "1.0.0-rc.3", "webauthx": "~0.1.2", "zod": "^4.4.3", - "zyzz": "0.0.27" + "zyzz": "0.0.33" }, "devDependencies": { "@biomejs/biome": "^2.5.1", diff --git a/patches/zyzz@0.0.27.patch b/patches/zyzz@0.0.27.patch deleted file mode 100644 index 03bad5feb..000000000 --- a/patches/zyzz@0.0.27.patch +++ /dev/null @@ -1,448 +0,0 @@ -diff --git a/dist/compiler/Graph.js b/dist/compiler/Graph.js -index 60cd88b028580e9733e494d8be4892a9d1a9d282..57b18e38417bf67c550184c194f31f1d5d0af8d5 100644 ---- a/dist/compiler/Graph.js -+++ b/dist/compiler/Graph.js -@@ -38,6 +38,23 @@ export function create() { - }, - }); - } -+// Extraction reuse keeps contribution and theme objects stable across compiles. -+const contributionStyles = new WeakMap(); -+function contributionCss(contribution, themes) { -+ const names = Object.keys(themes); -+ const cached = contributionStyles.get(contribution); -+ if (cached && -+ cached.names.length === names.length && -+ cached.names.every((name, index) => name === names[index] && cached.themes[name] === themes[name])) -+ return cached.css; -+ const css = Css.compile({ -+ styles: { styles: [] }, -+ vars: themes, -+ contributions: [contribution], -+ }).contributionCss ?? ''; -+ contributionStyles.set(contribution, { css, names, themes }); -+ return css; -+} - function build(options, cache) { - if (!!cache?.native !== !!options.native || - cache?.native?.[Edits.runtime] !== options.native?.[Edits.runtime] || -@@ -933,11 +950,7 @@ function build(options, cache) { - key: String(index), - css: contribution.kind === 'layers' - ? '' -- : (Css.compile({ -- styles: { styles: [] }, -- vars: sharedThemes, -- contributions: [contribution], -- }).contributionCss ?? ''), -+ : contributionCss(contribution, sharedThemes), - layers: contribution.kind === 'layers' ? [contribution.names] : [], - content: options.modules[id], - start: extractedModule.contributionStarts?.[index] ?? 0, -@@ -1322,6 +1335,7 @@ function build(options, cache) { - ]) - : contributions; - const sharedCss = shared.css; -+ let publishedContracts; - function publishedRules(id, visited = new Set()) { - if (visited.has(id)) - return {}; -@@ -1412,7 +1426,8 @@ function build(options, cache) { - sharedAssetOwners: shared.owners, - } - : {}), -- contracts: Object.freeze(Object.fromEntries((options[Stylesheets.entry] === undefined ? ids : []) -+ get contracts() { -+ return (publishedContracts ??= Object.freeze(Object.fromEntries((options[Stylesheets.entry] === undefined ? ids : []) - .filter((id) => Object.keys(extracted.get(id).themeExports ?? {}).length || - reachable(id).length || - configurations(id).length) -@@ -1426,7 +1441,8 @@ function build(options, cache) { - : undefined, - source: Stylesheets.relative(section.owner ?? id, section.source), - })), id, configurations(id), publishedRules(id)), -- ]))), -+ ])))); -+ }, - dependencies: Object.freeze(dependencies), - modules: Object.freeze(Object.fromEntries(ids.map((id) => [id, modules[id]]))), - }), -diff --git a/dist/vite/index.d.ts b/dist/vite/index.d.ts -index ad5de1ad177684d7c8e7134b862984e3da472d8f..53552aeb5b0b92a5eb5f05c03c31cde793649eed 100644 ---- a/dist/vite/index.d.ts -+++ b/dist/vite/index.d.ts -@@ -14,6 +14,8 @@ export declare namespace zyzz { - readonly compiler?: boolean | undefined; - /** Additional source directories, absolute or relative to the Vite root. */ - readonly include?: readonly string[] | undefined; -+ /** Files or directories excluded from source discovery and compilation. */ -+ readonly exclude?: readonly string[] | undefined; - /** Native context captured at creation. Disables CSS delivery and initialization scripts. */ - readonly native?: Graph.compile.Options['native']; - /** Include the CSS reset. Defaults to false. */ -diff --git a/dist/vite/index.js b/dist/vite/index.js -index 27d151823db83a014703f72d7718a8fe93a70774..ee0d69ca04e19431304c2d85975cb43851a4c17f 100644 ---- a/dist/vite/index.js -+++ b/dist/vite/index.js -@@ -57,6 +57,45 @@ export function zyzz(options = {}) { - const contributionFiles = new WeakMap(); - const assets = new Map(); - const catalogs = new Map(); -+ // Packed contracts are immutable strings shared by every module compile. -+ // Parse each one once instead of once per module and stylesheet. -+ const resolutions = new WeakMap(); -+ function resolver(context) { -+ const environment = context.environment; -+ if (environment.mode !== 'build') -+ return (source, importer) => context.resolve(source, importer); -+ let cache = resolutions.get(environment); -+ if (!cache) { -+ cache = new Map(); -+ resolutions.set(environment, cache); -+ } -+ return (source, importer) => { -+ const key = `${importer}\0${source}`; -+ let result = cache.get(key); -+ if (!result) { -+ result = context.resolve(source, importer); -+ cache.set(key, result); -+ } -+ return result; -+ }; -+ } -+ const parsedContracts = new Map(); -+ function parsed(contract, read) { -+ let value = parsedContracts.get(contract); -+ if (!value) { -+ if (parsedContracts.size > 4096) -+ parsedContracts.clear(); -+ value = { catalogs: undefined, metadata: undefined }; -+ parsedContracts.set(contract, value); -+ } -+ return read(value); -+ } -+ function readCatalogs(contract) { -+ return parsed(contract, (value) => (value.catalogs ??= Catalogs.read(contract))); -+ } -+ function readMetadata(contract) { -+ return parsed(contract, (value) => (value.metadata ??= JSON.parse(contract))); -+ } - const edges = new Map(); - const graphs = new Map(); - const initializers = new WeakMap(); -@@ -65,6 +104,7 @@ export function zyzz(options = {}) { - const lazyImports = new WeakMap(); - let directories; - let root; -+ let devServer; - function snapshot(environment) { - let value = snapshots.get(environment); - if (!value) { -@@ -116,7 +156,28 @@ export function zyzz(options = {}) { - function normalize(id) { - return resource(id) ? id : id.split('?')[0]; - } -+ const exclusions = new Map(); -+ let excludedDirectories; -+ function excluded(id) { -+ const file = normalize(id); -+ let value = exclusions.get(file); -+ if (value === undefined) { -+ excludedDirectories ??= (options.exclude ?? []).map((entry) => Path.resolve(root, entry)); -+ value = excludedDirectories.some((directory) => { -+ const relative = Path.relative(directory, file); -+ return relative === '' || (relative !== '..' && -+ !relative.startsWith(`..${Path.sep}`) && -+ !Path.isAbsolute(relative)); -+ }); -+ exclusions.set(file, value); -+ } -+ return value; -+ } - function eligible(id) { -+ // Source trees may contain documentation fragments that are not modules. -+ if (options.exclude?.length && excluded(id)) -+ return false; -+ - if (sourceEntrypoints.has(normalize(id))) - return true; - // Ids carrying foreign queries are Vite resources such as inline-module proxies, not source. -@@ -127,7 +188,15 @@ export function zyzz(options = {}) { - /\.[cm]?[jt]sx?$/.test(id) && - !/\.(?:d|test|test-d|bench|bench-d)\.[cm]?[jt]sx?$/.test(id)); - } -+ const sourceRoots = new Map(); - function sourceRoot(file) { -+ if (sourceRoots.has(file)) -+ return sourceRoots.get(file); -+ const value = findSourceRoot(file); -+ sourceRoots.set(file, value); -+ return value; -+ } -+ function findSourceRoot(file) { - return directories.find((directory) => { - const relative = Path.relative(directory, file); - return (relative !== '..' && -@@ -528,7 +597,7 @@ export function zyzz(options = {}) { - loaded.add(id); - const metadata = (() => { - try { -- return JSON.parse(contracts[id]); -+ return readMetadata(contracts[id]); - } - catch (error) { - Graph.compile({ modules: {}, contracts: { [id]: contracts[id] } }); -@@ -610,7 +679,9 @@ export function zyzz(options = {}) { - for (const [id, targets] of staged) - edges.set(id, targets); - // Packed dependencies contribute catalogs beside the modules compiled here. -- const compiled = { ...contracts, ...result.contracts }; -+ const compiled = options.script === false -+ ? contracts -+ : { ...contracts, ...result.contracts }; - // A module owns its catalog keys; recompiling it replaces every - // configuration it had, including a module that no longer emits a contract. - for (const id of new Set([ -@@ -622,7 +693,7 @@ export function zyzz(options = {}) { - catalogs.delete(key); - const configurations = new Map(); - for (const [id, contract] of Object.entries(compiled)) -- for (const configuration of Catalogs.read(contract)) { -+ for (const configuration of readCatalogs(contract)) { - const key = `${id}\0${configuration.identity}`; - catalogs.set(key, configuration); - configurations.set(key, configuration); -@@ -911,6 +982,7 @@ export function zyzz(options = {}) { - return { - buildStart() { - reads.delete(this.environment); -+ resolutions.delete(this.environment); - }, - config: { - order: 'post', -@@ -944,6 +1016,7 @@ export function zyzz(options = {}) { - }, - }, - configureServer(server) { -+ devServer = server; - // Directory watches belong to the server, not module import dependencies. - server.watcher.add(directories.slice(1)); - server.middlewares.use((request, response, next) => { -@@ -1036,6 +1109,24 @@ export function zyzz(options = {}) { - await updateDiscovery(this.environment, file, change.event); - }, - async hotUpdate({ file, modules, timestamp, type, server }) { -+ // Client stylesheet modules can be backed by server-only compilations. -+ // Include those modules in the browser's normal CSS HMR invalidation. -+ if (this.environment.name === 'client') { -+ const borrowed = new Set(modules); -+ for (const environment of Object.values(server.environments)) { -+ if (environment.config.consumer !== 'server') continue; -+ for (const entry of states.get(environment)?.values() ?? []) { -+ if (!entry.files.has(file)) continue; -+ for (const id of [cssId(entry.file), `${cssId(entry.file)}?direct`, sharedId, `${sharedId}?direct`]) { -+ const module = this.environment.moduleGraph.getModuleById(id); -+ if (!module) continue; -+ this.environment.moduleGraph.invalidateModule(module, new Set(), timestamp, true); -+ borrowed.add(module); -+ } -+ } -+ } -+ modules = [...borrowed]; -+ } - const state = entries(this.environment); - const previous = [...state.values()].map((entry) => ({ - code: entry.code, -@@ -1113,16 +1204,32 @@ export function zyzz(options = {}) { - const file = id === sharedId - ? undefined - : decodeURIComponent(id.slice(prefix.length, -4)); -- const entry = file === undefined -+ let entry = file === undefined - ? entries(this.environment).values().next().value - : entries(this.environment).get(file); -+ // Browser requests for server-only CSS have no client compilation record. -+ // Find the actual owner without merging per-environment compiler state. -+ if (!entry && this.environment.mode === 'dev' && this.environment.name === 'client' && devServer) { -+ for (const environment of Object.values(devServer.environments)) { -+ if (environment.config.consumer !== 'server') continue; -+ const state = states.get(environment); -+ entry = file === undefined ? state?.values().next().value : state?.get(file); -+ if (entry) break; -+ } -+ } - // A pruned JavaScript module can leave its stylesheet loaded in the browser. - if (!entry && file && removed.get(this.environment)?.has(file)) - return ''; - if (!entry) - throw new Error(`Unknown Zyzz stylesheet: ${file}`); -- const output = await compile(entry, { -- resolve: (source, importer) => this.resolve(source, importer), -+ const owner = entry.environment; -+ // A build compiles each module once; its stylesheet comes from that result. -+ const output = file !== undefined && owner.mode === 'build' && entry.output -+ ? entry.output -+ : await compile(entry, { -+ resolve: (source, importer) => owner.mode === 'dev' -+ ? owner.pluginContainer.resolveId(source, importer) -+ : resolver(this)(source, importer), - watch: (file) => this.addWatchFile(file), - asset: async (file) => { - const reference = this.emitFile({ -@@ -1166,7 +1273,7 @@ export function zyzz(options = {}) { - removed.get(this.environment)?.delete(id); - } - const output = await compile(entry, { -- resolve: (source, importer) => this.resolve(source, importer), -+ resolve: resolver(this), - watch: (file) => this.addWatchFile(file), - asset: async (file) => { - const reference = this.emitFile({ -@@ -1180,6 +1287,8 @@ export function zyzz(options = {}) { - }, code); - entry.imports = JSON.stringify(output.imports[sourceId(entry.file)]); - entry.code = output.code; -+ if (this.environment.mode === 'build') -+ entry.output = output; - if (native) - return { code: output.code, map: JSON.stringify(output.map) }; - // Keep the CSS dependency even when the current graph has no live rules. -@@ -1228,8 +1337,15 @@ export function zyzz(options = {}) { - for (const [index, source] of output.map.sources.entries()) - if (source !== null) - Mapping.setSourceContent(shifted, source, output.map.sourcesContent?.[index] ?? null); -+ // Empty production sheets become dangling references in RSC asset manifests. -+ // Development retains the import so later edits can introduce styles. -+ const stylesheetImport = -+ this.environment.config.command === 'build' && !output.css.trim() -+ ? '' -+ : `\nimport ${JSON.stringify(cssId(id))};`; -+ - return { -- code: `${before}${sharedImport}${output.code.slice(offset)}\nimport ${JSON.stringify(cssId(id))};`, -+ code: `${before}${sharedImport}${output.code.slice(offset)}${stylesheetImport}`, - map: JSON.stringify(Mapping.toEncodedMap(shifted)), - }; - }, -diff --git a/src/vite/index.ts b/src/vite/index.ts -index ab3405777d33a17896f73a71d19e62130c786765..0bee85abcc233f317e39fd1e698dbfd0fe842374 100644 ---- a/src/vite/index.ts -+++ b/src/vite/index.ts -@@ -74,6 +74,7 @@ export function zyzz(options: zyzz.Options = {}): Plugin { - const lazyImports = new WeakMap() - let directories: readonly string[] - let root: string -+ let devServer: ViteDevServer | undefined - - function snapshot(environment: Environment) { - let value = snapshots.get(environment) -@@ -141,6 +142,16 @@ export function zyzz(options: zyzz.Options = {}): Plugin { - } - - function eligible(id: string) { -+ // Source trees may contain documentation fragments that are not modules. -+ if (options.exclude?.some((entry) => { -+ const relative = Path.relative(Path.resolve(root, entry), normalize(id)) -+ return relative === '' || ( -+ relative !== '..' && -+ !relative.startsWith(`..${Path.sep}`) && -+ !Path.isAbsolute(relative) -+ ) -+ })) return false -+ - if (sourceEntrypoints.has(normalize(id))) return true - // Ids carrying foreign queries are Vite resources such as inline-module proxies, not source. - if (resource(id)) return false -@@ -1222,6 +1233,7 @@ export function zyzz(options: zyzz.Options = {}): Plugin { - }, - }, - configureServer(server) { -+ devServer = server - // Directory watches belong to the server, not module import dependencies. - server.watcher.add(directories.slice(1)) - -@@ -1351,6 +1363,24 @@ export function zyzz(options: zyzz.Options = {}): Plugin { - await updateDiscovery(this.environment, file, change.event) - }, - async hotUpdate({ file, modules, timestamp, type, server }) { -+ // Client stylesheet modules can be backed by server-only compilations. -+ // Include those modules in the browser's normal CSS HMR invalidation. -+ if (this.environment.name === 'client') { -+ const borrowed = new Set(modules) -+ for (const environment of Object.values(server.environments)) { -+ if (environment.config.consumer !== 'server') continue -+ for (const entry of states.get(environment)?.values() ?? []) { -+ if (!entry.files.has(file)) continue -+ for (const id of [cssId(entry.file), `${cssId(entry.file)}?direct`, sharedId, `${sharedId}?direct`]) { -+ const module = this.environment.moduleGraph.getModuleById(id) -+ if (!module) continue -+ this.environment.moduleGraph.invalidateModule(module, new Set(), timestamp, true) -+ borrowed.add(module) -+ } -+ } -+ } -+ modules = [...borrowed] -+ } - const state = entries(this.environment) - const previous = [...state.values()].map((entry) => ({ - code: entry.code, -@@ -1454,18 +1484,31 @@ export function zyzz(options: zyzz.Options = {}): Plugin { - id === sharedId - ? undefined - : decodeURIComponent(id.slice(prefix.length, -4)) -- const entry = -+ let entry = - file === undefined - ? entries(this.environment).values().next().value - : entries(this.environment).get(file) -+ // Browser requests for server-only CSS have no client compilation record. -+ // Find the actual owner without merging per-environment compiler state. -+ if (!entry && this.environment.mode === 'dev' && this.environment.name === 'client' && devServer) { -+ for (const environment of Object.values(devServer.environments)) { -+ if (environment.config.consumer !== 'server') continue -+ const state = states.get(environment) -+ entry = file === undefined ? state?.values().next().value : state?.get(file) -+ if (entry) break -+ } -+ } - // A pruned JavaScript module can leave its stylesheet loaded in the browser. - if (!entry && file && removed.get(this.environment)?.has(file)) return '' - if (!entry) throw new Error(`Unknown Zyzz stylesheet: ${file}`) - -+ const owner = entry.environment - const output = await compile( - entry, - { -- resolve: (source, importer) => this.resolve(source, importer), -+ resolve: (source, importer) => owner.mode === 'dev' -+ ? owner.pluginContainer.resolveId(source, importer) -+ : this.resolve(source, importer), - watch: (file) => this.addWatchFile(file), - asset: async (file) => { - const reference = this.emitFile({ -@@ -1605,8 +1648,15 @@ export function zyzz(options: zyzz.Options = {}): Plugin { - output.map.sourcesContent?.[index] ?? null, - ) - -+ // Empty production sheets become dangling references in RSC asset manifests. -+ // Development retains the import so later edits can introduce styles. -+ const stylesheetImport = -+ this.environment.config.command === 'build' && !output.css.trim() -+ ? '' -+ : `\nimport ${JSON.stringify(cssId(id))};` -+ - return { -- code: `${before}${sharedImport}${output.code.slice(offset)}\nimport ${JSON.stringify(cssId(id))};`, -+ code: `${before}${sharedImport}${output.code.slice(offset)}${stylesheetImport}`, - map: JSON.stringify(Mapping.toEncodedMap(shifted)), - } - }, -@@ -1681,6 +1731,8 @@ export declare namespace zyzz { - readonly compiler?: boolean | undefined - /** Additional source directories, absolute or relative to the Vite root. */ - readonly include?: readonly string[] | undefined -+ /** Files or directories excluded from source discovery and compilation. */ -+ readonly exclude?: readonly string[] | undefined - /** Native context captured at creation. Disables CSS delivery and initialization scripts. */ - readonly native?: Graph.compile.Options['native'] - /** Include the CSS reset. Defaults to false. */ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 622008741..e7debb535 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,9 +32,6 @@ patchedDependencies: waku@1.0.0-rc.3: hash: 70493b32a3f116a94b6fda2de8497a754444b81424d033f2280778110a680e79 path: patches/waku@1.0.0-rc.3.patch - zyzz@0.0.27: - hash: f9b9d55fc96495127a5b86b4ae591bec85c1c7f38fb4d70909c1c7e64cb749fb - path: patches/zyzz@0.0.27.patch importers: @@ -170,8 +167,8 @@ importers: specifier: ^4.4.3 version: 4.6.5 zyzz: - specifier: 0.0.27 - version: 0.0.27(patch_hash=f9b9d55fc96495127a5b86b4ae591bec85c1c7f38fb4d70909c1c7e64cb749fb)(@babel/core@7.29.7)(esbuild@0.28.1)(react@19.3.0)(rolldown@1.1.4)(rollup@4.60.1)(vite@8.1.0(@types/node@26.1.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(tsx@4.22.4)(yaml@2.9.0))(webpack@5.104.1(esbuild@0.28.1)) + specifier: 0.0.33 + version: 0.0.33(@babel/core@7.29.7)(esbuild@0.28.1)(react@19.3.0)(rolldown@1.1.4)(rollup@4.60.1)(vite@8.1.0(@types/node@26.1.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(tsx@4.22.4)(yaml@2.9.0))(webpack@5.104.1(esbuild@0.28.1)) devDependencies: '@biomejs/biome': specifier: ^2.5.1 @@ -548,15 +545,24 @@ packages: '@emnapi/core@1.11.2': resolution: {integrity: sha512-TC8MkTuZUtcTSiFeuC0ksCh9QIJ5+F21MvZ4Wn4ORfYaFJ/0dsiudv5tVkejgwZlwQ39jL9WWDe2lz8x0WglOA==} + '@emnapi/core@2.0.0-alpha.6': + resolution: {integrity: sha512-MNVvMV7WtEJMgqaWJMvCyupK7Oi8sZctUIgPRZTsiS3cVvefk8DXPflOU3MSBddtj/rrYHygpYgpHDgwXnI3+w==} + '@emnapi/runtime@1.11.1': resolution: {integrity: sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==} '@emnapi/runtime@1.11.2': resolution: {integrity: sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA==} + '@emnapi/runtime@2.0.0-alpha.6': + resolution: {integrity: sha512-5ZR49ZsZ3cLvu5lkrVj6CMpHRgZjYz7XSlqK23GYYpyEqp749RVuIH0bEUKaGNghMh2pXRhIC3cnVrH28Y1j1Q==} + '@emnapi/wasi-threads@1.2.2': resolution: {integrity: sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==} + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + '@esbuild/aix-ppc64@0.28.1': resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==} engines: {node: '>=18'} @@ -888,11 +894,12 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - '@napi-rs/wasm-runtime@1.1.6': - resolution: {integrity: sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==} + '@napi-rs/wasm-runtime@1.2.5': + resolution: {integrity: sha512-HshSvXzmBxNzqejd3k/KemgQ3hdREUYFRRrgxOZ+gPljDIsO2SDZrVZMd4Z/HsxudQbE62OVyVFE8z9BCurfjA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} peerDependencies: - '@emnapi/core': ^1.7.1 - '@emnapi/runtime': ^1.7.1 + '@emnapi/core': ^1.7.1 || ^2.0.0-alpha.4 + '@emnapi/runtime': ^1.7.1 || ^2.0.0-alpha.4 '@noble/ciphers@1.3.0': resolution: {integrity: sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==} @@ -6312,8 +6319,8 @@ packages: zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} - zyzz@0.0.27: - resolution: {integrity: sha512-YNyyvxCi5nC5fjA8Lar5iSPfLAVTEYWbrFCTjVbqgBxxo9D41C6qEafnMZPloyXch/u/gsh/TD23a/Ys+ysXjQ==} + zyzz@0.0.33: + resolution: {integrity: sha512-auiwvTtF0cZyQmcEL0JIFXSSnd/WV6JD6nfoq8iTC9snBhMY+x/rUTYc8vIVBXQYYZIEwN72hBQqNrf90pRvpQ==} hasBin: true peerDependencies: '@babel/core': ^7.29.7 @@ -6725,6 +6732,11 @@ snapshots: tslib: 2.8.1 optional: true + '@emnapi/core@2.0.0-alpha.6': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.8.1 + '@emnapi/runtime@1.11.1': dependencies: tslib: 2.8.1 @@ -6735,11 +6747,19 @@ snapshots: tslib: 2.8.1 optional: true + '@emnapi/runtime@2.0.0-alpha.6': + dependencies: + tslib: 2.8.1 + '@emnapi/wasi-threads@1.2.2': dependencies: tslib: 2.8.1 optional: true + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.8.1 + '@esbuild/aix-ppc64@0.28.1': optional: true @@ -7078,20 +7098,26 @@ snapshots: react: 19.3.0 react-dom: 19.3.0(react@19.3.0) - '@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)': + '@napi-rs/wasm-runtime@1.2.5(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)': dependencies: '@emnapi/core': 1.11.1 '@emnapi/runtime': 1.11.1 '@tybys/wasm-util': 0.10.3 optional: true - '@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.11.2)(@emnapi/runtime@1.11.2)': + '@napi-rs/wasm-runtime@1.2.5(@emnapi/core@1.11.2)(@emnapi/runtime@1.11.2)': dependencies: '@emnapi/core': 1.11.2 '@emnapi/runtime': 1.11.2 '@tybys/wasm-util': 0.10.3 optional: true + '@napi-rs/wasm-runtime@1.2.5(@emnapi/core@2.0.0-alpha.6)(@emnapi/runtime@2.0.0-alpha.6)': + dependencies: + '@emnapi/core': 2.0.0-alpha.6 + '@emnapi/runtime': 2.0.0-alpha.6 + '@tybys/wasm-util': 0.10.3 + '@noble/ciphers@1.3.0': {} '@noble/ciphers@2.2.0': {} @@ -7228,7 +7254,7 @@ snapshots: dependencies: '@emnapi/core': 1.11.2 '@emnapi/runtime': 1.11.2 - '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.2)(@emnapi/runtime@1.11.2) + '@napi-rs/wasm-runtime': 1.2.5(@emnapi/core@1.11.2)(@emnapi/runtime@1.11.2) optional: true '@oxc-resolver/binding-win32-arm64-msvc@11.24.2': @@ -7366,7 +7392,7 @@ snapshots: dependencies: '@emnapi/core': 1.11.1 '@emnapi/runtime': 1.11.1 - '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1) + '@napi-rs/wasm-runtime': 1.2.5(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1) optional: true '@rolldown/binding-win32-arm64-msvc@1.1.4': @@ -8552,7 +8578,6 @@ snapshots: '@tybys/wasm-util@0.10.3': dependencies: tslib: 2.8.1 - optional: true '@types/chai@5.2.3': dependencies: @@ -12935,10 +12960,13 @@ snapshots: zwitch@2.0.4: {} - zyzz@0.0.27(patch_hash=f9b9d55fc96495127a5b86b4ae591bec85c1c7f38fb4d70909c1c7e64cb749fb)(@babel/core@7.29.7)(esbuild@0.28.1)(react@19.3.0)(rolldown@1.1.4)(rollup@4.60.1)(vite@8.1.0(@types/node@26.1.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(tsx@4.22.4)(yaml@2.9.0))(webpack@5.104.1(esbuild@0.28.1)): + zyzz@0.0.33(@babel/core@7.29.7)(esbuild@0.28.1)(react@19.3.0)(rolldown@1.1.4)(rollup@4.60.1)(vite@8.1.0(@types/node@26.1.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(tsx@4.22.4)(yaml@2.9.0))(webpack@5.104.1(esbuild@0.28.1)): dependencies: + '@emnapi/core': 2.0.0-alpha.6 + '@emnapi/runtime': 2.0.0-alpha.6 '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 + '@napi-rs/wasm-runtime': 1.2.5(@emnapi/core@2.0.0-alpha.6)(@emnapi/runtime@2.0.0-alpha.6) '@oxc-project/types': 0.148.0 '@oxlint/plugins': 1.68.0 css-tree: 3.2.1 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index bf48573c9..5921f690f 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -18,6 +18,8 @@ minimumReleaseAgeExclude: - '@vocs/twoslash-rust' - '@vocs/twoslash-rust-darwin-arm64' - '@vocs/twoslash-rust-linux-x64-gnu' + # Only this release: it ships the glibc 2.17 Linux addon that Vercel needs. + - zyzz@0.0.33 onlyBuiltDependencies: - core-js @@ -43,7 +45,6 @@ overrides: 'undici@>=8.0.0 <8.10.2': 8.10.2 patchedDependencies: - zyzz@0.0.27: patches/zyzz@0.0.27.patch '@braintree/sanitize-url@7.1.2': patches/@braintree__sanitize-url@7.1.2.patch dayjs@1.11.20: patches/dayjs@1.11.20.patch vocs@2.10.3: patches/vocs@2.10.3.patch diff --git a/scripts/zyzz-build.ts b/scripts/zyzz-build.ts deleted file mode 100644 index 9ace9767c..000000000 --- a/scripts/zyzz-build.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { Plugin } from 'vite' - -/** - * plugin-rsc analyzes client and server references with two throwaway builds - * that keep only each module's import statements. Zyzz output cannot affect - * those references, so skip compiling styles that the scan discards. - */ -export function skipReferenceScans(plugin: Plugin): Plugin { - const { transform } = plugin - if (typeof transform !== 'function') - throw new Error('Zyzz changed its transform hook; update skipReferenceScans') - if (process.env.ZYZZ_SKIP_SCAN === '0') return plugin - - return { - ...plugin, - transform(...args) { - const { config, mode } = this.environment - if (mode === 'build' && config.build.write === false) return - return transform.apply(this, args) - }, - } -} diff --git a/src/test/zyzz-integration.test.ts b/src/test/zyzz-integration.test.ts index 2e7c4194b..12a822306 100644 --- a/src/test/zyzz-integration.test.ts +++ b/src/test/zyzz-integration.test.ts @@ -44,7 +44,7 @@ it('excludes documentation fragments without excluding similarly named source di // The real multi-region documentation source is not one runnable module. await expect(compile()).rejects.toThrow() - const result = await compile(['snippets']) + const result = await compile(['snippets/**']) const outputs = (Array.isArray(result) ? result : [result]).flatMap((bundle) => 'output' in bundle ? bundle.output : [], ) @@ -64,7 +64,7 @@ it('serves server-compiled CSS to the browser without compiling its owner in the configFile: false, root, logLevel: 'silent', - plugins: [zyzz({ exclude: ['snippets'], script: false })], + plugins: [zyzz({ exclude: ['snippets/**'], script: false })], server: { middlewareMode: true }, optimizeDeps: { noDiscovery: true }, }) @@ -126,7 +126,7 @@ it('compiles the Tempo contract and rejects off-system declarations', async () = configFile: false, root, logLevel: 'silent', - plugins: [zyzz({ exclude: ['snippets'], script: false })], + plugins: [zyzz({ exclude: ['snippets/**'], script: false })], build: { write: false, minify: false, diff --git a/vite.config.ts b/vite.config.ts index 8e99ce8d7..9f9b9e468 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,7 +6,6 @@ import { defineConfig, loadEnv, type Plugin } from 'vite' import mkcert from 'vite-plugin-mkcert' import { zyzz } from 'zyzz/vite' import { graphiteRelatedDocsPlugin } from './scripts/graphite-related-docs-plugin' -import { skipReferenceScans } from './scripts/zyzz-build' import { vocsWithZyzz } from './scripts/zyzz-mdx-resources' import { blogPostsPlugin } from './src/marketing/blogPlugin' @@ -27,24 +26,22 @@ export default defineConfig(({ mode }) => { plugins: [ // Example regions are not complete modules. Keep server tooling out of // the client discovery graph; Vocs owns the persisted color scheme. - skipReferenceScans( - zyzz({ - exclude: [ - 'src/snippets', - 'src/test', - 'src/pages/_api', - 'src/marketing/blogPlugin.ts', - 'scripts', - 'e2e', - 'search-benchmark', - 'playwright.config.ts', - 'playwright.zones.config.ts', - 'playwright.production.config.ts', - 'vocs.config.ts', - ], - script: false, - }), - ), + zyzz({ + exclude: [ + 'src/snippets/**', + 'src/test/**', + 'src/pages/_api/**', + 'src/marketing/blogPlugin.ts', + 'scripts/**', + 'e2e/**', + 'search-benchmark/**', + 'playwright.config.ts', + 'playwright.zones.config.ts', + 'playwright.production.config.ts', + 'vocs.config.ts', + ], + script: false, + }), blogPostsPlugin(), developersProxyBasePath(), graphiteRelatedDocsPlugin(),