From a95aa0b66c722a3e4e2be06d27f31ff32649c6d3 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Thu, 3 Apr 2025 19:06:46 +0900 Subject: [PATCH 01/18] feat: add plugin-react-oxc Co-authored-by: underfin --- packages/plugin-react-oxc/CHANGELOG.md | 5 + packages/plugin-react-oxc/LICENSE | 21 +++ packages/plugin-react-oxc/README.md | 78 ++++++++ packages/plugin-react-oxc/build.config.ts | 11 ++ packages/plugin-react-oxc/package.json | 41 +++++ .../scripts/copyRefreshUtils.ts | 3 + packages/plugin-react-oxc/src/fast-refresh.ts | 92 ++++++++++ packages/plugin-react-oxc/src/index.ts | 168 ++++++++++++++++++ packages/plugin-react-oxc/src/refreshUtils.js | 93 ++++++++++ packages/plugin-react-oxc/tsconfig.json | 15 ++ pnpm-lock.yaml | 10 ++ scripts/release.ts | 2 +- 12 files changed, 538 insertions(+), 1 deletion(-) create mode 100644 packages/plugin-react-oxc/CHANGELOG.md create mode 100644 packages/plugin-react-oxc/LICENSE create mode 100644 packages/plugin-react-oxc/README.md create mode 100644 packages/plugin-react-oxc/build.config.ts create mode 100644 packages/plugin-react-oxc/package.json create mode 100644 packages/plugin-react-oxc/scripts/copyRefreshUtils.ts create mode 100644 packages/plugin-react-oxc/src/fast-refresh.ts create mode 100644 packages/plugin-react-oxc/src/index.ts create mode 100644 packages/plugin-react-oxc/src/refreshUtils.js create mode 100644 packages/plugin-react-oxc/tsconfig.json diff --git a/packages/plugin-react-oxc/CHANGELOG.md b/packages/plugin-react-oxc/CHANGELOG.md new file mode 100644 index 000000000..99a0dd736 --- /dev/null +++ b/packages/plugin-react-oxc/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## Unreleased + +- Create Oxc plugin diff --git a/packages/plugin-react-oxc/LICENSE b/packages/plugin-react-oxc/LICENSE new file mode 100644 index 000000000..9c1b313d7 --- /dev/null +++ b/packages/plugin-react-oxc/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/plugin-react-oxc/README.md b/packages/plugin-react-oxc/README.md new file mode 100644 index 000000000..dc2331e90 --- /dev/null +++ b/packages/plugin-react-oxc/README.md @@ -0,0 +1,78 @@ +# @vitejs/plugin-react-oxc [![npm](https://img.shields.io/npm/v/@vitejs/plugin-react-oxc.svg)](https://npmjs.com/package/@vitejs/plugin-react-oxc) + +```js +// vite.config.js +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react-oxc' + +export default defineConfig({ + plugins: [react()], +}) +``` + +## Caveats + +- `jsx runtime` is always `automatic` +- this plugin only works with `rolldown-vite` + +## Options + +### include/exclude + +Includes `.js`, `.jsx`, `.ts` & `.tsx` by default. This option can be used to add fast refresh to `.mdx` files: + +```js +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import mdx from '@mdx-js/rollup' + +export default defineConfig({ + plugins: [ + { enforce: 'pre', ...mdx() }, + react({ include: /\.(mdx|js|jsx|ts|tsx)$/ }), + ], +}) +``` + +> `node_modules` are never processed by this plugin (but esbuild will) + +### jsxImportSource + +Control where the JSX factory is imported from. Default to `'react'` + +```js +react({ jsxImportSource: '@emotion/react' }) +``` + +## Middleware mode + +In [middleware mode](https://vite.dev/config/server-options.html#server-middlewaremode), you should make sure your entry `index.html` file is transformed by Vite. Here's an example for an Express server: + +```js +app.get('/', async (req, res, next) => { + try { + let html = fs.readFileSync(path.resolve(root, 'index.html'), 'utf-8') + + // Transform HTML using Vite plugins. + html = await viteServer.transformIndexHtml(req.url, html) + + res.send(html) + } catch (e) { + return next(e) + } +}) +``` + +Otherwise, you'll probably get this error: + +``` +Uncaught Error: @vitejs/plugin-react-oxc can't detect preamble. Something is wrong. +``` + +## Consistent components exports + +For React refresh to work correctly, your file should only export React components. You can find a good explanation in the [Gatsby docs](https://www.gatsbyjs.com/docs/reference/local-development/fast-refresh/#how-it-works). + +If an incompatible change in exports is found, the module will be invalidated and HMR will propagate. To make it easier to export simple constants alongside your component, the module is only invalidated when their value changes. + +You can catch mistakes and get more detailed warning with this [eslint rule](https://github.com/ArnaudBarre/eslint-plugin-react-refresh). diff --git a/packages/plugin-react-oxc/build.config.ts b/packages/plugin-react-oxc/build.config.ts new file mode 100644 index 000000000..cd1efb1c2 --- /dev/null +++ b/packages/plugin-react-oxc/build.config.ts @@ -0,0 +1,11 @@ +import { defineBuildConfig } from 'unbuild' + +export default defineBuildConfig({ + entries: ['src/index'], + externals: ['vite'], + clean: true, + declaration: true, + rollup: { + inlineDependencies: true, + }, +}) diff --git a/packages/plugin-react-oxc/package.json b/packages/plugin-react-oxc/package.json new file mode 100644 index 000000000..416f3a7ed --- /dev/null +++ b/packages/plugin-react-oxc/package.json @@ -0,0 +1,41 @@ +{ + "name": "@vitejs/plugin-react-oxc", + "version": "0.1.0", + "license": "MIT", + "author": "Evan You", + "contributors": [ + "Alec Larson", + "Arnaud Barré" + ], + "files": [ + "dist" + ], + "type": "module", + "exports": "./dist/index.mjs", + "scripts": { + "dev": "unbuild --stub", + "build": "unbuild && tsx scripts/copyRefreshUtils.ts", + "prepublishOnly": "npm run build" + }, + "engines": { + "node": ">=20.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vitejs/vite-plugin-react.git", + "directory": "packages/plugin-react-oxc" + }, + "bugs": { + "url": "https://github.com/vitejs/vite-plugin-react/issues" + }, + "homepage": "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#readme", + "dependencies": { + "react-refresh": "^0.14.2" + }, + "peerDependencies": { + "vite": "^6.3.0" + }, + "devDependencies": { + "unbuild": "^3.5.0" + } +} diff --git a/packages/plugin-react-oxc/scripts/copyRefreshUtils.ts b/packages/plugin-react-oxc/scripts/copyRefreshUtils.ts new file mode 100644 index 000000000..977f6442f --- /dev/null +++ b/packages/plugin-react-oxc/scripts/copyRefreshUtils.ts @@ -0,0 +1,3 @@ +import { copyFileSync } from 'node:fs' + +copyFileSync('src/refreshUtils.js', 'dist/refreshUtils.js') diff --git a/packages/plugin-react-oxc/src/fast-refresh.ts b/packages/plugin-react-oxc/src/fast-refresh.ts new file mode 100644 index 000000000..441c9e321 --- /dev/null +++ b/packages/plugin-react-oxc/src/fast-refresh.ts @@ -0,0 +1,92 @@ +import fs from 'node:fs' +import path from 'node:path' +import { createRequire } from 'node:module' + +export const runtimePublicPath = '/@react-refresh' + +const _require = createRequire(import.meta.url) +const reactRefreshDir = path.dirname( + _require.resolve('react-refresh/package.json'), +) +const runtimeFilePath = path.join( + reactRefreshDir, + 'cjs/react-refresh-runtime.development.js', +) + +export const runtimeCode = ` +const exports = {} +${fs.readFileSync(runtimeFilePath, 'utf-8')} +${fs.readFileSync(_require.resolve('./refreshUtils.js'), 'utf-8')} +export default exports +` + +export const preambleCode = ` +import RefreshRuntime from "__BASE__${runtimePublicPath.slice(1)}" +RefreshRuntime.injectIntoGlobalHook(window) +window.$RefreshReg$ = () => {} +window.$RefreshSig$ = () => (type) => type +window.__vite_plugin_react_preamble_installed__ = true +` + +const sharedHeader = ` +import RefreshRuntime from "${runtimePublicPath}"; + +const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope; +`.replace(/\n+/g, '') +const functionHeader = ` +let prevRefreshReg; +let prevRefreshSig; + +if (import.meta.hot && !inWebWorker) { + if (!window.__vite_plugin_react_preamble_installed__) { + throw new Error( + "@vitejs/plugin-react-oxc can't detect preamble. Something is wrong. " + + "See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201" + ); + } + + prevRefreshReg = window.$RefreshReg$; + prevRefreshSig = window.$RefreshSig$; + window.$RefreshReg$ = (type, id) => { + RefreshRuntime.register(type, __SOURCE__ + " " + id) + }; + window.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform; +}`.replace(/\n+/g, '') + +const functionFooter = ` +if (import.meta.hot && !inWebWorker) { + window.$RefreshReg$ = prevRefreshReg; + window.$RefreshSig$ = prevRefreshSig; +}` +const sharedFooter = (id: string) => ` +if (import.meta.hot && !inWebWorker) { + RefreshRuntime.__hmr_import(import.meta.url).then((currentExports) => { + RefreshRuntime.registerExportsForReactRefresh(${JSON.stringify( + id, + )}, currentExports); + import.meta.hot.accept((nextExports) => { + if (!nextExports) return; + const invalidateMessage = RefreshRuntime.validateRefreshBoundaryAndEnqueueUpdate(${JSON.stringify( + id, + )}, currentExports, nextExports); + if (invalidateMessage) import.meta.hot.invalidate(invalidateMessage); + }); + }); +}` + +export function addRefreshWrapper(code: string, id: string): string { + return ( + sharedHeader + + functionHeader.replace('__SOURCE__', JSON.stringify(id)) + + code + + functionFooter + + sharedFooter(id) + ) +} + +export function addClassComponentRefreshWrapper( + code: string, + id: string, +): string { + return sharedHeader + code + sharedFooter(id) +} diff --git a/packages/plugin-react-oxc/src/index.ts b/packages/plugin-react-oxc/src/index.ts new file mode 100644 index 000000000..04535a3ba --- /dev/null +++ b/packages/plugin-react-oxc/src/index.ts @@ -0,0 +1,168 @@ +import type { BuildOptions, Plugin, PluginOption, UserConfig } from 'vite' +import { + addClassComponentRefreshWrapper, + addRefreshWrapper, + preambleCode, + runtimeCode, + runtimePublicPath, +} from './fast-refresh' + +export interface Options { + include?: string | RegExp | Array + exclude?: string | RegExp | Array + /** + * Control where the JSX factory is imported from. + * @default 'react' + */ + jsxImportSource?: string +} + +const reactCompRE = /extends\s+(?:React\.)?(?:Pure)?Component/ +const refreshContentRE = /\$Refresh(?:Reg|Sig)\$\(/ +const defaultIncludeRE = /\.[tj]sx?(?:$|\?)/ + +export default function viteReact(opts: Options = {}): PluginOption[] { + const include = opts.include ?? defaultIncludeRE + const exclude = [ + ...(Array.isArray(opts.exclude) + ? opts.exclude + : opts.exclude + ? [opts.exclude] + : []), + /\/node_modules\//, + ] + + const jsxImportSource = opts.jsxImportSource ?? 'react' + const jsxImportRuntime = `${jsxImportSource}/jsx-runtime` + const jsxImportDevRuntime = `${jsxImportSource}/jsx-dev-runtime` + + const viteConfig: Plugin = { + name: 'vite:react-oxc:config', + config(userConfig, { command }) { + return { + build: silenceUseClientWarning(userConfig), + oxc: { + jsx: { + runtime: 'automatic', + importSource: jsxImportSource, + refresh: command === 'serve', + development: command === 'serve', + }, + jsxRefreshInclude: include, + jsxRefreshExclude: exclude, + }, + optimizeDeps: { + include: [ + 'react', + 'react-dom', + jsxImportDevRuntime, + jsxImportRuntime, + ], + rollupOptions: { jsx: { mode: 'automatic' } }, + }, + } + }, + } + + const viteRefreshRuntime: Plugin = { + name: 'vite:react-oxc:refresh-runtime', + enforce: 'pre', + resolveId: { + filter: { id: exactRegex(runtimePublicPath) }, + handler(id) { + return id + }, + }, + load: { + filter: { id: exactRegex(runtimePublicPath) }, + handler(_id) { + return runtimeCode + }, + }, + } + + let devBase: string + let skipFastRefresh = false + + const viteRefreshWrapper: Plugin = { + name: 'vite:react-oxc:refresh-wrapper', + apply: 'serve', + configResolved(config) { + devBase = config.base + skipFastRefresh = config.isProduction || config.server.hmr === false + }, + transform: { + filter: { + id: { include, exclude }, + }, + handler(code, id, options) { + const ssr = options?.ssr === true + + const [filepath] = id.split('?') + const isJSX = filepath.endsWith('x') + const useFastRefresh = + !skipFastRefresh && + !ssr && + (isJSX || + code.includes(jsxImportDevRuntime) || + code.includes(jsxImportRuntime)) + + if (useFastRefresh) { + if (refreshContentRE.test(code)) { + code = addRefreshWrapper(code, id) + } else if (reactCompRE.test(code)) { + code = addClassComponentRefreshWrapper(code, id) + } + return { code } + } + }, + }, + transformIndexHtml() { + if (!skipFastRefresh) + return [ + { + tag: 'script', + attrs: { type: 'module' }, + children: preambleCode.replace(`__BASE__`, devBase), + }, + ] + }, + } + + return [viteConfig, viteRefreshRuntime, viteRefreshWrapper] +} + +const silenceUseClientWarning = (userConfig: UserConfig): BuildOptions => ({ + rollupOptions: { + onwarn(warning, defaultHandler) { + if ( + warning.code === 'MODULE_LEVEL_DIRECTIVE' && + warning.message.includes('use client') + ) { + return + } + // https://github.com/vitejs/vite/issues/15012 + if ( + warning.code === 'SOURCEMAP_ERROR' && + warning.message.includes('resolve original location') && + warning.pos === 0 + ) { + return + } + if (userConfig.build?.rollupOptions?.onwarn) { + userConfig.build.rollupOptions.onwarn(warning, defaultHandler) + } else { + defaultHandler(warning) + } + }, + }, +}) + +function exactRegex(input: string): RegExp { + return new RegExp(`^${escapeRegex(input)}$`) +} + +const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g +function escapeRegex(str: string): string { + return str.replace(escapeRegexRE, '\\$&') +} diff --git a/packages/plugin-react-oxc/src/refreshUtils.js b/packages/plugin-react-oxc/src/refreshUtils.js new file mode 100644 index 000000000..2576164d7 --- /dev/null +++ b/packages/plugin-react-oxc/src/refreshUtils.js @@ -0,0 +1,93 @@ +function debounce(fn, delay) { + let handle + return () => { + clearTimeout(handle) + handle = setTimeout(fn, delay) + } +} + +/* eslint-disable no-undef */ +const hooks = [] +window.__registerBeforePerformReactRefresh = (cb) => { + hooks.push(cb) +} +const enqueueUpdate = debounce(async () => { + if (hooks.length) await Promise.all(hooks.map((cb) => cb())) + exports.performReactRefresh() +}, 16) + +// Taken from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/runtime/RefreshUtils.js#L141 +// This allows to register components not detected by SWC like styled component +function registerExportsForReactRefresh(filename, moduleExports) { + for (const key in moduleExports) { + if (key === '__esModule') continue + const exportValue = moduleExports[key] + if (exports.isLikelyComponentType(exportValue)) { + // 'export' is required to avoid key collision when renamed exports that + // shadow a local component name: https://github.com/vitejs/vite-plugin-react/issues/116 + // The register function has an identity check to not register twice the same component, + // so this is safe to not used the same key here. + exports.register(exportValue, filename + ' export ' + key) + } + } +} + +function validateRefreshBoundaryAndEnqueueUpdate(id, prevExports, nextExports) { + const ignoredExports = window.__getReactRefreshIgnoredExports?.({ id }) ?? [] + if ( + predicateOnExport( + ignoredExports, + prevExports, + (key) => key in nextExports, + ) !== true + ) { + return 'Could not Fast Refresh (export removed)' + } + if ( + predicateOnExport( + ignoredExports, + nextExports, + (key) => key in prevExports, + ) !== true + ) { + return 'Could not Fast Refresh (new export)' + } + + let hasExports = false + const allExportsAreComponentsOrUnchanged = predicateOnExport( + ignoredExports, + nextExports, + (key, value) => { + hasExports = true + if (exports.isLikelyComponentType(value)) return true + return prevExports[key] === nextExports[key] + }, + ) + if (hasExports && allExportsAreComponentsOrUnchanged === true) { + enqueueUpdate() + } else { + return `Could not Fast Refresh ("${allExportsAreComponentsOrUnchanged}" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports` + } +} + +function predicateOnExport(ignoredExports, moduleExports, predicate) { + for (const key in moduleExports) { + if (key === '__esModule') continue + if (ignoredExports.includes(key)) continue + const desc = Object.getOwnPropertyDescriptor(moduleExports, key) + if (desc && desc.get) return key + if (!predicate(key, moduleExports[key])) return key + } + return true +} + +// Hides vite-ignored dynamic import so that Vite can skip analysis if no other +// dynamic import is present (https://github.com/vitejs/vite/pull/12732) +function __hmr_import(module) { + return import(/* @vite-ignore */ module) +} + +exports.__hmr_import = __hmr_import +exports.registerExportsForReactRefresh = registerExportsForReactRefresh +exports.validateRefreshBoundaryAndEnqueueUpdate = + validateRefreshBoundaryAndEnqueueUpdate diff --git a/packages/plugin-react-oxc/tsconfig.json b/packages/plugin-react-oxc/tsconfig.json new file mode 100644 index 000000000..e2b17f9c7 --- /dev/null +++ b/packages/plugin-react-oxc/tsconfig.json @@ -0,0 +1,15 @@ +{ + "include": ["src", "scripts"], + "compilerOptions": { + "outDir": "dist", + "target": "ES2020", + "module": "ES2020", + "moduleResolution": "bundler", + "strict": true, + "declaration": true, + "sourceMap": true, + "noEmit": true, + "noUnusedLocals": true, + "esModuleInterop": true + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3df827a4d..9f4c85b60 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -93,6 +93,16 @@ importers: specifier: ^3.5.0 version: 3.5.0(typescript@5.8.2) + packages/plugin-react-oxc: + dependencies: + react-refresh: + specifier: ^0.14.2 + version: 0.14.2 + devDependencies: + unbuild: + specifier: ^3.5.0 + version: 3.5.0(typescript@5.8.2) + packages/plugin-react-swc: dependencies: '@swc/core': diff --git a/scripts/release.ts b/scripts/release.ts index 0b92aa781..1dec315a9 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -4,7 +4,7 @@ import colors from 'picocolors' release({ repo: 'vite-plugin-react', - packages: ['plugin-react', 'plugin-react-swc'], + packages: ['plugin-react', 'plugin-react-swc', 'plugin-react-oxc'], toTag: (pkg, version) => `${pkg}@${version}`, logChangelog: async (pkgName) => { const changelog = readFileSync(`packages/${pkgName}/CHANGELOG.md`, 'utf-8') From 7dcb6a025973af68d6dc80a77af2f0efadc7451d Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Thu, 3 Apr 2025 21:00:56 +0900 Subject: [PATCH 02/18] chore: use overrides to run test --- package.json | 4 + pnpm-lock.yaml | 857 +++++++++++++++++++++++++++++-------------------- 2 files changed, 506 insertions(+), 355 deletions(-) diff --git a/package.json b/package.json index 3e41effaf..c890993bb 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,10 @@ "react-router-dom": "*" } } + }, + "overrides": { + "vite": "npm:rolldown-vite@6.3.0-beta.5", + "@vitejs/plugin-react": "workspace:@vitejs/plugin-react-oxc@*" } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9f4c85b60..0718e7f24 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,10 @@ settings: autoInstallPeers: false excludeLinksFromLockfile: false +overrides: + vite: npm:rolldown-vite@6.3.0-beta.5 + '@vitejs/plugin-react': workspace:@vitejs/plugin-react-oxc@* + packageExtensionsChecksum: sha256-S82yCctxnlOTNFuHWCyTFRo/B6Y3jque/4DnsDO4WZA= importers: @@ -65,11 +69,11 @@ importers: specifier: ^8.26.1 version: 8.29.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.7.2) vite: - specifier: ^6.0.0 - version: 6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + specifier: npm:rolldown-vite@6.3.0-beta.5 + version: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) vitest: specifier: ^3.0.4 - version: 3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + version: 3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) packages/plugin-react: dependencies: @@ -88,6 +92,9 @@ importers: react-refresh: specifier: ^0.14.2 version: 0.14.2 + vite: + specifier: npm:rolldown-vite@6.3.0-beta.5 + version: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1) devDependencies: unbuild: specifier: ^3.5.0 @@ -98,6 +105,9 @@ importers: react-refresh: specifier: ^0.14.2 version: 0.14.2 + vite: + specifier: npm:rolldown-vite@6.3.0-beta.5 + version: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1) devDependencies: unbuild: specifier: ^3.5.0 @@ -108,6 +118,9 @@ importers: '@swc/core': specifier: ^1.11.11 version: 1.11.13 + vite: + specifier: npm:rolldown-vite@6.3.0-beta.5 + version: rolldown-vite@6.3.0-beta.5(@types/node@22.13.10)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1) devDependencies: '@playwright/test': specifier: ^1.51.1 @@ -136,9 +149,6 @@ importers: typescript: specifier: ^5.8.2 version: 5.8.2 - vite: - specifier: ^6.2.2 - version: 6.2.3(@types/node@22.13.10)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) packages/plugin-react-swc/playground/base-path: dependencies: @@ -280,7 +290,7 @@ importers: devDependencies: '@mdx-js/rollup': specifier: ^3.1.0 - version: 3.1.0(rollup@4.38.0) + version: 3.1.0(rollup@4.37.0) '@types/react': specifier: ^19.0.11 version: 19.0.12 @@ -364,10 +374,10 @@ importers: dependencies: '@generouted/react-router': specifier: ^1.20.0 - version: 1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) + version: 1.20.0(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) generouted: specifier: 1.11.7 - version: 1.11.7(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) + version: 1.11.7(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) react: specifier: ^19.0.0 version: 19.1.0 @@ -432,8 +442,8 @@ importers: specifier: ^18.3.1 version: 18.3.1 '@vitejs/plugin-react': - specifier: workspace:* - version: link:../../packages/plugin-react + specifier: workspace:@vitejs/plugin-react-oxc@* + version: link:../../packages/plugin-react-oxc playground/compiler: dependencies: @@ -454,8 +464,8 @@ importers: specifier: ^18.3.1 version: 18.3.1 '@vitejs/plugin-react': - specifier: workspace:* - version: link:../../packages/plugin-react + specifier: workspace:@vitejs/plugin-react-oxc@* + version: link:../../packages/plugin-react-oxc babel-plugin-react-compiler: specifier: 0.0.0-experimental-dc8bd44-20241121 version: 0.0.0-experimental-dc8bd44-20241121 @@ -485,8 +495,8 @@ importers: specifier: ^18.3.1 version: 18.3.1 '@vitejs/plugin-react': - specifier: workspace:* - version: link:../../packages/plugin-react + specifier: workspace:@vitejs/plugin-react-oxc@* + version: link:../../packages/plugin-react-oxc babel-plugin-react-compiler: specifier: 0.0.0-experimental-dc8bd44-20241121 version: 0.0.0-experimental-dc8bd44-20241121 @@ -505,7 +515,7 @@ importers: devDependencies: '@mdx-js/rollup': specifier: ^3.1.0 - version: 3.1.0(rollup@4.38.0) + version: 3.1.0(rollup@4.37.0) '@types/react': specifier: ^18.3.12 version: 18.3.12 @@ -513,8 +523,8 @@ importers: specifier: ^18.3.1 version: 18.3.1 '@vitejs/plugin-react': - specifier: workspace:* - version: link:../../packages/plugin-react + specifier: workspace:@vitejs/plugin-react-oxc@* + version: link:../../packages/plugin-react-oxc playground/react: dependencies: @@ -529,8 +539,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@vitejs/plugin-react': - specifier: workspace:* - version: link:../../packages/plugin-react + specifier: workspace:@vitejs/plugin-react-oxc@* + version: link:../../packages/plugin-react-oxc playground/react-classic: dependencies: @@ -542,8 +552,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@vitejs/plugin-react': - specifier: workspace:* - version: link:../../packages/plugin-react + specifier: workspace:@vitejs/plugin-react-oxc@* + version: link:../../packages/plugin-react-oxc playground/react-emotion: dependencies: @@ -570,8 +580,8 @@ importers: specifier: ^11.13.5 version: 11.13.5 '@vitejs/plugin-react': - specifier: workspace:* - version: link:../../packages/plugin-react + specifier: workspace:@vitejs/plugin-react-oxc@* + version: link:../../packages/plugin-react-oxc playground/react-env: dependencies: @@ -583,8 +593,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@vitejs/plugin-react': - specifier: workspace:* - version: link:../../packages/plugin-react + specifier: workspace:@vitejs/plugin-react-oxc@* + version: link:../../packages/plugin-react-oxc playground/react-sourcemap: dependencies: @@ -596,8 +606,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@vitejs/plugin-react': - specifier: workspace:* - version: link:../../packages/plugin-react + specifier: workspace:@vitejs/plugin-react-oxc@* + version: link:../../packages/plugin-react-oxc playground/react/jsx-entry: {} @@ -611,8 +621,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@vitejs/plugin-react': - specifier: workspace:* - version: link:../../packages/plugin-react + specifier: workspace:@vitejs/plugin-react-oxc@* + version: link:../../packages/plugin-react-oxc packages: @@ -1356,7 +1366,6 @@ packages: peerDependencies: react: '>=18' react-router: '>=7' - vite: '>=5' '@humanfs/core@0.19.1': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} @@ -1419,6 +1428,13 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@oxc-project/runtime@0.61.2': + resolution: {integrity: sha512-UNv56Aa4pTtsnqapa2LC+gRxXbUZxA6j1WlSYV8+zan5sD+CvwOMSzUsMNdUUTebob6PafJfT+/TN83yWXWmSA==} + engines: {node: '>=6.9.0'} + + '@oxc-project/types@0.61.2': + resolution: {integrity: sha512-rfuwJwvwn9MRthHNXlSo9Eka/u7gC0MhnWAoX3BhE1+rwPOl22nq0K0Y997Hof0tHCOuD7H3/Z8HTfCVhB4c5Q==} + '@playwright/test@1.51.1': resolution: {integrity: sha512-nM+kEaTSAoVlXmMPH10017vn3FSiFqr/bh4fKg9vmAdMfd9SDqRZNvPSiAHADc/itWak+qPvMPZQOPwCBW7k7Q==} engines: {node: '>=18'} @@ -1428,6 +1444,66 @@ packages: resolution: {integrity: sha512-S+9ANAvUmjutrshV4jZjaiG8XQyuJIZ8a4utWmN/vW1sgQ9IfBnPndwkmQYw53QmouOIytT874u65HEmu6H5jw==} engines: {node: '>=18'} + '@rolldown/binding-darwin-arm64@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-aq6Y9OQl05bYUnzM4a7ZGF3+Du7cdrw3Ala1eCnvNqxgi2ksXKN+LHvgeaWDlyfLgX0jVQFZre4+kzgLSHEMog==} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-GRxENhaf92Blo7TZz8C8vBFSt4pCRWDP45ElGATItWqzyM+ILtzNjkE5Wj1OyWPe7y0oWxps6YMxVxEdb3/BJQ==} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-3uibg1KMHT7c149YupfXICxKoO6K7q3MaMpvOdxUjTY9mY3+v96eHTfnq+dd6qD16ppKSVij7FfpEC+sCVDRmg==} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-oDFqE2fWx2sj0E9doRUmYxi5TKc9/vmD49NP0dUN578LQO8nJBwqOMvE8bM3a/T3or4g1mlJt2ebzGiKGzjHSw==} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-0Weogg1WiFNkmwznM4YS4AmDa55miGstb/I4zKquIsv1kSBLBkxboifgWTCPUnGFK7Wy1u/beRnxCY7UVL1oPw==} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-LwEN10APipzjxAHSreVTEnUAHRz3sq4/UR3IVD/AguV0s6yAbVAsIrvIoxXHKoci+RUlyY5FXICYZQKli8iU5w==} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-tgE2J4BAQfI0rfoPzS4r1LEHSNxdNSM8l1Ab5InnzE4dXzVw92BVQ/FLFE6L+nWy81O7uwd7yz0Jo+qByOPCXg==} + cpu: [x64] + os: [linux] + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-m78svPie3D5PIBxmexztDVHjrnHO5t6h3Lwtl6sqdrio1zhGYMY9FcPcaZZ40mXXWKHFoPmbueBZZLdttvOEIQ==} + cpu: [x64] + os: [linux] + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-XbOcOWmdioNZ3hHBb5j96Y9S9pGyTeFZWR5ovMZggA9L7mWft2pMrbx4p5zUy2dCps3l1jaFQCjKuBXpwoCZug==} + engines: {node: '>=14.21.3'} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-lnZ/wrat6UMWGbS9w5AUEH8WkPBA4EUSYp8cxlspdU16dISeD/KGpF2d0hS6Oa6ftbgZZrRLMEnQRiD8OupPsg==} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-F0N/6kAnCl9dOgqR09T60UjQSxKvRtlbImhiYxIdKBFxgYDDGsh8XzlSbMRUVQmMtNwKC8xi+i+SnamSqY6q8Q==} + cpu: [ia32] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-T3qKMkSVemlVLLd5V7dCXnjt4Zda1UnUi45AQnmxIf3jH0/VP0J4aYAJiEEaRbhMoHc82j01+6MuZFZUVMeqng==} + cpu: [x64] + os: [win32] + '@rollup/plugin-alias@5.1.1': resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==} engines: {node: '>=14.0.0'} @@ -1496,201 +1572,101 @@ packages: cpu: [arm] os: [android] - '@rollup/rollup-android-arm-eabi@4.38.0': - resolution: {integrity: sha512-ldomqc4/jDZu/xpYU+aRxo3V4mGCV9HeTgUBANI3oIQMOL+SsxB+S2lxMpkFp5UamSS3XuTMQVbsS24R4J4Qjg==} - cpu: [arm] - os: [android] - '@rollup/rollup-android-arm64@4.37.0': resolution: {integrity: sha512-6U3SlVyMxezt8Y+/iEBcbp945uZjJwjZimu76xoG7tO1av9VO691z8PkhzQ85ith2I8R2RddEPeSfcbyPfD4hA==} cpu: [arm64] os: [android] - '@rollup/rollup-android-arm64@4.38.0': - resolution: {integrity: sha512-VUsgcy4GhhT7rokwzYQP+aV9XnSLkkhlEJ0St8pbasuWO/vwphhZQxYEKUP3ayeCYLhk6gEtacRpYP/cj3GjyQ==} - cpu: [arm64] - os: [android] - '@rollup/rollup-darwin-arm64@4.37.0': resolution: {integrity: sha512-+iTQ5YHuGmPt10NTzEyMPbayiNTcOZDWsbxZYR1ZnmLnZxG17ivrPSWFO9j6GalY0+gV3Jtwrrs12DBscxnlYA==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-arm64@4.38.0': - resolution: {integrity: sha512-buA17AYXlW9Rn091sWMq1xGUvWQFOH4N1rqUxGJtEQzhChxWjldGCCup7r/wUnaI6Au8sKXpoh0xg58a7cgcpg==} - cpu: [arm64] - os: [darwin] - '@rollup/rollup-darwin-x64@4.37.0': resolution: {integrity: sha512-m8W2UbxLDcmRKVjgl5J/k4B8d7qX2EcJve3Sut7YGrQoPtCIQGPH5AMzuFvYRWZi0FVS0zEY4c8uttPfX6bwYQ==} cpu: [x64] os: [darwin] - '@rollup/rollup-darwin-x64@4.38.0': - resolution: {integrity: sha512-Mgcmc78AjunP1SKXl624vVBOF2bzwNWFPMP4fpOu05vS0amnLcX8gHIge7q/lDAHy3T2HeR0TqrriZDQS2Woeg==} - cpu: [x64] - os: [darwin] - '@rollup/rollup-freebsd-arm64@4.37.0': resolution: {integrity: sha512-FOMXGmH15OmtQWEt174v9P1JqqhlgYge/bUjIbiVD1nI1NeJ30HYT9SJlZMqdo1uQFyt9cz748F1BHghWaDnVA==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-arm64@4.38.0': - resolution: {integrity: sha512-zzJACgjLbQTsscxWqvrEQAEh28hqhebpRz5q/uUd1T7VTwUNZ4VIXQt5hE7ncs0GrF+s7d3S4on4TiXUY8KoQA==} - cpu: [arm64] - os: [freebsd] - '@rollup/rollup-freebsd-x64@4.37.0': resolution: {integrity: sha512-SZMxNttjPKvV14Hjck5t70xS3l63sbVwl98g3FlVVx2YIDmfUIy29jQrsw06ewEYQ8lQSuY9mpAPlmgRD2iSsA==} cpu: [x64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.38.0': - resolution: {integrity: sha512-hCY/KAeYMCyDpEE4pTETam0XZS4/5GXzlLgpi5f0IaPExw9kuB+PDTOTLuPtM10TlRG0U9OSmXJ+Wq9J39LvAg==} - cpu: [x64] - os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.37.0': resolution: {integrity: sha512-hhAALKJPidCwZcj+g+iN+38SIOkhK2a9bqtJR+EtyxrKKSt1ynCBeqrQy31z0oWU6thRZzdx53hVgEbRkuI19w==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-gnueabihf@4.38.0': - resolution: {integrity: sha512-mimPH43mHl4JdOTD7bUMFhBdrg6f9HzMTOEnzRmXbOZqjijCw8LA5z8uL6LCjxSa67H2xiLFvvO67PT05PRKGg==} - cpu: [arm] - os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.37.0': resolution: {integrity: sha512-jUb/kmn/Gd8epbHKEqkRAxq5c2EwRt0DqhSGWjPFxLeFvldFdHQs/n8lQ9x85oAeVb6bHcS8irhTJX2FCOd8Ag==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.38.0': - resolution: {integrity: sha512-tPiJtiOoNuIH8XGG8sWoMMkAMm98PUwlriOFCCbZGc9WCax+GLeVRhmaxjJtz6WxrPKACgrwoZ5ia/uapq3ZVg==} - cpu: [arm] - os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.37.0': resolution: {integrity: sha512-oNrJxcQT9IcbcmKlkF+Yz2tmOxZgG9D9GRq+1OE6XCQwCVwxixYAa38Z8qqPzQvzt1FCfmrHX03E0pWoXm1DqA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.38.0': - resolution: {integrity: sha512-wZco59rIVuB0tjQS0CSHTTUcEde+pXQWugZVxWaQFdQQ1VYub/sTrNdY76D1MKdN2NB48JDuGABP6o6fqos8mA==} - cpu: [arm64] - os: [linux] - '@rollup/rollup-linux-arm64-musl@4.37.0': resolution: {integrity: sha512-pfxLBMls+28Ey2enpX3JvjEjaJMBX5XlPCZNGxj4kdJyHduPBXtxYeb8alo0a7bqOoWZW2uKynhHxF/MWoHaGQ==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.38.0': - resolution: {integrity: sha512-fQgqwKmW0REM4LomQ+87PP8w8xvU9LZfeLBKybeli+0yHT7VKILINzFEuggvnV9M3x1Ed4gUBmGUzCo/ikmFbQ==} - cpu: [arm64] - os: [linux] - '@rollup/rollup-linux-loongarch64-gnu@4.37.0': resolution: {integrity: sha512-yCE0NnutTC/7IGUq/PUHmoeZbIwq3KRh02e9SfFh7Vmc1Z7atuJRYWhRME5fKgT8aS20mwi1RyChA23qSyRGpA==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-loongarch64-gnu@4.38.0': - resolution: {integrity: sha512-hz5oqQLXTB3SbXpfkKHKXLdIp02/w3M+ajp8p4yWOWwQRtHWiEOCKtc9U+YXahrwdk+3qHdFMDWR5k+4dIlddg==} - cpu: [loong64] - os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.37.0': resolution: {integrity: sha512-NxcICptHk06E2Lh3a4Pu+2PEdZ6ahNHuK7o6Np9zcWkrBMuv21j10SQDJW3C9Yf/A/P7cutWoC/DptNLVsZ0VQ==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.38.0': - resolution: {integrity: sha512-NXqygK/dTSibQ+0pzxsL3r4Xl8oPqVoWbZV9niqOnIHV/J92fe65pOir0xjkUZDRSPyFRvu+4YOpJF9BZHQImw==} - cpu: [ppc64] - os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.37.0': resolution: {integrity: sha512-PpWwHMPCVpFZLTfLq7EWJWvrmEuLdGn1GMYcm5MV7PaRgwCEYJAwiN94uBuZev0/J/hFIIJCsYw4nLmXA9J7Pw==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.38.0': - resolution: {integrity: sha512-GEAIabR1uFyvf/jW/5jfu8gjM06/4kZ1W+j1nWTSSB3w6moZEBm7iBtzwQ3a1Pxos2F7Gz+58aVEnZHU295QTg==} - cpu: [riscv64] - os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.37.0': resolution: {integrity: sha512-DTNwl6a3CfhGTAOYZ4KtYbdS8b+275LSLqJVJIrPa5/JuIufWWZ/QFvkxp52gpmguN95eujrM68ZG+zVxa8zHA==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.38.0': - resolution: {integrity: sha512-9EYTX+Gus2EGPbfs+fh7l95wVADtSQyYw4DfSBcYdUEAmP2lqSZY0Y17yX/3m5VKGGJ4UmIH5LHLkMJft3bYoA==} - cpu: [riscv64] - os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.37.0': resolution: {integrity: sha512-hZDDU5fgWvDdHFuExN1gBOhCuzo/8TMpidfOR+1cPZJflcEzXdCy1LjnklQdW8/Et9sryOPJAKAQRw8Jq7Tg+A==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.38.0': - resolution: {integrity: sha512-Mpp6+Z5VhB9VDk7RwZXoG2qMdERm3Jw07RNlXHE0bOnEeX+l7Fy4bg+NxfyN15ruuY3/7Vrbpm75J9QHFqj5+Q==} - cpu: [s390x] - os: [linux] - '@rollup/rollup-linux-x64-gnu@4.37.0': resolution: {integrity: sha512-pKivGpgJM5g8dwj0ywBwe/HeVAUSuVVJhUTa/URXjxvoyTT/AxsLTAbkHkDHG7qQxLoW2s3apEIl26uUe08LVQ==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.38.0': - resolution: {integrity: sha512-vPvNgFlZRAgO7rwncMeE0+8c4Hmc+qixnp00/Uv3ht2x7KYrJ6ERVd3/R0nUtlE6/hu7/HiiNHJ/rP6knRFt1w==} - cpu: [x64] - os: [linux] - '@rollup/rollup-linux-x64-musl@4.37.0': resolution: {integrity: sha512-E2lPrLKE8sQbY/2bEkVTGDEk4/49UYRVWgj90MY8yPjpnGBQ+Xi1Qnr7b7UIWw1NOggdFQFOLZ8+5CzCiz143w==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.38.0': - resolution: {integrity: sha512-q5Zv+goWvQUGCaL7fU8NuTw8aydIL/C9abAVGCzRReuj5h30TPx4LumBtAidrVOtXnlB+RZkBtExMsfqkMfb8g==} - cpu: [x64] - os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.37.0': resolution: {integrity: sha512-Jm7biMazjNzTU4PrQtr7VS8ibeys9Pn29/1bm4ph7CP2kf21950LgN+BaE2mJ1QujnvOc6p54eWWiVvn05SOBg==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-arm64-msvc@4.38.0': - resolution: {integrity: sha512-u/Jbm1BU89Vftqyqbmxdq14nBaQjQX1HhmsdBWqSdGClNaKwhjsg5TpW+5Ibs1mb8Es9wJiMdl86BcmtUVXNZg==} - cpu: [arm64] - os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.37.0': resolution: {integrity: sha512-e3/1SFm1OjefWICB2Ucstg2dxYDkDTZGDYgwufcbsxTHyqQps1UQf33dFEChBNmeSsTOyrjw2JJq0zbG5GF6RA==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.38.0': - resolution: {integrity: sha512-mqu4PzTrlpNHHbu5qleGvXJoGgHpChBlrBx/mEhTPpnAL1ZAYFlvHD7rLK839LLKQzqEQMFJfGrrOHItN4ZQqA==} - cpu: [ia32] - os: [win32] - '@rollup/rollup-win32-x64-msvc@4.37.0': resolution: {integrity: sha512-LWbXUBwn/bcLx2sSsqy7pK5o+Nr+VCoRoAohfJ5C/aBio9nfJmGQqHAhU6pwxV/RmyTk5AqdySma7uwWGlmeuA==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.38.0': - resolution: {integrity: sha512-jjqy3uWlecfB98Psxb5cD6Fny9Fupv9LrDSPTQZUROqjvZmcCqNu4UMl7qqhlUUGpwiAkotj6GYu4SZdcr/nLw==} - cpu: [x64] - os: [win32] - '@swc/core-darwin-arm64@1.11.13': resolution: {integrity: sha512-loSERhLaQ9XDS+5Kdx8cLe2tM1G0HLit8MfehipAcsdctpo79zrRlkW34elOf3tQoVPKUItV0b/rTuhjj8NtHg==} engines: {node: '>=10'} @@ -1809,9 +1785,6 @@ packages: '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} - '@types/estree@1.0.7': - resolution: {integrity: sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==} - '@types/fs-extra@11.0.4': resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} @@ -2013,6 +1986,11 @@ packages: cpu: [x64] os: [win32] + '@valibot/to-json-schema@1.0.0': + resolution: {integrity: sha512-/9crJgPptVsGCL6X+JPDQyaJwkalSZ/52WuF8DiRUxJgcmpNdzYRfZ+gqMEP8W3CTVfuMWPqqvIgfwJ97f9Etw==} + peerDependencies: + valibot: ^1.0.0 + '@vitejs/release-scripts@1.3.2': resolution: {integrity: sha512-g4jaMHxdjPiGlFV8qSq8EaE3SYtLHeEGGfmVASvJ+mn+W0kKH0nDXO3u9RR25zVbW9ooamQcpEAx2fTMhlwvkg==} @@ -2379,6 +2357,10 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + detect-libc@2.0.3: + resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} + engines: {node: '>=8'} + devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} @@ -2651,14 +2633,12 @@ packages: peerDependencies: react: '*' react-router-dom: '*' - vite: '>=3' generouted@1.20.0: resolution: {integrity: sha512-VXU5dFsWdm/faFo2fTGW5obYxy8hhM6B1WXYhCLAV+5pODhrsu8RBc/1IsOQKqtHFYqsuSE5C5KpzmBaLllUqg==} peerDependencies: react: '*' react-router-dom: '*' - vite: '>=5' gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} @@ -2896,6 +2876,70 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} + lightningcss-darwin-arm64@1.29.3: + resolution: {integrity: sha512-fb7raKO3pXtlNbQbiMeEu8RbBVHnpyqAoxTyTRMEWFQWmscGC2wZxoHzZ+YKAepUuKT9uIW5vL2QbFivTgprZg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.29.3: + resolution: {integrity: sha512-KF2XZ4ZdmDGGtEYmx5wpzn6u8vg7AdBHaEOvDKu8GOs7xDL/vcU2vMKtTeNe1d4dogkDdi3B9zC77jkatWBwEQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.29.3: + resolution: {integrity: sha512-VUWeVf+V1UM54jv9M4wen9vMlIAyT69Krl9XjI8SsRxz4tdNV/7QEPlW6JASev/pYdiynUCW0pwaFquDRYdxMw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.29.3: + resolution: {integrity: sha512-UhgZ/XVNfXQVEJrMIWeK1Laj8KbhjbIz7F4znUk7G4zeGw7TRoJxhb66uWrEsonn1+O45w//0i0Fu0wIovYdYg==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.29.3: + resolution: {integrity: sha512-Pqau7jtgJNmQ/esugfmAT1aCFy/Gxc92FOxI+3n+LbMHBheBnk41xHDhc0HeYlx9G0xP5tK4t0Koy3QGGNqypw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-arm64-musl@1.29.3: + resolution: {integrity: sha512-dxakOk66pf7KLS7VRYFO7B8WOJLecE5OPL2YOk52eriFd/yeyxt2Km5H0BjLfElokIaR+qWi33gB8MQLrdAY3A==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-x64-gnu@1.29.3: + resolution: {integrity: sha512-ySZTNCpbfbK8rqpKJeJR2S0g/8UqqV3QnzcuWvpI60LWxnFN91nxpSSwCbzfOXkzKfar9j5eOuOplf+klKtINg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-linux-x64-musl@1.29.3: + resolution: {integrity: sha512-3pVZhIzW09nzi10usAXfIGTTSTYQ141dk88vGFNCgawIzayiIzZQxEcxVtIkdvlEq2YuFsL9Wcj/h61JHHzuFQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-win32-arm64-msvc@1.29.3: + resolution: {integrity: sha512-VRnkAvtIkeWuoBJeGOTrZxsNp4HogXtcaaLm8agmbYtLDOhQdpgxW6NjZZjDXbvGF+eOehGulXZ3C1TiwHY4QQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.29.3: + resolution: {integrity: sha512-IszwRPu2cPnDQsZpd7/EAr0x2W7jkaWqQ1SwCVIZ/tSbZVXPLt6k8s6FkcyBjViCzvB5CW0We0QbbP7zp2aBjQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.29.3: + resolution: {integrity: sha512-GlOJwTIP6TMIlrTFsxTerwC0W6OpQpCGuX1ECRLBUVRh6fpJH3xTqjCjRgQHTb4ZXexH9rtHou1Lf03GKzmhhQ==} + engines: {node: '>= 12.0.0'} + lilconfig@3.1.2: resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} engines: {node: '>=14'} @@ -3620,6 +3664,55 @@ packages: rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + rolldown-vite@6.3.0-beta.5: + resolution: {integrity: sha512-/seCUlTV3pHNn0Y8qveGmHMNYxH/Z9xc65Ov0uaA/HtThaMZNTacWsMyDG4SA+S/c1RdpWIe85E5NeOmhywrGg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + esbuild: ^0.25.0 + jiti: '>=1.21.0' + less: '*' + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + rolldown@1.0.0-beta.7-commit.e117288: + resolution: {integrity: sha512-3pjhtA9BV/q9cNdcz75ehvie3lgFfJZfzIT8A7aZJPvFCaWTj5AUAlcExXRWO/CIMMZ/49Y1x3MTwRC/Q/LuAw==} + hasBin: true + peerDependencies: + '@oxc-project/runtime': 0.61.2 + peerDependenciesMeta: + '@oxc-project/runtime': + optional: true + rollup-plugin-dts@6.2.1: resolution: {integrity: sha512-sR3CxYUl7i2CHa0O7bA45mCrgADyAQ0tVtGSqi3yvH28M+eg1+g5d7kQ9hLvEz5dorK3XVsH5L2jwHLQf72DzA==} engines: {node: '>=16'} @@ -3632,11 +3725,6 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - rollup@4.38.0: - resolution: {integrity: sha512-5SsIRtJy9bf1ErAOiFMFzl64Ex9X5V7bnJ+WlFMb+zmP459OSWCEG7b0ERZ+PEU7xPt4OG3RHbrp1LJlXxYTrw==} - engines: {node: '>=18.0.0', npm: '>=8.0.0'} - hasBin: true - rspack-resolver@1.3.0: resolution: {integrity: sha512-az/PLDwa1xijNv4bAFBS8mtqqJC1Y3lVyFag4cuyIUOHq/ft5kSZlHbqYaLZLpsQtPWv4ZGDo5ycySKJzUvU/A==} @@ -3944,6 +4032,14 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + valibot@1.0.0: + resolution: {integrity: sha512-1Hc0ihzWxBar6NGeZv7fPLY0QuxFMyxwYR2sF1Blu7Wq7EnremwY2W02tit2ij2VJT8HcSkHAQqmFfl77f73Yw==} + peerDependencies: + typescript: '>=5' + peerDependenciesMeta: + typescript: + optional: true + vfile-message@4.0.2: resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} @@ -3955,86 +4051,6 @@ packages: engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true - vite@6.2.3: - resolution: {integrity: sha512-IzwM54g4y9JA/xAeBPNaDXiBF8Jsgl3VBQ2YQ/wOY6fyW3xMdSoltIV3Bo59DErdqdE6RxUfv8W69DvUorE4Eg==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - jiti: '>=1.21.0' - less: '*' - lightningcss: ^1.21.0 - sass: '*' - sass-embedded: '*' - stylus: '*' - sugarss: '*' - terser: ^5.16.0 - tsx: ^4.8.1 - yaml: ^2.4.2 - peerDependenciesMeta: - '@types/node': - optional: true - jiti: - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - tsx: - optional: true - yaml: - optional: true - - vite@6.2.4: - resolution: {integrity: sha512-veHMSew8CcRzhL5o8ONjy8gkfmFJAd5Ac16oxBUjlwgX3Gq2Wqr+qNC3TjPIpy7TPV/KporLga5GT9HqdrCizw==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - jiti: '>=1.21.0' - less: '*' - lightningcss: ^1.21.0 - sass: '*' - sass-embedded: '*' - stylus: '*' - sugarss: '*' - terser: ^5.16.0 - tsx: ^4.8.1 - yaml: ^2.4.2 - peerDependenciesMeta: - '@types/node': - optional: true - jiti: - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - tsx: - optional: true - yaml: - optional: true - vitest@3.0.5: resolution: {integrity: sha512-4dof+HvqONw9bvsYxtkfUp2uHsTN9bV2CZIi1pWgoFpL1Lld8LA1ka9q/ONSsoScAKG7NVGf2stJTI7XRkXb2Q==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} @@ -4700,15 +4716,27 @@ snapshots: '@eslint/core': 0.12.0 levn: 0.4.1 - '@generouted/react-router@1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1))': + '@generouted/react-router@1.20.0(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1)': dependencies: fast-glob: 3.3.3 - generouted: 1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) + generouted: 1.20.0(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) react: 19.1.0 react-router: 7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - vite: 6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) transitivePeerDependencies: + - '@types/node' + - esbuild + - jiti + - less - react-router-dom + - sass + - sass-embedded + - stylus + - sugarss + - terser + - tsx + - typescript + - yaml '@humanfs/core@0.19.1': {} @@ -4768,11 +4796,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@mdx-js/rollup@3.1.0(rollup@4.38.0)': + '@mdx-js/rollup@3.1.0(rollup@4.37.0)': dependencies: '@mdx-js/mdx': 3.0.0 - '@rollup/pluginutils': 5.1.0(rollup@4.38.0) - rollup: 4.38.0 + '@rollup/pluginutils': 5.1.0(rollup@4.37.0) + rollup: 4.37.0 source-map: 0.7.4 vfile: 6.0.1 transitivePeerDependencies: @@ -4797,12 +4825,54 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 + '@oxc-project/runtime@0.61.2': {} + + '@oxc-project/types@0.61.2': {} + '@playwright/test@1.51.1': dependencies: playwright: 1.51.1 '@publint/pack@0.1.2': {} + '@rolldown/binding-darwin-arm64@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.7-commit.e117288': + dependencies: + '@napi-rs/wasm-runtime': 0.2.7 + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.7-commit.e117288': + optional: true + '@rollup/plugin-alias@5.1.1(rollup@4.37.0)': optionalDependencies: rollup: 4.37.0 @@ -4842,13 +4912,13 @@ snapshots: optionalDependencies: rollup: 4.37.0 - '@rollup/pluginutils@5.1.0(rollup@4.38.0)': + '@rollup/pluginutils@5.1.0(rollup@4.37.0)': dependencies: '@types/estree': 1.0.6 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 4.38.0 + rollup: 4.37.0 '@rollup/pluginutils@5.1.4(rollup@4.37.0)': dependencies: @@ -4861,123 +4931,63 @@ snapshots: '@rollup/rollup-android-arm-eabi@4.37.0': optional: true - '@rollup/rollup-android-arm-eabi@4.38.0': - optional: true - '@rollup/rollup-android-arm64@4.37.0': optional: true - '@rollup/rollup-android-arm64@4.38.0': - optional: true - '@rollup/rollup-darwin-arm64@4.37.0': optional: true - '@rollup/rollup-darwin-arm64@4.38.0': - optional: true - '@rollup/rollup-darwin-x64@4.37.0': optional: true - '@rollup/rollup-darwin-x64@4.38.0': - optional: true - '@rollup/rollup-freebsd-arm64@4.37.0': optional: true - '@rollup/rollup-freebsd-arm64@4.38.0': - optional: true - '@rollup/rollup-freebsd-x64@4.37.0': optional: true - '@rollup/rollup-freebsd-x64@4.38.0': - optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.37.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.38.0': - optional: true - '@rollup/rollup-linux-arm-musleabihf@4.37.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.38.0': - optional: true - '@rollup/rollup-linux-arm64-gnu@4.37.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.38.0': - optional: true - '@rollup/rollup-linux-arm64-musl@4.37.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.38.0': - optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.37.0': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.38.0': - optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.37.0': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.38.0': - optional: true - '@rollup/rollup-linux-riscv64-gnu@4.37.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.38.0': - optional: true - '@rollup/rollup-linux-riscv64-musl@4.37.0': optional: true - '@rollup/rollup-linux-riscv64-musl@4.38.0': - optional: true - '@rollup/rollup-linux-s390x-gnu@4.37.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.38.0': - optional: true - '@rollup/rollup-linux-x64-gnu@4.37.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.38.0': - optional: true - '@rollup/rollup-linux-x64-musl@4.37.0': optional: true - '@rollup/rollup-linux-x64-musl@4.38.0': - optional: true - '@rollup/rollup-win32-arm64-msvc@4.37.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.38.0': - optional: true - '@rollup/rollup-win32-ia32-msvc@4.37.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.38.0': - optional: true - '@rollup/rollup-win32-x64-msvc@4.37.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.38.0': - optional: true - '@swc/core-darwin-arm64@1.11.13': optional: true @@ -5084,8 +5094,6 @@ snapshots: '@types/estree@1.0.6': {} - '@types/estree@1.0.7': {} - '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 @@ -5296,6 +5304,14 @@ snapshots: '@unrs/rspack-resolver-binding-win32-x64-msvc@1.3.0': optional: true + '@valibot/to-json-schema@1.0.0(valibot@1.0.0(typescript@5.7.2))': + dependencies: + valibot: 1.0.0(typescript@5.7.2) + + '@valibot/to-json-schema@1.0.0(valibot@1.0.0(typescript@5.8.2))': + dependencies: + valibot: 1.0.0(typescript@5.8.2) + '@vitejs/release-scripts@1.3.2': dependencies: execa: 8.0.1 @@ -5321,13 +5337,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 2.0.0 - '@vitest/mocker@3.0.5(vite@6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1))': + '@vitest/mocker@3.0.5(rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1))': dependencies: '@vitest/spy': 3.0.5 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) '@vitest/pretty-format@3.0.5': dependencies: @@ -5671,6 +5687,8 @@ snapshots: dequal@2.0.3: {} + detect-libc@2.0.3: {} + devlop@1.1.0: dependencies: dequal: 2.0.3 @@ -6068,17 +6086,43 @@ snapshots: function-bind@1.1.2: {} - generouted@1.11.7(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)): + generouted@1.11.7(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1): dependencies: react: 19.1.0 react-router-dom: 7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - vite: 6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + transitivePeerDependencies: + - '@types/node' + - esbuild + - jiti + - less + - sass + - sass-embedded + - stylus + - sugarss + - terser + - tsx + - typescript + - yaml - generouted@1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)): + generouted@1.20.0(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1): dependencies: react: 19.1.0 react-router-dom: 7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - vite: 6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + transitivePeerDependencies: + - '@types/node' + - esbuild + - jiti + - less + - sass + - sass-embedded + - stylus + - sugarss + - terser + - tsx + - typescript + - yaml gensync@1.0.0-beta.2: {} @@ -6306,6 +6350,51 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 + lightningcss-darwin-arm64@1.29.3: + optional: true + + lightningcss-darwin-x64@1.29.3: + optional: true + + lightningcss-freebsd-x64@1.29.3: + optional: true + + lightningcss-linux-arm-gnueabihf@1.29.3: + optional: true + + lightningcss-linux-arm64-gnu@1.29.3: + optional: true + + lightningcss-linux-arm64-musl@1.29.3: + optional: true + + lightningcss-linux-x64-gnu@1.29.3: + optional: true + + lightningcss-linux-x64-musl@1.29.3: + optional: true + + lightningcss-win32-arm64-msvc@1.29.3: + optional: true + + lightningcss-win32-x64-msvc@1.29.3: + optional: true + + lightningcss@1.29.3: + dependencies: + detect-libc: 2.0.3 + optionalDependencies: + lightningcss-darwin-arm64: 1.29.3 + lightningcss-darwin-x64: 1.29.3 + lightningcss-freebsd-x64: 1.29.3 + lightningcss-linux-arm-gnueabihf: 1.29.3 + lightningcss-linux-arm64-gnu: 1.29.3 + lightningcss-linux-arm64-musl: 1.29.3 + lightningcss-linux-x64-gnu: 1.29.3 + lightningcss-linux-x64-musl: 1.29.3 + lightningcss-win32-arm64-msvc: 1.29.3 + lightningcss-win32-x64-msvc: 1.29.3 + lilconfig@3.1.2: {} lines-and-columns@1.2.4: {} @@ -7210,6 +7299,104 @@ snapshots: rfdc@1.4.1: {} + rolldown-vite@6.3.0-beta.5(@types/node@22.13.10)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1): + dependencies: + '@oxc-project/runtime': 0.61.2 + lightningcss: 1.29.3 + picomatch: 4.0.2 + postcss: 8.5.3 + rolldown: 1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.8.2) + tinyglobby: 0.2.12 + optionalDependencies: + '@types/node': 22.13.10 + esbuild: 0.25.2 + fsevents: 2.3.3 + jiti: 2.4.2 + tsx: 4.19.2 + yaml: 2.5.1 + transitivePeerDependencies: + - typescript + + rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1): + dependencies: + '@oxc-project/runtime': 0.61.2 + lightningcss: 1.29.3 + picomatch: 4.0.2 + postcss: 8.5.3 + rolldown: 1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.7.2) + tinyglobby: 0.2.12 + optionalDependencies: + '@types/node': 22.13.15 + esbuild: 0.25.2 + fsevents: 2.3.3 + jiti: 2.4.2 + tsx: 4.19.2 + yaml: 2.5.1 + transitivePeerDependencies: + - typescript + + rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1): + dependencies: + '@oxc-project/runtime': 0.61.2 + lightningcss: 1.29.3 + picomatch: 4.0.2 + postcss: 8.5.3 + rolldown: 1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.8.2) + tinyglobby: 0.2.12 + optionalDependencies: + '@types/node': 22.13.15 + esbuild: 0.25.2 + fsevents: 2.3.3 + jiti: 2.4.2 + tsx: 4.19.2 + yaml: 2.5.1 + transitivePeerDependencies: + - typescript + + rolldown@1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.7.2): + dependencies: + '@oxc-project/types': 0.61.2 + '@valibot/to-json-schema': 1.0.0(valibot@1.0.0(typescript@5.7.2)) + valibot: 1.0.0(typescript@5.7.2) + optionalDependencies: + '@oxc-project/runtime': 0.61.2 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-darwin-x64': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.7-commit.e117288 + transitivePeerDependencies: + - typescript + + rolldown@1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.8.2): + dependencies: + '@oxc-project/types': 0.61.2 + '@valibot/to-json-schema': 1.0.0(valibot@1.0.0(typescript@5.8.2)) + valibot: 1.0.0(typescript@5.8.2) + optionalDependencies: + '@oxc-project/runtime': 0.61.2 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-darwin-x64': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.7-commit.e117288 + transitivePeerDependencies: + - typescript + rollup-plugin-dts@6.2.1(rollup@4.37.0)(typescript@5.8.2): dependencies: magic-string: 0.30.17 @@ -7244,32 +7431,6 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.37.0 fsevents: 2.3.3 - rollup@4.38.0: - dependencies: - '@types/estree': 1.0.7 - optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.38.0 - '@rollup/rollup-android-arm64': 4.38.0 - '@rollup/rollup-darwin-arm64': 4.38.0 - '@rollup/rollup-darwin-x64': 4.38.0 - '@rollup/rollup-freebsd-arm64': 4.38.0 - '@rollup/rollup-freebsd-x64': 4.38.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.38.0 - '@rollup/rollup-linux-arm-musleabihf': 4.38.0 - '@rollup/rollup-linux-arm64-gnu': 4.38.0 - '@rollup/rollup-linux-arm64-musl': 4.38.0 - '@rollup/rollup-linux-loongarch64-gnu': 4.38.0 - '@rollup/rollup-linux-powerpc64le-gnu': 4.38.0 - '@rollup/rollup-linux-riscv64-gnu': 4.38.0 - '@rollup/rollup-linux-riscv64-musl': 4.38.0 - '@rollup/rollup-linux-s390x-gnu': 4.38.0 - '@rollup/rollup-linux-x64-gnu': 4.38.0 - '@rollup/rollup-linux-x64-musl': 4.38.0 - '@rollup/rollup-win32-arm64-msvc': 4.38.0 - '@rollup/rollup-win32-ia32-msvc': 4.38.0 - '@rollup/rollup-win32-x64-msvc': 4.38.0 - fsevents: 2.3.3 - rspack-resolver@1.3.0: optionalDependencies: '@unrs/rspack-resolver-binding-darwin-arm64': 1.3.0 @@ -7602,6 +7763,14 @@ snapshots: util-deprecate@1.0.2: {} + valibot@1.0.0(typescript@5.7.2): + optionalDependencies: + typescript: 5.7.2 + + valibot@1.0.0(typescript@5.8.2): + optionalDependencies: + typescript: 5.8.2 + vfile-message@4.0.2: dependencies: '@types/unist': 3.0.2 @@ -7613,18 +7782,18 @@ snapshots: unist-util-stringify-position: 4.0.0 vfile-message: 4.0.2 - vite-node@3.0.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): + vite-node@3.0.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1): dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.6.0 pathe: 2.0.2 - vite: 6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) transitivePeerDependencies: - '@types/node' + - esbuild - jiti - less - - lightningcss - sass - sass-embedded - stylus @@ -7632,36 +7801,13 @@ snapshots: - supports-color - terser - tsx + - typescript - yaml - vite@6.2.3(@types/node@22.13.10)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): - dependencies: - esbuild: 0.25.2 - postcss: 8.5.3 - rollup: 4.37.0 - optionalDependencies: - '@types/node': 22.13.10 - fsevents: 2.3.3 - jiti: 2.4.2 - tsx: 4.19.2 - yaml: 2.5.1 - - vite@6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): - dependencies: - esbuild: 0.25.2 - postcss: 8.5.3 - rollup: 4.38.0 - optionalDependencies: - '@types/node': 22.13.15 - fsevents: 2.3.3 - jiti: 2.4.2 - tsx: 4.19.2 - yaml: 2.5.1 - - vitest@3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): + vitest@3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1): dependencies: '@vitest/expect': 3.0.5 - '@vitest/mocker': 3.0.5(vite@6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) + '@vitest/mocker': 3.0.5(rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1)) '@vitest/pretty-format': 3.0.5 '@vitest/runner': 3.0.5 '@vitest/snapshot': 3.0.5 @@ -7677,16 +7823,16 @@ snapshots: tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 2.0.0 - vite: 6.2.4(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) - vite-node: 3.0.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + vite-node: 3.0.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) why-is-node-running: 2.3.0 optionalDependencies: '@types/debug': 4.1.12 '@types/node': 22.13.15 transitivePeerDependencies: + - esbuild - jiti - less - - lightningcss - msw - sass - sass-embedded @@ -7695,6 +7841,7 @@ snapshots: - supports-color - terser - tsx + - typescript - yaml web-streams-polyfill@3.2.1: {} From e9cfe69f795229d19c5ebb09db2f9b3c803c5ab0 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Thu, 3 Apr 2025 21:05:32 +0900 Subject: [PATCH 03/18] chore: fix types --- packages/plugin-react-oxc/package.json | 1 + playground/compiler-react-18/vite.config.ts | 1 + playground/compiler/vite.config.ts | 1 + playground/react-classic/vite.config.ts | 1 + playground/react-emotion/vite.config.ts | 1 + playground/react-sourcemap/vite.config.ts | 1 + 6 files changed, 6 insertions(+) diff --git a/packages/plugin-react-oxc/package.json b/packages/plugin-react-oxc/package.json index 416f3a7ed..8a9f8d9d0 100644 --- a/packages/plugin-react-oxc/package.json +++ b/packages/plugin-react-oxc/package.json @@ -11,6 +11,7 @@ "dist" ], "type": "module", + "types": "./dist/index.d.mts", "exports": "./dist/index.mjs", "scripts": { "dev": "unbuild --stub", diff --git a/playground/compiler-react-18/vite.config.ts b/playground/compiler-react-18/vite.config.ts index ec85482a1..01a111d91 100644 --- a/playground/compiler-react-18/vite.config.ts +++ b/playground/compiler-react-18/vite.config.ts @@ -7,6 +7,7 @@ export default defineConfig(({ command }) => { server: { port: 8901 /* Should be unique */ }, plugins: [ react({ + // @ts-expect-error babel plugins are not supported babel: { plugins: [['babel-plugin-react-compiler', { target: '18' }]], }, diff --git a/playground/compiler/vite.config.ts b/playground/compiler/vite.config.ts index a8bffc7a0..9993930ee 100644 --- a/playground/compiler/vite.config.ts +++ b/playground/compiler/vite.config.ts @@ -10,6 +10,7 @@ export default defineConfig(({ command }) => { return { server: { port: 8900 /* Should be unique */ }, + // @ts-expect-error babel plugins are not supported plugins: [react({ babel: { plugins: babelPlugins } })], } }) diff --git a/playground/react-classic/vite.config.ts b/playground/react-classic/vite.config.ts index 530e397d8..305b5c8fe 100644 --- a/playground/react-classic/vite.config.ts +++ b/playground/react-classic/vite.config.ts @@ -5,6 +5,7 @@ const config: UserConfig = { server: { port: 8903 /* Should be unique */ }, plugins: [ react({ + // @ts-expect-error classic jsx runtime is not supported jsxRuntime: 'classic', }), ], diff --git a/playground/react-emotion/vite.config.ts b/playground/react-emotion/vite.config.ts index 3c0aa96b7..879d1f3ad 100644 --- a/playground/react-emotion/vite.config.ts +++ b/playground/react-emotion/vite.config.ts @@ -6,6 +6,7 @@ export default defineConfig({ plugins: [ react({ jsxImportSource: '@emotion/react', + // @ts-expect-error babel plugins are not supported babel: { plugins: ['@emotion/babel-plugin'], }, diff --git a/playground/react-sourcemap/vite.config.ts b/playground/react-sourcemap/vite.config.ts index 42cc217ed..c2f7f4e66 100644 --- a/playground/react-sourcemap/vite.config.ts +++ b/playground/react-sourcemap/vite.config.ts @@ -5,6 +5,7 @@ const config: UserConfig = { server: { port: 8906 /* Should be unique */ }, plugins: [ react({ + // @ts-expect-error classic runtime is not supported jsxRuntime: process.env.USE_CLASSIC === '1' ? 'classic' : 'automatic', }), ], From 12158ce381fe4d42414626696d41eca57937b4e0 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Thu, 3 Apr 2025 21:09:34 +0900 Subject: [PATCH 04/18] chore: add oxc plugin to issue templates --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 ++ .github/ISSUE_TEMPLATE/feature_request.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index c39606925..ca1aad91f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -17,6 +17,8 @@ body: [plugin-react](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react) - label: | [plugin-react-swc](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-swc) + - label: | + [plugin-react-oxc](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-oxc) - type: textarea id: bug-description attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index fd4c1c082..453e70e6d 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -17,6 +17,8 @@ body: [plugin-react](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react) - label: | [plugin-react-swc](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-swc) + - label: | + [plugin-react-oxc](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-oxc) - type: textarea id: feature-description attributes: From 26479d984278bf50926c5b47205ce66218662839 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Fri, 4 Apr 2025 12:01:00 +0900 Subject: [PATCH 05/18] chore: revert overrides --- package.json | 4 - playground/compiler-react-18/vite.config.ts | 1 - playground/compiler/vite.config.ts | 1 - playground/react-classic/vite.config.ts | 1 - playground/react-emotion/vite.config.ts | 1 - playground/react-sourcemap/vite.config.ts | 1 - pnpm-lock.yaml | 607 ++++---------------- 7 files changed, 112 insertions(+), 504 deletions(-) diff --git a/package.json b/package.json index c890993bb..3e41effaf 100644 --- a/package.json +++ b/package.json @@ -78,10 +78,6 @@ "react-router-dom": "*" } } - }, - "overrides": { - "vite": "npm:rolldown-vite@6.3.0-beta.5", - "@vitejs/plugin-react": "workspace:@vitejs/plugin-react-oxc@*" } } } diff --git a/playground/compiler-react-18/vite.config.ts b/playground/compiler-react-18/vite.config.ts index 01a111d91..ec85482a1 100644 --- a/playground/compiler-react-18/vite.config.ts +++ b/playground/compiler-react-18/vite.config.ts @@ -7,7 +7,6 @@ export default defineConfig(({ command }) => { server: { port: 8901 /* Should be unique */ }, plugins: [ react({ - // @ts-expect-error babel plugins are not supported babel: { plugins: [['babel-plugin-react-compiler', { target: '18' }]], }, diff --git a/playground/compiler/vite.config.ts b/playground/compiler/vite.config.ts index 9993930ee..a8bffc7a0 100644 --- a/playground/compiler/vite.config.ts +++ b/playground/compiler/vite.config.ts @@ -10,7 +10,6 @@ export default defineConfig(({ command }) => { return { server: { port: 8900 /* Should be unique */ }, - // @ts-expect-error babel plugins are not supported plugins: [react({ babel: { plugins: babelPlugins } })], } }) diff --git a/playground/react-classic/vite.config.ts b/playground/react-classic/vite.config.ts index 305b5c8fe..530e397d8 100644 --- a/playground/react-classic/vite.config.ts +++ b/playground/react-classic/vite.config.ts @@ -5,7 +5,6 @@ const config: UserConfig = { server: { port: 8903 /* Should be unique */ }, plugins: [ react({ - // @ts-expect-error classic jsx runtime is not supported jsxRuntime: 'classic', }), ], diff --git a/playground/react-emotion/vite.config.ts b/playground/react-emotion/vite.config.ts index 879d1f3ad..3c0aa96b7 100644 --- a/playground/react-emotion/vite.config.ts +++ b/playground/react-emotion/vite.config.ts @@ -6,7 +6,6 @@ export default defineConfig({ plugins: [ react({ jsxImportSource: '@emotion/react', - // @ts-expect-error babel plugins are not supported babel: { plugins: ['@emotion/babel-plugin'], }, diff --git a/playground/react-sourcemap/vite.config.ts b/playground/react-sourcemap/vite.config.ts index c2f7f4e66..42cc217ed 100644 --- a/playground/react-sourcemap/vite.config.ts +++ b/playground/react-sourcemap/vite.config.ts @@ -5,7 +5,6 @@ const config: UserConfig = { server: { port: 8906 /* Should be unique */ }, plugins: [ react({ - // @ts-expect-error classic runtime is not supported jsxRuntime: process.env.USE_CLASSIC === '1' ? 'classic' : 'automatic', }), ], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0718e7f24..981e21b81 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,10 +4,6 @@ settings: autoInstallPeers: false excludeLinksFromLockfile: false -overrides: - vite: npm:rolldown-vite@6.3.0-beta.5 - '@vitejs/plugin-react': workspace:@vitejs/plugin-react-oxc@* - packageExtensionsChecksum: sha256-S82yCctxnlOTNFuHWCyTFRo/B6Y3jque/4DnsDO4WZA= importers: @@ -69,11 +65,11 @@ importers: specifier: ^8.26.1 version: 8.29.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.7.2) vite: - specifier: npm:rolldown-vite@6.3.0-beta.5 - version: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + specifier: ^6.0.0 + version: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) vitest: specifier: ^3.0.4 - version: 3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + version: 3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) packages/plugin-react: dependencies: @@ -92,9 +88,6 @@ importers: react-refresh: specifier: ^0.14.2 version: 0.14.2 - vite: - specifier: npm:rolldown-vite@6.3.0-beta.5 - version: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1) devDependencies: unbuild: specifier: ^3.5.0 @@ -105,9 +98,6 @@ importers: react-refresh: specifier: ^0.14.2 version: 0.14.2 - vite: - specifier: npm:rolldown-vite@6.3.0-beta.5 - version: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1) devDependencies: unbuild: specifier: ^3.5.0 @@ -118,9 +108,6 @@ importers: '@swc/core': specifier: ^1.11.11 version: 1.11.13 - vite: - specifier: npm:rolldown-vite@6.3.0-beta.5 - version: rolldown-vite@6.3.0-beta.5(@types/node@22.13.10)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1) devDependencies: '@playwright/test': specifier: ^1.51.1 @@ -149,6 +136,9 @@ importers: typescript: specifier: ^5.8.2 version: 5.8.2 + vite: + specifier: ^6.2.2 + version: 6.2.5(@types/node@22.13.10)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) packages/plugin-react-swc/playground/base-path: dependencies: @@ -374,10 +364,10 @@ importers: dependencies: '@generouted/react-router': specifier: ^1.20.0 - version: 1.20.0(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + version: 1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) generouted: specifier: 1.11.7 - version: 1.11.7(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + version: 1.11.7(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) react: specifier: ^19.0.0 version: 19.1.0 @@ -442,8 +432,8 @@ importers: specifier: ^18.3.1 version: 18.3.1 '@vitejs/plugin-react': - specifier: workspace:@vitejs/plugin-react-oxc@* - version: link:../../packages/plugin-react-oxc + specifier: workspace:* + version: link:../../packages/plugin-react playground/compiler: dependencies: @@ -464,8 +454,8 @@ importers: specifier: ^18.3.1 version: 18.3.1 '@vitejs/plugin-react': - specifier: workspace:@vitejs/plugin-react-oxc@* - version: link:../../packages/plugin-react-oxc + specifier: workspace:* + version: link:../../packages/plugin-react babel-plugin-react-compiler: specifier: 0.0.0-experimental-dc8bd44-20241121 version: 0.0.0-experimental-dc8bd44-20241121 @@ -495,8 +485,8 @@ importers: specifier: ^18.3.1 version: 18.3.1 '@vitejs/plugin-react': - specifier: workspace:@vitejs/plugin-react-oxc@* - version: link:../../packages/plugin-react-oxc + specifier: workspace:* + version: link:../../packages/plugin-react babel-plugin-react-compiler: specifier: 0.0.0-experimental-dc8bd44-20241121 version: 0.0.0-experimental-dc8bd44-20241121 @@ -523,8 +513,8 @@ importers: specifier: ^18.3.1 version: 18.3.1 '@vitejs/plugin-react': - specifier: workspace:@vitejs/plugin-react-oxc@* - version: link:../../packages/plugin-react-oxc + specifier: workspace:* + version: link:../../packages/plugin-react playground/react: dependencies: @@ -539,8 +529,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@vitejs/plugin-react': - specifier: workspace:@vitejs/plugin-react-oxc@* - version: link:../../packages/plugin-react-oxc + specifier: workspace:* + version: link:../../packages/plugin-react playground/react-classic: dependencies: @@ -552,8 +542,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@vitejs/plugin-react': - specifier: workspace:@vitejs/plugin-react-oxc@* - version: link:../../packages/plugin-react-oxc + specifier: workspace:* + version: link:../../packages/plugin-react playground/react-emotion: dependencies: @@ -580,8 +570,8 @@ importers: specifier: ^11.13.5 version: 11.13.5 '@vitejs/plugin-react': - specifier: workspace:@vitejs/plugin-react-oxc@* - version: link:../../packages/plugin-react-oxc + specifier: workspace:* + version: link:../../packages/plugin-react playground/react-env: dependencies: @@ -593,8 +583,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@vitejs/plugin-react': - specifier: workspace:@vitejs/plugin-react-oxc@* - version: link:../../packages/plugin-react-oxc + specifier: workspace:* + version: link:../../packages/plugin-react playground/react-sourcemap: dependencies: @@ -606,8 +596,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@vitejs/plugin-react': - specifier: workspace:@vitejs/plugin-react-oxc@* - version: link:../../packages/plugin-react-oxc + specifier: workspace:* + version: link:../../packages/plugin-react playground/react/jsx-entry: {} @@ -621,8 +611,8 @@ importers: version: 18.3.1(react@18.3.1) devDependencies: '@vitejs/plugin-react': - specifier: workspace:@vitejs/plugin-react-oxc@* - version: link:../../packages/plugin-react-oxc + specifier: workspace:* + version: link:../../packages/plugin-react packages: @@ -1366,6 +1356,7 @@ packages: peerDependencies: react: '>=18' react-router: '>=7' + vite: '>=5' '@humanfs/core@0.19.1': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} @@ -1428,13 +1419,6 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@oxc-project/runtime@0.61.2': - resolution: {integrity: sha512-UNv56Aa4pTtsnqapa2LC+gRxXbUZxA6j1WlSYV8+zan5sD+CvwOMSzUsMNdUUTebob6PafJfT+/TN83yWXWmSA==} - engines: {node: '>=6.9.0'} - - '@oxc-project/types@0.61.2': - resolution: {integrity: sha512-rfuwJwvwn9MRthHNXlSo9Eka/u7gC0MhnWAoX3BhE1+rwPOl22nq0K0Y997Hof0tHCOuD7H3/Z8HTfCVhB4c5Q==} - '@playwright/test@1.51.1': resolution: {integrity: sha512-nM+kEaTSAoVlXmMPH10017vn3FSiFqr/bh4fKg9vmAdMfd9SDqRZNvPSiAHADc/itWak+qPvMPZQOPwCBW7k7Q==} engines: {node: '>=18'} @@ -1444,66 +1428,6 @@ packages: resolution: {integrity: sha512-S+9ANAvUmjutrshV4jZjaiG8XQyuJIZ8a4utWmN/vW1sgQ9IfBnPndwkmQYw53QmouOIytT874u65HEmu6H5jw==} engines: {node: '>=18'} - '@rolldown/binding-darwin-arm64@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-aq6Y9OQl05bYUnzM4a7ZGF3+Du7cdrw3Ala1eCnvNqxgi2ksXKN+LHvgeaWDlyfLgX0jVQFZre4+kzgLSHEMog==} - cpu: [arm64] - os: [darwin] - - '@rolldown/binding-darwin-x64@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-GRxENhaf92Blo7TZz8C8vBFSt4pCRWDP45ElGATItWqzyM+ILtzNjkE5Wj1OyWPe7y0oWxps6YMxVxEdb3/BJQ==} - cpu: [x64] - os: [darwin] - - '@rolldown/binding-freebsd-x64@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-3uibg1KMHT7c149YupfXICxKoO6K7q3MaMpvOdxUjTY9mY3+v96eHTfnq+dd6qD16ppKSVij7FfpEC+sCVDRmg==} - cpu: [x64] - os: [freebsd] - - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-oDFqE2fWx2sj0E9doRUmYxi5TKc9/vmD49NP0dUN578LQO8nJBwqOMvE8bM3a/T3or4g1mlJt2ebzGiKGzjHSw==} - cpu: [arm] - os: [linux] - - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-0Weogg1WiFNkmwznM4YS4AmDa55miGstb/I4zKquIsv1kSBLBkxboifgWTCPUnGFK7Wy1u/beRnxCY7UVL1oPw==} - cpu: [arm64] - os: [linux] - - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-LwEN10APipzjxAHSreVTEnUAHRz3sq4/UR3IVD/AguV0s6yAbVAsIrvIoxXHKoci+RUlyY5FXICYZQKli8iU5w==} - cpu: [arm64] - os: [linux] - - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-tgE2J4BAQfI0rfoPzS4r1LEHSNxdNSM8l1Ab5InnzE4dXzVw92BVQ/FLFE6L+nWy81O7uwd7yz0Jo+qByOPCXg==} - cpu: [x64] - os: [linux] - - '@rolldown/binding-linux-x64-musl@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-m78svPie3D5PIBxmexztDVHjrnHO5t6h3Lwtl6sqdrio1zhGYMY9FcPcaZZ40mXXWKHFoPmbueBZZLdttvOEIQ==} - cpu: [x64] - os: [linux] - - '@rolldown/binding-wasm32-wasi@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-XbOcOWmdioNZ3hHBb5j96Y9S9pGyTeFZWR5ovMZggA9L7mWft2pMrbx4p5zUy2dCps3l1jaFQCjKuBXpwoCZug==} - engines: {node: '>=14.21.3'} - cpu: [wasm32] - - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-lnZ/wrat6UMWGbS9w5AUEH8WkPBA4EUSYp8cxlspdU16dISeD/KGpF2d0hS6Oa6ftbgZZrRLMEnQRiD8OupPsg==} - cpu: [arm64] - os: [win32] - - '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-F0N/6kAnCl9dOgqR09T60UjQSxKvRtlbImhiYxIdKBFxgYDDGsh8XzlSbMRUVQmMtNwKC8xi+i+SnamSqY6q8Q==} - cpu: [ia32] - os: [win32] - - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.7-commit.e117288': - resolution: {integrity: sha512-T3qKMkSVemlVLLd5V7dCXnjt4Zda1UnUi45AQnmxIf3jH0/VP0J4aYAJiEEaRbhMoHc82j01+6MuZFZUVMeqng==} - cpu: [x64] - os: [win32] - '@rollup/plugin-alias@5.1.1': resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==} engines: {node: '>=14.0.0'} @@ -1986,11 +1910,6 @@ packages: cpu: [x64] os: [win32] - '@valibot/to-json-schema@1.0.0': - resolution: {integrity: sha512-/9crJgPptVsGCL6X+JPDQyaJwkalSZ/52WuF8DiRUxJgcmpNdzYRfZ+gqMEP8W3CTVfuMWPqqvIgfwJ97f9Etw==} - peerDependencies: - valibot: ^1.0.0 - '@vitejs/release-scripts@1.3.2': resolution: {integrity: sha512-g4jaMHxdjPiGlFV8qSq8EaE3SYtLHeEGGfmVASvJ+mn+W0kKH0nDXO3u9RR25zVbW9ooamQcpEAx2fTMhlwvkg==} @@ -2357,10 +2276,6 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} @@ -2633,12 +2548,14 @@ packages: peerDependencies: react: '*' react-router-dom: '*' + vite: '>=3' generouted@1.20.0: resolution: {integrity: sha512-VXU5dFsWdm/faFo2fTGW5obYxy8hhM6B1WXYhCLAV+5pODhrsu8RBc/1IsOQKqtHFYqsuSE5C5KpzmBaLllUqg==} peerDependencies: react: '*' react-router-dom: '*' + vite: '>=5' gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} @@ -2876,70 +2793,6 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - lightningcss-darwin-arm64@1.29.3: - resolution: {integrity: sha512-fb7raKO3pXtlNbQbiMeEu8RbBVHnpyqAoxTyTRMEWFQWmscGC2wZxoHzZ+YKAepUuKT9uIW5vL2QbFivTgprZg==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [darwin] - - lightningcss-darwin-x64@1.29.3: - resolution: {integrity: sha512-KF2XZ4ZdmDGGtEYmx5wpzn6u8vg7AdBHaEOvDKu8GOs7xDL/vcU2vMKtTeNe1d4dogkDdi3B9zC77jkatWBwEQ==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [darwin] - - lightningcss-freebsd-x64@1.29.3: - resolution: {integrity: sha512-VUWeVf+V1UM54jv9M4wen9vMlIAyT69Krl9XjI8SsRxz4tdNV/7QEPlW6JASev/pYdiynUCW0pwaFquDRYdxMw==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [freebsd] - - lightningcss-linux-arm-gnueabihf@1.29.3: - resolution: {integrity: sha512-UhgZ/XVNfXQVEJrMIWeK1Laj8KbhjbIz7F4znUk7G4zeGw7TRoJxhb66uWrEsonn1+O45w//0i0Fu0wIovYdYg==} - engines: {node: '>= 12.0.0'} - cpu: [arm] - os: [linux] - - lightningcss-linux-arm64-gnu@1.29.3: - resolution: {integrity: sha512-Pqau7jtgJNmQ/esugfmAT1aCFy/Gxc92FOxI+3n+LbMHBheBnk41xHDhc0HeYlx9G0xP5tK4t0Koy3QGGNqypw==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [linux] - - lightningcss-linux-arm64-musl@1.29.3: - resolution: {integrity: sha512-dxakOk66pf7KLS7VRYFO7B8WOJLecE5OPL2YOk52eriFd/yeyxt2Km5H0BjLfElokIaR+qWi33gB8MQLrdAY3A==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [linux] - - lightningcss-linux-x64-gnu@1.29.3: - resolution: {integrity: sha512-ySZTNCpbfbK8rqpKJeJR2S0g/8UqqV3QnzcuWvpI60LWxnFN91nxpSSwCbzfOXkzKfar9j5eOuOplf+klKtINg==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [linux] - - lightningcss-linux-x64-musl@1.29.3: - resolution: {integrity: sha512-3pVZhIzW09nzi10usAXfIGTTSTYQ141dk88vGFNCgawIzayiIzZQxEcxVtIkdvlEq2YuFsL9Wcj/h61JHHzuFQ==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [linux] - - lightningcss-win32-arm64-msvc@1.29.3: - resolution: {integrity: sha512-VRnkAvtIkeWuoBJeGOTrZxsNp4HogXtcaaLm8agmbYtLDOhQdpgxW6NjZZjDXbvGF+eOehGulXZ3C1TiwHY4QQ==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [win32] - - lightningcss-win32-x64-msvc@1.29.3: - resolution: {integrity: sha512-IszwRPu2cPnDQsZpd7/EAr0x2W7jkaWqQ1SwCVIZ/tSbZVXPLt6k8s6FkcyBjViCzvB5CW0We0QbbP7zp2aBjQ==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [win32] - - lightningcss@1.29.3: - resolution: {integrity: sha512-GlOJwTIP6TMIlrTFsxTerwC0W6OpQpCGuX1ECRLBUVRh6fpJH3xTqjCjRgQHTb4ZXexH9rtHou1Lf03GKzmhhQ==} - engines: {node: '>= 12.0.0'} - lilconfig@3.1.2: resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} engines: {node: '>=14'} @@ -3664,55 +3517,6 @@ packages: rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - rolldown-vite@6.3.0-beta.5: - resolution: {integrity: sha512-/seCUlTV3pHNn0Y8qveGmHMNYxH/Z9xc65Ov0uaA/HtThaMZNTacWsMyDG4SA+S/c1RdpWIe85E5NeOmhywrGg==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - esbuild: ^0.25.0 - jiti: '>=1.21.0' - less: '*' - sass: '*' - sass-embedded: '*' - stylus: '*' - sugarss: '*' - terser: ^5.16.0 - tsx: ^4.8.1 - yaml: ^2.4.2 - peerDependenciesMeta: - '@types/node': - optional: true - esbuild: - optional: true - jiti: - optional: true - less: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - tsx: - optional: true - yaml: - optional: true - - rolldown@1.0.0-beta.7-commit.e117288: - resolution: {integrity: sha512-3pjhtA9BV/q9cNdcz75ehvie3lgFfJZfzIT8A7aZJPvFCaWTj5AUAlcExXRWO/CIMMZ/49Y1x3MTwRC/Q/LuAw==} - hasBin: true - peerDependencies: - '@oxc-project/runtime': 0.61.2 - peerDependenciesMeta: - '@oxc-project/runtime': - optional: true - rollup-plugin-dts@6.2.1: resolution: {integrity: sha512-sR3CxYUl7i2CHa0O7bA45mCrgADyAQ0tVtGSqi3yvH28M+eg1+g5d7kQ9hLvEz5dorK3XVsH5L2jwHLQf72DzA==} engines: {node: '>=16'} @@ -4032,14 +3836,6 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - valibot@1.0.0: - resolution: {integrity: sha512-1Hc0ihzWxBar6NGeZv7fPLY0QuxFMyxwYR2sF1Blu7Wq7EnremwY2W02tit2ij2VJT8HcSkHAQqmFfl77f73Yw==} - peerDependencies: - typescript: '>=5' - peerDependenciesMeta: - typescript: - optional: true - vfile-message@4.0.2: resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} @@ -4051,6 +3847,46 @@ packages: engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true + vite@6.2.5: + resolution: {integrity: sha512-j023J/hCAa4pRIUH6J9HemwYfjB5llR2Ps0CWeikOtdR8+pAURAk0DoJC5/mm9kd+UgdnIy7d6HE4EAvlYhPhA==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + jiti: '>=1.21.0' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + vitest@3.0.5: resolution: {integrity: sha512-4dof+HvqONw9bvsYxtkfUp2uHsTN9bV2CZIi1pWgoFpL1Lld8LA1ka9q/ONSsoScAKG7NVGf2stJTI7XRkXb2Q==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} @@ -4716,27 +4552,15 @@ snapshots: '@eslint/core': 0.12.0 levn: 0.4.1 - '@generouted/react-router@1.20.0(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1)': + '@generouted/react-router@1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1))': dependencies: fast-glob: 3.3.3 - generouted: 1.20.0(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + generouted: 1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) react: 19.1.0 react-router: 7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) transitivePeerDependencies: - - '@types/node' - - esbuild - - jiti - - less - react-router-dom - - sass - - sass-embedded - - stylus - - sugarss - - terser - - tsx - - typescript - - yaml '@humanfs/core@0.19.1': {} @@ -4825,54 +4649,12 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - '@oxc-project/runtime@0.61.2': {} - - '@oxc-project/types@0.61.2': {} - '@playwright/test@1.51.1': dependencies: playwright: 1.51.1 '@publint/pack@0.1.2': {} - '@rolldown/binding-darwin-arm64@1.0.0-beta.7-commit.e117288': - optional: true - - '@rolldown/binding-darwin-x64@1.0.0-beta.7-commit.e117288': - optional: true - - '@rolldown/binding-freebsd-x64@1.0.0-beta.7-commit.e117288': - optional: true - - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.7-commit.e117288': - optional: true - - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.7-commit.e117288': - optional: true - - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.7-commit.e117288': - optional: true - - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.7-commit.e117288': - optional: true - - '@rolldown/binding-linux-x64-musl@1.0.0-beta.7-commit.e117288': - optional: true - - '@rolldown/binding-wasm32-wasi@1.0.0-beta.7-commit.e117288': - dependencies: - '@napi-rs/wasm-runtime': 0.2.7 - optional: true - - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.7-commit.e117288': - optional: true - - '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.7-commit.e117288': - optional: true - - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.7-commit.e117288': - optional: true - '@rollup/plugin-alias@5.1.1(rollup@4.37.0)': optionalDependencies: rollup: 4.37.0 @@ -5304,14 +5086,6 @@ snapshots: '@unrs/rspack-resolver-binding-win32-x64-msvc@1.3.0': optional: true - '@valibot/to-json-schema@1.0.0(valibot@1.0.0(typescript@5.7.2))': - dependencies: - valibot: 1.0.0(typescript@5.7.2) - - '@valibot/to-json-schema@1.0.0(valibot@1.0.0(typescript@5.8.2))': - dependencies: - valibot: 1.0.0(typescript@5.8.2) - '@vitejs/release-scripts@1.3.2': dependencies: execa: 8.0.1 @@ -5337,13 +5111,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 2.0.0 - '@vitest/mocker@3.0.5(rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1))': + '@vitest/mocker@3.0.5(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1))': dependencies: '@vitest/spy': 3.0.5 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) '@vitest/pretty-format@3.0.5': dependencies: @@ -5687,8 +5461,6 @@ snapshots: dequal@2.0.3: {} - detect-libc@2.0.3: {} - devlop@1.1.0: dependencies: dequal: 2.0.3 @@ -6086,43 +5858,17 @@ snapshots: function-bind@1.1.2: {} - generouted@1.11.7(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1): + generouted@1.11.7(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)): dependencies: react: 19.1.0 react-router-dom: 7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) - transitivePeerDependencies: - - '@types/node' - - esbuild - - jiti - - less - - sass - - sass-embedded - - stylus - - sugarss - - terser - - tsx - - typescript - - yaml + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) - generouted@1.20.0(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1): + generouted@1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)): dependencies: react: 19.1.0 react-router-dom: 7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) - transitivePeerDependencies: - - '@types/node' - - esbuild - - jiti - - less - - sass - - sass-embedded - - stylus - - sugarss - - terser - - tsx - - typescript - - yaml + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) gensync@1.0.0-beta.2: {} @@ -6350,51 +6096,6 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - lightningcss-darwin-arm64@1.29.3: - optional: true - - lightningcss-darwin-x64@1.29.3: - optional: true - - lightningcss-freebsd-x64@1.29.3: - optional: true - - lightningcss-linux-arm-gnueabihf@1.29.3: - optional: true - - lightningcss-linux-arm64-gnu@1.29.3: - optional: true - - lightningcss-linux-arm64-musl@1.29.3: - optional: true - - lightningcss-linux-x64-gnu@1.29.3: - optional: true - - lightningcss-linux-x64-musl@1.29.3: - optional: true - - lightningcss-win32-arm64-msvc@1.29.3: - optional: true - - lightningcss-win32-x64-msvc@1.29.3: - optional: true - - lightningcss@1.29.3: - dependencies: - detect-libc: 2.0.3 - optionalDependencies: - lightningcss-darwin-arm64: 1.29.3 - lightningcss-darwin-x64: 1.29.3 - lightningcss-freebsd-x64: 1.29.3 - lightningcss-linux-arm-gnueabihf: 1.29.3 - lightningcss-linux-arm64-gnu: 1.29.3 - lightningcss-linux-arm64-musl: 1.29.3 - lightningcss-linux-x64-gnu: 1.29.3 - lightningcss-linux-x64-musl: 1.29.3 - lightningcss-win32-arm64-msvc: 1.29.3 - lightningcss-win32-x64-msvc: 1.29.3 - lilconfig@3.1.2: {} lines-and-columns@1.2.4: {} @@ -7299,104 +7000,6 @@ snapshots: rfdc@1.4.1: {} - rolldown-vite@6.3.0-beta.5(@types/node@22.13.10)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1): - dependencies: - '@oxc-project/runtime': 0.61.2 - lightningcss: 1.29.3 - picomatch: 4.0.2 - postcss: 8.5.3 - rolldown: 1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.8.2) - tinyglobby: 0.2.12 - optionalDependencies: - '@types/node': 22.13.10 - esbuild: 0.25.2 - fsevents: 2.3.3 - jiti: 2.4.2 - tsx: 4.19.2 - yaml: 2.5.1 - transitivePeerDependencies: - - typescript - - rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1): - dependencies: - '@oxc-project/runtime': 0.61.2 - lightningcss: 1.29.3 - picomatch: 4.0.2 - postcss: 8.5.3 - rolldown: 1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.7.2) - tinyglobby: 0.2.12 - optionalDependencies: - '@types/node': 22.13.15 - esbuild: 0.25.2 - fsevents: 2.3.3 - jiti: 2.4.2 - tsx: 4.19.2 - yaml: 2.5.1 - transitivePeerDependencies: - - typescript - - rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1): - dependencies: - '@oxc-project/runtime': 0.61.2 - lightningcss: 1.29.3 - picomatch: 4.0.2 - postcss: 8.5.3 - rolldown: 1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.8.2) - tinyglobby: 0.2.12 - optionalDependencies: - '@types/node': 22.13.15 - esbuild: 0.25.2 - fsevents: 2.3.3 - jiti: 2.4.2 - tsx: 4.19.2 - yaml: 2.5.1 - transitivePeerDependencies: - - typescript - - rolldown@1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.7.2): - dependencies: - '@oxc-project/types': 0.61.2 - '@valibot/to-json-schema': 1.0.0(valibot@1.0.0(typescript@5.7.2)) - valibot: 1.0.0(typescript@5.7.2) - optionalDependencies: - '@oxc-project/runtime': 0.61.2 - '@rolldown/binding-darwin-arm64': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-darwin-x64': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-freebsd-x64': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-linux-x64-musl': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-wasm32-wasi': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.7-commit.e117288 - transitivePeerDependencies: - - typescript - - rolldown@1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.8.2): - dependencies: - '@oxc-project/types': 0.61.2 - '@valibot/to-json-schema': 1.0.0(valibot@1.0.0(typescript@5.8.2)) - valibot: 1.0.0(typescript@5.8.2) - optionalDependencies: - '@oxc-project/runtime': 0.61.2 - '@rolldown/binding-darwin-arm64': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-darwin-x64': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-freebsd-x64': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-linux-x64-musl': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-wasm32-wasi': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.7-commit.e117288 - '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.7-commit.e117288 - transitivePeerDependencies: - - typescript - rollup-plugin-dts@6.2.1(rollup@4.37.0)(typescript@5.8.2): dependencies: magic-string: 0.30.17 @@ -7763,14 +7366,6 @@ snapshots: util-deprecate@1.0.2: {} - valibot@1.0.0(typescript@5.7.2): - optionalDependencies: - typescript: 5.7.2 - - valibot@1.0.0(typescript@5.8.2): - optionalDependencies: - typescript: 5.8.2 - vfile-message@4.0.2: dependencies: '@types/unist': 3.0.2 @@ -7782,18 +7377,18 @@ snapshots: unist-util-stringify-position: 4.0.0 vfile-message: 4.0.2 - vite-node@3.0.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1): + vite-node@3.0.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.6.0 pathe: 2.0.2 - vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) transitivePeerDependencies: - '@types/node' - - esbuild - jiti - less + - lightningcss - sass - sass-embedded - stylus @@ -7801,13 +7396,36 @@ snapshots: - supports-color - terser - tsx - - typescript - yaml - vitest@3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1): + vite@6.2.5(@types/node@22.13.10)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): + dependencies: + esbuild: 0.25.2 + postcss: 8.5.3 + rollup: 4.37.0 + optionalDependencies: + '@types/node': 22.13.10 + fsevents: 2.3.3 + jiti: 2.4.2 + tsx: 4.19.2 + yaml: 2.5.1 + + vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): + dependencies: + esbuild: 0.25.2 + postcss: 8.5.3 + rollup: 4.37.0 + optionalDependencies: + '@types/node': 22.13.15 + fsevents: 2.3.3 + jiti: 2.4.2 + tsx: 4.19.2 + yaml: 2.5.1 + + vitest@3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): dependencies: '@vitest/expect': 3.0.5 - '@vitest/mocker': 3.0.5(rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1)) + '@vitest/mocker': 3.0.5(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) '@vitest/pretty-format': 3.0.5 '@vitest/runner': 3.0.5 '@vitest/snapshot': 3.0.5 @@ -7823,16 +7441,16 @@ snapshots: tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 2.0.0 - vite: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) - vite-node: 3.0.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.5.1) + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite-node: 3.0.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) why-is-node-running: 2.3.0 optionalDependencies: '@types/debug': 4.1.12 '@types/node': 22.13.15 transitivePeerDependencies: - - esbuild - jiti - less + - lightningcss - msw - sass - sass-embedded @@ -7841,7 +7459,6 @@ snapshots: - supports-color - terser - tsx - - typescript - yaml web-streams-polyfill@3.2.1: {} From 9920d724dd6442a50497641f37d5ee944c6d2d7b Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Fri, 4 Apr 2025 12:33:48 +0900 Subject: [PATCH 06/18] chore: setup tests --- packages/plugin-react-oxc/package.json | 3 +- playground/vitestGlobalSetup.ts | 41 +++ pnpm-lock.yaml | 383 +++++++++++++++++++++++-- 3 files changed, 404 insertions(+), 23 deletions(-) diff --git a/packages/plugin-react-oxc/package.json b/packages/plugin-react-oxc/package.json index 8a9f8d9d0..31bb951b8 100644 --- a/packages/plugin-react-oxc/package.json +++ b/packages/plugin-react-oxc/package.json @@ -37,6 +37,7 @@ "vite": "^6.3.0" }, "devDependencies": { - "unbuild": "^3.5.0" + "unbuild": "^3.5.0", + "vite": "npm:rolldown-vite@6.3.0-beta.5" } } diff --git a/playground/vitestGlobalSetup.ts b/playground/vitestGlobalSetup.ts index 7a63d6d12..9f2dada49 100644 --- a/playground/vitestGlobalSetup.ts +++ b/playground/vitestGlobalSetup.ts @@ -43,6 +43,47 @@ export async function setup(): Promise { throw error } }) + + // also setup dedicated copy for plugin-react-oxc tests + const oxcIgnoredDirs = new Set([ + 'compiler', + 'compiler-react-18', + 'react-classic', + 'react-emotion', + 'node_modules', + ]) + const oxcPlaygrounds = ( + await fs.readdir(path.resolve(__dirname, '../playground'), { + withFileTypes: true, + }) + ).filter((dirent) => !oxcIgnoredDirs.has(dirent.name) && dirent.isDirectory()) + for (const { name: playgroundName } of oxcPlaygrounds) { + await fs.copy( + path.resolve(tempDir, playgroundName), + path.resolve(tempDir, `${playgroundName}-oxc`), + ) + await fs.remove( + path.resolve( + tempDir, + `${playgroundName}-oxc/node_modules/@vitejs/plugin-react`, + ), + ) + await fs.symlink( + path.resolve(__dirname, '../packages/plugin-react-oxc'), + path.resolve( + tempDir, + `${playgroundName}-oxc/node_modules/@vitejs/plugin-react`, + ), + ) + await fs.symlink( + path.resolve(__dirname, '../packages/plugin-react-oxc/node_modules/vite'), + path.resolve(tempDir, `${playgroundName}-oxc/node_modules/vite`), + ) + await fs.copy( + path.resolve(__dirname, '../packages/plugin-react-oxc/node_modules/.bin'), + path.resolve(tempDir, `${playgroundName}-oxc/node_modules/.bin`), + ) + } } export async function teardown(): Promise { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 981e21b81..20693a179 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -66,10 +66,10 @@ importers: version: 8.29.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.7.2) vite: specifier: ^6.0.0 - version: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + version: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1) vitest: specifier: ^3.0.4 - version: 3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + version: 3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1) packages/plugin-react: dependencies: @@ -102,6 +102,9 @@ importers: unbuild: specifier: ^3.5.0 version: 3.5.0(typescript@5.8.2) + vite: + specifier: npm:rolldown-vite@6.3.0-beta.5 + version: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1) packages/plugin-react-swc: dependencies: @@ -138,7 +141,7 @@ importers: version: 5.8.2 vite: specifier: ^6.2.2 - version: 6.2.5(@types/node@22.13.10)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + version: 6.2.5(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1) packages/plugin-react-swc/playground/base-path: dependencies: @@ -364,10 +367,10 @@ importers: dependencies: '@generouted/react-router': specifier: ^1.20.0 - version: 1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) + version: 1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1)) generouted: specifier: 1.11.7 - version: 1.11.7(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) + version: 1.11.7(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1)) react: specifier: ^19.0.0 version: 19.1.0 @@ -1419,6 +1422,13 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@oxc-project/runtime@0.61.2': + resolution: {integrity: sha512-UNv56Aa4pTtsnqapa2LC+gRxXbUZxA6j1WlSYV8+zan5sD+CvwOMSzUsMNdUUTebob6PafJfT+/TN83yWXWmSA==} + engines: {node: '>=6.9.0'} + + '@oxc-project/types@0.61.2': + resolution: {integrity: sha512-rfuwJwvwn9MRthHNXlSo9Eka/u7gC0MhnWAoX3BhE1+rwPOl22nq0K0Y997Hof0tHCOuD7H3/Z8HTfCVhB4c5Q==} + '@playwright/test@1.51.1': resolution: {integrity: sha512-nM+kEaTSAoVlXmMPH10017vn3FSiFqr/bh4fKg9vmAdMfd9SDqRZNvPSiAHADc/itWak+qPvMPZQOPwCBW7k7Q==} engines: {node: '>=18'} @@ -1428,6 +1438,66 @@ packages: resolution: {integrity: sha512-S+9ANAvUmjutrshV4jZjaiG8XQyuJIZ8a4utWmN/vW1sgQ9IfBnPndwkmQYw53QmouOIytT874u65HEmu6H5jw==} engines: {node: '>=18'} + '@rolldown/binding-darwin-arm64@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-aq6Y9OQl05bYUnzM4a7ZGF3+Du7cdrw3Ala1eCnvNqxgi2ksXKN+LHvgeaWDlyfLgX0jVQFZre4+kzgLSHEMog==} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-GRxENhaf92Blo7TZz8C8vBFSt4pCRWDP45ElGATItWqzyM+ILtzNjkE5Wj1OyWPe7y0oWxps6YMxVxEdb3/BJQ==} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-3uibg1KMHT7c149YupfXICxKoO6K7q3MaMpvOdxUjTY9mY3+v96eHTfnq+dd6qD16ppKSVij7FfpEC+sCVDRmg==} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-oDFqE2fWx2sj0E9doRUmYxi5TKc9/vmD49NP0dUN578LQO8nJBwqOMvE8bM3a/T3or4g1mlJt2ebzGiKGzjHSw==} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-0Weogg1WiFNkmwznM4YS4AmDa55miGstb/I4zKquIsv1kSBLBkxboifgWTCPUnGFK7Wy1u/beRnxCY7UVL1oPw==} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-LwEN10APipzjxAHSreVTEnUAHRz3sq4/UR3IVD/AguV0s6yAbVAsIrvIoxXHKoci+RUlyY5FXICYZQKli8iU5w==} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-tgE2J4BAQfI0rfoPzS4r1LEHSNxdNSM8l1Ab5InnzE4dXzVw92BVQ/FLFE6L+nWy81O7uwd7yz0Jo+qByOPCXg==} + cpu: [x64] + os: [linux] + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-m78svPie3D5PIBxmexztDVHjrnHO5t6h3Lwtl6sqdrio1zhGYMY9FcPcaZZ40mXXWKHFoPmbueBZZLdttvOEIQ==} + cpu: [x64] + os: [linux] + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-XbOcOWmdioNZ3hHBb5j96Y9S9pGyTeFZWR5ovMZggA9L7mWft2pMrbx4p5zUy2dCps3l1jaFQCjKuBXpwoCZug==} + engines: {node: '>=14.21.3'} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-lnZ/wrat6UMWGbS9w5AUEH8WkPBA4EUSYp8cxlspdU16dISeD/KGpF2d0hS6Oa6ftbgZZrRLMEnQRiD8OupPsg==} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-F0N/6kAnCl9dOgqR09T60UjQSxKvRtlbImhiYxIdKBFxgYDDGsh8XzlSbMRUVQmMtNwKC8xi+i+SnamSqY6q8Q==} + cpu: [ia32] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.7-commit.e117288': + resolution: {integrity: sha512-T3qKMkSVemlVLLd5V7dCXnjt4Zda1UnUi45AQnmxIf3jH0/VP0J4aYAJiEEaRbhMoHc82j01+6MuZFZUVMeqng==} + cpu: [x64] + os: [win32] + '@rollup/plugin-alias@5.1.1': resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==} engines: {node: '>=14.0.0'} @@ -1910,6 +1980,11 @@ packages: cpu: [x64] os: [win32] + '@valibot/to-json-schema@1.0.0': + resolution: {integrity: sha512-/9crJgPptVsGCL6X+JPDQyaJwkalSZ/52WuF8DiRUxJgcmpNdzYRfZ+gqMEP8W3CTVfuMWPqqvIgfwJ97f9Etw==} + peerDependencies: + valibot: ^1.0.0 + '@vitejs/release-scripts@1.3.2': resolution: {integrity: sha512-g4jaMHxdjPiGlFV8qSq8EaE3SYtLHeEGGfmVASvJ+mn+W0kKH0nDXO3u9RR25zVbW9ooamQcpEAx2fTMhlwvkg==} @@ -2276,6 +2351,10 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + detect-libc@2.0.3: + resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} + engines: {node: '>=8'} + devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} @@ -2793,6 +2872,70 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} + lightningcss-darwin-arm64@1.29.3: + resolution: {integrity: sha512-fb7raKO3pXtlNbQbiMeEu8RbBVHnpyqAoxTyTRMEWFQWmscGC2wZxoHzZ+YKAepUuKT9uIW5vL2QbFivTgprZg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.29.3: + resolution: {integrity: sha512-KF2XZ4ZdmDGGtEYmx5wpzn6u8vg7AdBHaEOvDKu8GOs7xDL/vcU2vMKtTeNe1d4dogkDdi3B9zC77jkatWBwEQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.29.3: + resolution: {integrity: sha512-VUWeVf+V1UM54jv9M4wen9vMlIAyT69Krl9XjI8SsRxz4tdNV/7QEPlW6JASev/pYdiynUCW0pwaFquDRYdxMw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.29.3: + resolution: {integrity: sha512-UhgZ/XVNfXQVEJrMIWeK1Laj8KbhjbIz7F4znUk7G4zeGw7TRoJxhb66uWrEsonn1+O45w//0i0Fu0wIovYdYg==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.29.3: + resolution: {integrity: sha512-Pqau7jtgJNmQ/esugfmAT1aCFy/Gxc92FOxI+3n+LbMHBheBnk41xHDhc0HeYlx9G0xP5tK4t0Koy3QGGNqypw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-arm64-musl@1.29.3: + resolution: {integrity: sha512-dxakOk66pf7KLS7VRYFO7B8WOJLecE5OPL2YOk52eriFd/yeyxt2Km5H0BjLfElokIaR+qWi33gB8MQLrdAY3A==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-x64-gnu@1.29.3: + resolution: {integrity: sha512-ySZTNCpbfbK8rqpKJeJR2S0g/8UqqV3QnzcuWvpI60LWxnFN91nxpSSwCbzfOXkzKfar9j5eOuOplf+klKtINg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-linux-x64-musl@1.29.3: + resolution: {integrity: sha512-3pVZhIzW09nzi10usAXfIGTTSTYQ141dk88vGFNCgawIzayiIzZQxEcxVtIkdvlEq2YuFsL9Wcj/h61JHHzuFQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-win32-arm64-msvc@1.29.3: + resolution: {integrity: sha512-VRnkAvtIkeWuoBJeGOTrZxsNp4HogXtcaaLm8agmbYtLDOhQdpgxW6NjZZjDXbvGF+eOehGulXZ3C1TiwHY4QQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.29.3: + resolution: {integrity: sha512-IszwRPu2cPnDQsZpd7/EAr0x2W7jkaWqQ1SwCVIZ/tSbZVXPLt6k8s6FkcyBjViCzvB5CW0We0QbbP7zp2aBjQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.29.3: + resolution: {integrity: sha512-GlOJwTIP6TMIlrTFsxTerwC0W6OpQpCGuX1ECRLBUVRh6fpJH3xTqjCjRgQHTb4ZXexH9rtHou1Lf03GKzmhhQ==} + engines: {node: '>= 12.0.0'} + lilconfig@3.1.2: resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} engines: {node: '>=14'} @@ -3517,6 +3660,55 @@ packages: rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + rolldown-vite@6.3.0-beta.5: + resolution: {integrity: sha512-/seCUlTV3pHNn0Y8qveGmHMNYxH/Z9xc65Ov0uaA/HtThaMZNTacWsMyDG4SA+S/c1RdpWIe85E5NeOmhywrGg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + esbuild: ^0.25.0 + jiti: '>=1.21.0' + less: '*' + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + rolldown@1.0.0-beta.7-commit.e117288: + resolution: {integrity: sha512-3pjhtA9BV/q9cNdcz75ehvie3lgFfJZfzIT8A7aZJPvFCaWTj5AUAlcExXRWO/CIMMZ/49Y1x3MTwRC/Q/LuAw==} + hasBin: true + peerDependencies: + '@oxc-project/runtime': 0.61.2 + peerDependenciesMeta: + '@oxc-project/runtime': + optional: true + rollup-plugin-dts@6.2.1: resolution: {integrity: sha512-sR3CxYUl7i2CHa0O7bA45mCrgADyAQ0tVtGSqi3yvH28M+eg1+g5d7kQ9hLvEz5dorK3XVsH5L2jwHLQf72DzA==} engines: {node: '>=16'} @@ -3836,6 +4028,14 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + valibot@1.0.0: + resolution: {integrity: sha512-1Hc0ihzWxBar6NGeZv7fPLY0QuxFMyxwYR2sF1Blu7Wq7EnremwY2W02tit2ij2VJT8HcSkHAQqmFfl77f73Yw==} + peerDependencies: + typescript: '>=5' + peerDependenciesMeta: + typescript: + optional: true + vfile-message@4.0.2: resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} @@ -4552,13 +4752,13 @@ snapshots: '@eslint/core': 0.12.0 levn: 0.4.1 - '@generouted/react-router@1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1))': + '@generouted/react-router@1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-router@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1))': dependencies: fast-glob: 3.3.3 - generouted: 1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) + generouted: 1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1)) react: 19.1.0 react-router: 7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1) transitivePeerDependencies: - react-router-dom @@ -4649,12 +4849,54 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 + '@oxc-project/runtime@0.61.2': {} + + '@oxc-project/types@0.61.2': {} + '@playwright/test@1.51.1': dependencies: playwright: 1.51.1 '@publint/pack@0.1.2': {} + '@rolldown/binding-darwin-arm64@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.7-commit.e117288': + dependencies: + '@napi-rs/wasm-runtime': 0.2.7 + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.7-commit.e117288': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.7-commit.e117288': + optional: true + '@rollup/plugin-alias@5.1.1(rollup@4.37.0)': optionalDependencies: rollup: 4.37.0 @@ -5086,6 +5328,10 @@ snapshots: '@unrs/rspack-resolver-binding-win32-x64-msvc@1.3.0': optional: true + '@valibot/to-json-schema@1.0.0(valibot@1.0.0(typescript@5.8.2))': + dependencies: + valibot: 1.0.0(typescript@5.8.2) + '@vitejs/release-scripts@1.3.2': dependencies: execa: 8.0.1 @@ -5111,13 +5357,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 2.0.0 - '@vitest/mocker@3.0.5(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1))': + '@vitest/mocker@3.0.5(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1))': dependencies: '@vitest/spy': 3.0.5 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1) '@vitest/pretty-format@3.0.5': dependencies: @@ -5461,6 +5707,8 @@ snapshots: dequal@2.0.3: {} + detect-libc@2.0.3: {} + devlop@1.1.0: dependencies: dequal: 2.0.3 @@ -5858,17 +6106,17 @@ snapshots: function-bind@1.1.2: {} - generouted@1.11.7(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)): + generouted@1.11.7(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1)): dependencies: react: 19.1.0 react-router-dom: 7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1) - generouted@1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)): + generouted@1.20.0(react-router-dom@7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1)): dependencies: react: 19.1.0 react-router-dom: 7.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1) gensync@1.0.0-beta.2: {} @@ -6096,6 +6344,51 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 + lightningcss-darwin-arm64@1.29.3: + optional: true + + lightningcss-darwin-x64@1.29.3: + optional: true + + lightningcss-freebsd-x64@1.29.3: + optional: true + + lightningcss-linux-arm-gnueabihf@1.29.3: + optional: true + + lightningcss-linux-arm64-gnu@1.29.3: + optional: true + + lightningcss-linux-arm64-musl@1.29.3: + optional: true + + lightningcss-linux-x64-gnu@1.29.3: + optional: true + + lightningcss-linux-x64-musl@1.29.3: + optional: true + + lightningcss-win32-arm64-msvc@1.29.3: + optional: true + + lightningcss-win32-x64-msvc@1.29.3: + optional: true + + lightningcss@1.29.3: + dependencies: + detect-libc: 2.0.3 + optionalDependencies: + lightningcss-darwin-arm64: 1.29.3 + lightningcss-darwin-x64: 1.29.3 + lightningcss-freebsd-x64: 1.29.3 + lightningcss-linux-arm-gnueabihf: 1.29.3 + lightningcss-linux-arm64-gnu: 1.29.3 + lightningcss-linux-arm64-musl: 1.29.3 + lightningcss-linux-x64-gnu: 1.29.3 + lightningcss-linux-x64-musl: 1.29.3 + lightningcss-win32-arm64-msvc: 1.29.3 + lightningcss-win32-x64-msvc: 1.29.3 + lilconfig@3.1.2: {} lines-and-columns@1.2.4: {} @@ -7000,6 +7293,46 @@ snapshots: rfdc@1.4.1: {} + rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1): + dependencies: + '@oxc-project/runtime': 0.61.2 + lightningcss: 1.29.3 + picomatch: 4.0.2 + postcss: 8.5.3 + rolldown: 1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.8.2) + tinyglobby: 0.2.12 + optionalDependencies: + '@types/node': 22.13.15 + esbuild: 0.25.2 + fsevents: 2.3.3 + jiti: 2.4.2 + tsx: 4.19.2 + yaml: 2.5.1 + transitivePeerDependencies: + - typescript + + rolldown@1.0.0-beta.7-commit.e117288(@oxc-project/runtime@0.61.2)(typescript@5.8.2): + dependencies: + '@oxc-project/types': 0.61.2 + '@valibot/to-json-schema': 1.0.0(valibot@1.0.0(typescript@5.8.2)) + valibot: 1.0.0(typescript@5.8.2) + optionalDependencies: + '@oxc-project/runtime': 0.61.2 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-darwin-x64': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.7-commit.e117288 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.7-commit.e117288 + transitivePeerDependencies: + - typescript + rollup-plugin-dts@6.2.1(rollup@4.37.0)(typescript@5.8.2): dependencies: magic-string: 0.30.17 @@ -7366,6 +7699,10 @@ snapshots: util-deprecate@1.0.2: {} + valibot@1.0.0(typescript@5.8.2): + optionalDependencies: + typescript: 5.8.2 + vfile-message@4.0.2: dependencies: '@types/unist': 3.0.2 @@ -7377,13 +7714,13 @@ snapshots: unist-util-stringify-position: 4.0.0 vfile-message: 4.0.2 - vite-node@3.0.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): + vite-node@3.0.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1): dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.6.0 pathe: 2.0.2 - vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1) transitivePeerDependencies: - '@types/node' - jiti @@ -7398,7 +7735,7 @@ snapshots: - tsx - yaml - vite@6.2.5(@types/node@22.13.10)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): + vite@6.2.5(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1): dependencies: esbuild: 0.25.2 postcss: 8.5.3 @@ -7407,10 +7744,11 @@ snapshots: '@types/node': 22.13.10 fsevents: 2.3.3 jiti: 2.4.2 + lightningcss: 1.29.3 tsx: 4.19.2 yaml: 2.5.1 - vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): + vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1): dependencies: esbuild: 0.25.2 postcss: 8.5.3 @@ -7419,13 +7757,14 @@ snapshots: '@types/node': 22.13.15 fsevents: 2.3.3 jiti: 2.4.2 + lightningcss: 1.29.3 tsx: 4.19.2 yaml: 2.5.1 - vitest@3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1): + vitest@3.0.5(@types/debug@4.1.12)(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1): dependencies: '@vitest/expect': 3.0.5 - '@vitest/mocker': 3.0.5(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1)) + '@vitest/mocker': 3.0.5(vite@6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1)) '@vitest/pretty-format': 3.0.5 '@vitest/runner': 3.0.5 '@vitest/snapshot': 3.0.5 @@ -7441,8 +7780,8 @@ snapshots: tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 2.0.0 - vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) - vite-node: 3.0.5(@types/node@22.13.15)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.5.1) + vite: 6.2.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1) + vite-node: 3.0.5(@types/node@22.13.15)(jiti@2.4.2)(lightningcss@1.29.3)(tsx@4.19.2)(yaml@2.5.1) why-is-node-running: 2.3.0 optionalDependencies: '@types/debug': 4.1.12 From 8d5695347669184d0425da0d451abe1c42507404 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Fri, 4 Apr 2025 15:08:51 +0900 Subject: [PATCH 07/18] chore: run tests --- .../__tests__/oxc/class-components.spec.ts | 1 + playground/mdx/__tests__/oxc/mdx.spec.ts | 1 + .../react-env/__tests__/oxc/react.spec.ts | 1 + .../__tests__/oxc/react-sourcemap.spec.ts | 1 + playground/react/__tests__/oxc/react.spec.ts | 1 + .../ssr-react/__tests__/oxc/ssr-react.spec.ts | 1 + playground/vitestGlobalSetup.ts | 40 +++++++++++-------- playground/vitestSetup.ts | 18 +++++---- 8 files changed, 40 insertions(+), 24 deletions(-) create mode 100644 playground/class-components/__tests__/oxc/class-components.spec.ts create mode 100644 playground/mdx/__tests__/oxc/mdx.spec.ts create mode 100644 playground/react-env/__tests__/oxc/react.spec.ts create mode 100644 playground/react-sourcemap/__tests__/oxc/react-sourcemap.spec.ts create mode 100644 playground/react/__tests__/oxc/react.spec.ts create mode 100644 playground/ssr-react/__tests__/oxc/ssr-react.spec.ts diff --git a/playground/class-components/__tests__/oxc/class-components.spec.ts b/playground/class-components/__tests__/oxc/class-components.spec.ts new file mode 100644 index 000000000..471b6e892 --- /dev/null +++ b/playground/class-components/__tests__/oxc/class-components.spec.ts @@ -0,0 +1 @@ +import '../class-components.spec' diff --git a/playground/mdx/__tests__/oxc/mdx.spec.ts b/playground/mdx/__tests__/oxc/mdx.spec.ts new file mode 100644 index 000000000..4f2df7980 --- /dev/null +++ b/playground/mdx/__tests__/oxc/mdx.spec.ts @@ -0,0 +1 @@ +import '../mdx.spec' diff --git a/playground/react-env/__tests__/oxc/react.spec.ts b/playground/react-env/__tests__/oxc/react.spec.ts new file mode 100644 index 000000000..776f43259 --- /dev/null +++ b/playground/react-env/__tests__/oxc/react.spec.ts @@ -0,0 +1 @@ +import '../react.spec' diff --git a/playground/react-sourcemap/__tests__/oxc/react-sourcemap.spec.ts b/playground/react-sourcemap/__tests__/oxc/react-sourcemap.spec.ts new file mode 100644 index 000000000..4fb7caa7e --- /dev/null +++ b/playground/react-sourcemap/__tests__/oxc/react-sourcemap.spec.ts @@ -0,0 +1 @@ +import '../react-sourcemap.spec' diff --git a/playground/react/__tests__/oxc/react.spec.ts b/playground/react/__tests__/oxc/react.spec.ts new file mode 100644 index 000000000..776f43259 --- /dev/null +++ b/playground/react/__tests__/oxc/react.spec.ts @@ -0,0 +1 @@ +import '../react.spec' diff --git a/playground/ssr-react/__tests__/oxc/ssr-react.spec.ts b/playground/ssr-react/__tests__/oxc/ssr-react.spec.ts new file mode 100644 index 000000000..66fde5a3f --- /dev/null +++ b/playground/ssr-react/__tests__/oxc/ssr-react.spec.ts @@ -0,0 +1 @@ +import '../ssr-react.spec' diff --git a/playground/vitestGlobalSetup.ts b/playground/vitestGlobalSetup.ts index 19ddcc8fb..a7fa1d6e7 100644 --- a/playground/vitestGlobalSetup.ts +++ b/playground/vitestGlobalSetup.ts @@ -41,44 +41,52 @@ export async function setup({ provide }: TestProject): Promise { } }) - // also setup dedicated copy for plugin-react-oxc tests - const oxcIgnoredDirs = new Set([ - 'compiler', - 'compiler-react-18', - 'react-classic', - 'react-emotion', - 'node_modules', - ]) - const oxcPlaygrounds = ( + const playgrounds = ( await fs.readdir(path.resolve(__dirname, '../playground'), { withFileTypes: true, }) - ).filter((dirent) => !oxcIgnoredDirs.has(dirent.name) && dirent.isDirectory()) - for (const { name: playgroundName } of oxcPlaygrounds) { + ).filter((dirent) => dirent.name !== 'node_modules' && dirent.isDirectory()) + for (const { name: playgroundName } of playgrounds) { + // write vite proxy file to load vite from each playground + await fs.writeFile( + path.resolve(tempDir, `${playgroundName}/_vite-proxy.js`), + "export * from 'vite';", + ) + + // also setup dedicated copy for plugin-react-oxc tests + const oxcTestDir = path.resolve( + __dirname, + '../playground', + playgroundName, + '__tests__/oxc', + ) + if (!(await fs.exists(oxcTestDir))) continue + + const variantPlaygroundName = `${playgroundName}__oxc` await fs.copy( path.resolve(tempDir, playgroundName), - path.resolve(tempDir, `${playgroundName}-oxc`), + path.resolve(tempDir, variantPlaygroundName), ) await fs.remove( path.resolve( tempDir, - `${playgroundName}-oxc/node_modules/@vitejs/plugin-react`, + `${variantPlaygroundName}/node_modules/@vitejs/plugin-react`, ), ) await fs.symlink( path.resolve(__dirname, '../packages/plugin-react-oxc'), path.resolve( tempDir, - `${playgroundName}-oxc/node_modules/@vitejs/plugin-react`, + `${variantPlaygroundName}/node_modules/@vitejs/plugin-react`, ), ) await fs.symlink( path.resolve(__dirname, '../packages/plugin-react-oxc/node_modules/vite'), - path.resolve(tempDir, `${playgroundName}-oxc/node_modules/vite`), + path.resolve(tempDir, `${variantPlaygroundName}/node_modules/vite`), ) await fs.copy( path.resolve(__dirname, '../packages/plugin-react-oxc/node_modules/.bin'), - path.resolve(tempDir, `${playgroundName}-oxc/node_modules/.bin`), + path.resolve(tempDir, `${variantPlaygroundName}/node_modules/.bin`), ) } } diff --git a/playground/vitestSetup.ts b/playground/vitestSetup.ts index f21f3c7b8..702c8f542 100644 --- a/playground/vitestSetup.ts +++ b/playground/vitestSetup.ts @@ -12,14 +12,6 @@ import type { UserConfig, ViteDevServer, } from 'vite' -import { - build, - createBuilder, - createServer, - loadConfigFromFile, - mergeConfig, - preview, -} from 'vite' import type { Browser, Page } from 'playwright-chromium' import type { RunnerTestFile } from 'vitest' import { beforeAll, inject } from 'vitest' @@ -188,6 +180,8 @@ beforeAll(async (s) => { }) async function loadConfig(configEnv: ConfigEnv) { + const { loadConfigFromFile, mergeConfig } = await importVite() + let config: UserConfig | null = null // config file named by convention as the *.spec.ts folder @@ -240,6 +234,9 @@ async function loadConfig(configEnv: ConfigEnv) { } export async function startDefaultServe(): Promise { + const { build, createBuilder, createServer, mergeConfig, preview } = + await importVite() + setupConsoleWarnCollector(serverLogs) if (!isBuild) { @@ -369,6 +366,11 @@ function stripTrailingSlashIfNeeded(url: string, base: string): string { return url } +async function importVite(): Promise { + const vitePath = path.resolve(testDir, '_vite-proxy.js') + return await import(vitePath) +} + declare module 'vite' { export interface UserConfig { /** From 5b41dc5df3939d8ccd2c6ed6c1127a78eb86d77c Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Fri, 4 Apr 2025 17:55:50 +0900 Subject: [PATCH 08/18] chore: use pnpm catalog --- packages/plugin-react-oxc/package.json | 2 +- pnpm-lock.yaml | 8 +++++++- pnpm-workspace.yaml | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/plugin-react-oxc/package.json b/packages/plugin-react-oxc/package.json index 31bb951b8..59d753bd9 100644 --- a/packages/plugin-react-oxc/package.json +++ b/packages/plugin-react-oxc/package.json @@ -38,6 +38,6 @@ }, "devDependencies": { "unbuild": "^3.5.0", - "vite": "npm:rolldown-vite@6.3.0-beta.5" + "vite": "catalog:rolldown-vite" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 20693a179..3389c7a96 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,12 @@ settings: autoInstallPeers: false excludeLinksFromLockfile: false +catalogs: + rolldown-vite: + vite: + specifier: npm:rolldown-vite@^6.3.0-beta.5 + version: 6.3.0-beta.5 + packageExtensionsChecksum: sha256-S82yCctxnlOTNFuHWCyTFRo/B6Y3jque/4DnsDO4WZA= importers: @@ -103,7 +109,7 @@ importers: specifier: ^3.5.0 version: 3.5.0(typescript@5.8.2) vite: - specifier: npm:rolldown-vite@6.3.0-beta.5 + specifier: catalog:rolldown-vite version: rolldown-vite@6.3.0-beta.5(@types/node@22.13.15)(esbuild@0.25.2)(jiti@2.4.2)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.5.1) packages/plugin-react-swc: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index f435b81cb..ee1c0d2ba 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,3 +2,7 @@ packages: - 'packages/*' - 'playground/**' - 'packages/plugin-react-swc/playground/**' + +catalogs: + rolldown-vite: + vite: npm:rolldown-vite@^6.3.0-beta.5 From 73a45a5dcf595937e08e662543c79bfc62e76bad Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Fri, 4 Apr 2025 18:34:09 +0900 Subject: [PATCH 09/18] feat: add rolldown-vite only error --- packages/plugin-react-oxc/src/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/plugin-react-oxc/src/index.ts b/packages/plugin-react-oxc/src/index.ts index 04535a3ba..5aa3d443e 100644 --- a/packages/plugin-react-oxc/src/index.ts +++ b/packages/plugin-react-oxc/src/index.ts @@ -62,6 +62,14 @@ export default function viteReact(opts: Options = {}): PluginOption[] { }, } }, + options() { + if (!this.meta.rolldownVersion) { + throw new Error( + '@vitejs/plugin-react-oxc requires rolldown-vite to be used. ' + + 'See https://vitejs.dev/guide/rolldown for more details about rolldown-vite.', + ) + } + }, } const viteRefreshRuntime: Plugin = { From efb8976fa0acf33caf64e31afa680e4b378f307d Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Fri, 4 Apr 2025 18:34:32 +0900 Subject: [PATCH 10/18] docs: add link to rolldown-vite page in README --- packages/plugin-react-oxc/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-react-oxc/README.md b/packages/plugin-react-oxc/README.md index dc2331e90..c5b7c842d 100644 --- a/packages/plugin-react-oxc/README.md +++ b/packages/plugin-react-oxc/README.md @@ -13,7 +13,7 @@ export default defineConfig({ ## Caveats - `jsx runtime` is always `automatic` -- this plugin only works with `rolldown-vite` +- this plugin only works with [`rolldown-vite`](https://vitejs.dev/guide/rolldown) ## Options From bbb3a730f7740b661c674d75a00356e73e0c923c Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Mon, 7 Apr 2025 11:03:01 +0900 Subject: [PATCH 11/18] chore: add description and keyword fields --- packages/plugin-react-oxc/README.md | 6 ++++++ packages/plugin-react-oxc/package.json | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/packages/plugin-react-oxc/README.md b/packages/plugin-react-oxc/README.md index c5b7c842d..64a6213e2 100644 --- a/packages/plugin-react-oxc/README.md +++ b/packages/plugin-react-oxc/README.md @@ -1,5 +1,11 @@ # @vitejs/plugin-react-oxc [![npm](https://img.shields.io/npm/v/@vitejs/plugin-react-oxc.svg)](https://npmjs.com/package/@vitejs/plugin-react-oxc) +The future default Vite plugin for React projects. + +- enable [Fast Refresh](https://www.npmjs.com/package/react-refresh) in development +- use the [automatic JSX runtime](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) +- small installation size + ```js // vite.config.js import { defineConfig } from 'vite' diff --git a/packages/plugin-react-oxc/package.json b/packages/plugin-react-oxc/package.json index 59d753bd9..e040cc361 100644 --- a/packages/plugin-react-oxc/package.json +++ b/packages/plugin-react-oxc/package.json @@ -7,6 +7,15 @@ "Alec Larson", "Arnaud Barré" ], + "description": "The future default Vite plugin for React projects", + "keywords": [ + "vite", + "vite-plugin", + "react", + "oxc", + "react-refresh", + "fast refresh" + ], "files": [ "dist" ], From 45a177fc24f1e3fd2c79e6b3e9b891b990653d7a Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Mon, 7 Apr 2025 19:03:33 +0900 Subject: [PATCH 12/18] refactor: use react-common --- packages/plugin-react-oxc/package.json | 3 +- .../scripts/copyRefreshRuntime.ts | 6 ++ .../scripts/copyRefreshUtils.ts | 3 - packages/plugin-react-oxc/src/fast-refresh.ts | 92 ------------------ packages/plugin-react-oxc/src/index.ts | 74 ++++++--------- packages/plugin-react-oxc/src/refreshUtils.js | 93 ------------------- playground/react/__tests__/react.spec.ts | 17 +++- playground/test-utils.ts | 5 + pnpm-lock.yaml | 3 + 9 files changed, 58 insertions(+), 238 deletions(-) create mode 100644 packages/plugin-react-oxc/scripts/copyRefreshRuntime.ts delete mode 100644 packages/plugin-react-oxc/scripts/copyRefreshUtils.ts delete mode 100644 packages/plugin-react-oxc/src/fast-refresh.ts delete mode 100644 packages/plugin-react-oxc/src/refreshUtils.js diff --git a/packages/plugin-react-oxc/package.json b/packages/plugin-react-oxc/package.json index e040cc361..3e85a5155 100644 --- a/packages/plugin-react-oxc/package.json +++ b/packages/plugin-react-oxc/package.json @@ -24,7 +24,7 @@ "exports": "./dist/index.mjs", "scripts": { "dev": "unbuild --stub", - "build": "unbuild && tsx scripts/copyRefreshUtils.ts", + "build": "unbuild && tsx scripts/copyRefreshRuntime.ts", "prepublishOnly": "npm run build" }, "engines": { @@ -46,6 +46,7 @@ "vite": "^6.3.0" }, "devDependencies": { + "@vitejs/react-common": "workspace:*", "unbuild": "^3.5.0", "vite": "catalog:rolldown-vite" } diff --git a/packages/plugin-react-oxc/scripts/copyRefreshRuntime.ts b/packages/plugin-react-oxc/scripts/copyRefreshRuntime.ts new file mode 100644 index 000000000..2666e968e --- /dev/null +++ b/packages/plugin-react-oxc/scripts/copyRefreshRuntime.ts @@ -0,0 +1,6 @@ +import { copyFileSync } from 'node:fs' + +copyFileSync( + 'node_modules/@vitejs/react-common/refresh-runtime.js', + 'dist/refresh-runtime.js', +) diff --git a/packages/plugin-react-oxc/scripts/copyRefreshUtils.ts b/packages/plugin-react-oxc/scripts/copyRefreshUtils.ts deleted file mode 100644 index 977f6442f..000000000 --- a/packages/plugin-react-oxc/scripts/copyRefreshUtils.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { copyFileSync } from 'node:fs' - -copyFileSync('src/refreshUtils.js', 'dist/refreshUtils.js') diff --git a/packages/plugin-react-oxc/src/fast-refresh.ts b/packages/plugin-react-oxc/src/fast-refresh.ts deleted file mode 100644 index 441c9e321..000000000 --- a/packages/plugin-react-oxc/src/fast-refresh.ts +++ /dev/null @@ -1,92 +0,0 @@ -import fs from 'node:fs' -import path from 'node:path' -import { createRequire } from 'node:module' - -export const runtimePublicPath = '/@react-refresh' - -const _require = createRequire(import.meta.url) -const reactRefreshDir = path.dirname( - _require.resolve('react-refresh/package.json'), -) -const runtimeFilePath = path.join( - reactRefreshDir, - 'cjs/react-refresh-runtime.development.js', -) - -export const runtimeCode = ` -const exports = {} -${fs.readFileSync(runtimeFilePath, 'utf-8')} -${fs.readFileSync(_require.resolve('./refreshUtils.js'), 'utf-8')} -export default exports -` - -export const preambleCode = ` -import RefreshRuntime from "__BASE__${runtimePublicPath.slice(1)}" -RefreshRuntime.injectIntoGlobalHook(window) -window.$RefreshReg$ = () => {} -window.$RefreshSig$ = () => (type) => type -window.__vite_plugin_react_preamble_installed__ = true -` - -const sharedHeader = ` -import RefreshRuntime from "${runtimePublicPath}"; - -const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope; -`.replace(/\n+/g, '') -const functionHeader = ` -let prevRefreshReg; -let prevRefreshSig; - -if (import.meta.hot && !inWebWorker) { - if (!window.__vite_plugin_react_preamble_installed__) { - throw new Error( - "@vitejs/plugin-react-oxc can't detect preamble. Something is wrong. " + - "See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201" - ); - } - - prevRefreshReg = window.$RefreshReg$; - prevRefreshSig = window.$RefreshSig$; - window.$RefreshReg$ = (type, id) => { - RefreshRuntime.register(type, __SOURCE__ + " " + id) - }; - window.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform; -}`.replace(/\n+/g, '') - -const functionFooter = ` -if (import.meta.hot && !inWebWorker) { - window.$RefreshReg$ = prevRefreshReg; - window.$RefreshSig$ = prevRefreshSig; -}` -const sharedFooter = (id: string) => ` -if (import.meta.hot && !inWebWorker) { - RefreshRuntime.__hmr_import(import.meta.url).then((currentExports) => { - RefreshRuntime.registerExportsForReactRefresh(${JSON.stringify( - id, - )}, currentExports); - import.meta.hot.accept((nextExports) => { - if (!nextExports) return; - const invalidateMessage = RefreshRuntime.validateRefreshBoundaryAndEnqueueUpdate(${JSON.stringify( - id, - )}, currentExports, nextExports); - if (invalidateMessage) import.meta.hot.invalidate(invalidateMessage); - }); - }); -}` - -export function addRefreshWrapper(code: string, id: string): string { - return ( - sharedHeader + - functionHeader.replace('__SOURCE__', JSON.stringify(id)) + - code + - functionFooter + - sharedFooter(id) - ) -} - -export function addClassComponentRefreshWrapper( - code: string, - id: string, -): string { - return sharedHeader + code + sharedFooter(id) -} diff --git a/packages/plugin-react-oxc/src/index.ts b/packages/plugin-react-oxc/src/index.ts index 5aa3d443e..c9fdf129f 100644 --- a/packages/plugin-react-oxc/src/index.ts +++ b/packages/plugin-react-oxc/src/index.ts @@ -1,11 +1,15 @@ -import type { BuildOptions, Plugin, PluginOption, UserConfig } from 'vite' +import { dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' +import { readFileSync } from 'node:fs' +import type { BuildOptions, Plugin, PluginOption } from 'vite' import { - addClassComponentRefreshWrapper, addRefreshWrapper, - preambleCode, - runtimeCode, + getPreambleCode, runtimePublicPath, -} from './fast-refresh' + silenceUseClientWarning, +} from '@vitejs/react-common' + +const _dirname = dirname(fileURLToPath(import.meta.url)) export interface Options { include?: string | RegExp | Array @@ -17,8 +21,6 @@ export interface Options { jsxImportSource?: string } -const reactCompRE = /extends\s+(?:React\.)?(?:Pure)?Component/ -const refreshContentRE = /\$Refresh(?:Reg|Sig)\$\(/ const defaultIncludeRE = /\.[tj]sx?(?:$|\?)/ export default function viteReact(opts: Options = {}): PluginOption[] { @@ -40,7 +42,8 @@ export default function viteReact(opts: Options = {}): PluginOption[] { name: 'vite:react-oxc:config', config(userConfig, { command }) { return { - build: silenceUseClientWarning(userConfig), + // @ts-expect-error rolldown-vite Vite type incompatibility + build: silenceUseClientWarning(userConfig) as BuildOptions, oxc: { jsx: { runtime: 'automatic', @@ -84,19 +87,23 @@ export default function viteReact(opts: Options = {}): PluginOption[] { load: { filter: { id: exactRegex(runtimePublicPath) }, handler(_id) { - return runtimeCode + return readFileSync( + join(_dirname, 'refresh-runtime.js'), + 'utf-8', + ).replace( + /__README_URL__/g, + 'https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-oxc', + ) }, }, } - let devBase: string let skipFastRefresh = false const viteRefreshWrapper: Plugin = { name: 'vite:react-oxc:refresh-wrapper', apply: 'serve', configResolved(config) { - devBase = config.base skipFastRefresh = config.isProduction || config.server.hmr === false }, transform: { @@ -114,24 +121,23 @@ export default function viteReact(opts: Options = {}): PluginOption[] { (isJSX || code.includes(jsxImportDevRuntime) || code.includes(jsxImportRuntime)) + if (!useFastRefresh) return - if (useFastRefresh) { - if (refreshContentRE.test(code)) { - code = addRefreshWrapper(code, id) - } else if (reactCompRE.test(code)) { - code = addClassComponentRefreshWrapper(code, id) - } - return { code } - } + return addRefreshWrapper( + code, + undefined, + '@vitejs/plugin-react-oxc', + id, + ) }, }, - transformIndexHtml() { + transformIndexHtml(_, config) { if (!skipFastRefresh) return [ { tag: 'script', attrs: { type: 'module' }, - children: preambleCode.replace(`__BASE__`, devBase), + children: getPreambleCode(config.server!.config.base), }, ] }, @@ -140,32 +146,6 @@ export default function viteReact(opts: Options = {}): PluginOption[] { return [viteConfig, viteRefreshRuntime, viteRefreshWrapper] } -const silenceUseClientWarning = (userConfig: UserConfig): BuildOptions => ({ - rollupOptions: { - onwarn(warning, defaultHandler) { - if ( - warning.code === 'MODULE_LEVEL_DIRECTIVE' && - warning.message.includes('use client') - ) { - return - } - // https://github.com/vitejs/vite/issues/15012 - if ( - warning.code === 'SOURCEMAP_ERROR' && - warning.message.includes('resolve original location') && - warning.pos === 0 - ) { - return - } - if (userConfig.build?.rollupOptions?.onwarn) { - userConfig.build.rollupOptions.onwarn(warning, defaultHandler) - } else { - defaultHandler(warning) - } - }, - }, -}) - function exactRegex(input: string): RegExp { return new RegExp(`^${escapeRegex(input)}$`) } diff --git a/packages/plugin-react-oxc/src/refreshUtils.js b/packages/plugin-react-oxc/src/refreshUtils.js deleted file mode 100644 index 2576164d7..000000000 --- a/packages/plugin-react-oxc/src/refreshUtils.js +++ /dev/null @@ -1,93 +0,0 @@ -function debounce(fn, delay) { - let handle - return () => { - clearTimeout(handle) - handle = setTimeout(fn, delay) - } -} - -/* eslint-disable no-undef */ -const hooks = [] -window.__registerBeforePerformReactRefresh = (cb) => { - hooks.push(cb) -} -const enqueueUpdate = debounce(async () => { - if (hooks.length) await Promise.all(hooks.map((cb) => cb())) - exports.performReactRefresh() -}, 16) - -// Taken from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/runtime/RefreshUtils.js#L141 -// This allows to register components not detected by SWC like styled component -function registerExportsForReactRefresh(filename, moduleExports) { - for (const key in moduleExports) { - if (key === '__esModule') continue - const exportValue = moduleExports[key] - if (exports.isLikelyComponentType(exportValue)) { - // 'export' is required to avoid key collision when renamed exports that - // shadow a local component name: https://github.com/vitejs/vite-plugin-react/issues/116 - // The register function has an identity check to not register twice the same component, - // so this is safe to not used the same key here. - exports.register(exportValue, filename + ' export ' + key) - } - } -} - -function validateRefreshBoundaryAndEnqueueUpdate(id, prevExports, nextExports) { - const ignoredExports = window.__getReactRefreshIgnoredExports?.({ id }) ?? [] - if ( - predicateOnExport( - ignoredExports, - prevExports, - (key) => key in nextExports, - ) !== true - ) { - return 'Could not Fast Refresh (export removed)' - } - if ( - predicateOnExport( - ignoredExports, - nextExports, - (key) => key in prevExports, - ) !== true - ) { - return 'Could not Fast Refresh (new export)' - } - - let hasExports = false - const allExportsAreComponentsOrUnchanged = predicateOnExport( - ignoredExports, - nextExports, - (key, value) => { - hasExports = true - if (exports.isLikelyComponentType(value)) return true - return prevExports[key] === nextExports[key] - }, - ) - if (hasExports && allExportsAreComponentsOrUnchanged === true) { - enqueueUpdate() - } else { - return `Could not Fast Refresh ("${allExportsAreComponentsOrUnchanged}" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports` - } -} - -function predicateOnExport(ignoredExports, moduleExports, predicate) { - for (const key in moduleExports) { - if (key === '__esModule') continue - if (ignoredExports.includes(key)) continue - const desc = Object.getOwnPropertyDescriptor(moduleExports, key) - if (desc && desc.get) return key - if (!predicate(key, moduleExports[key])) return key - } - return true -} - -// Hides vite-ignored dynamic import so that Vite can skip analysis if no other -// dynamic import is present (https://github.com/vitejs/vite/pull/12732) -function __hmr_import(module) { - return import(/* @vite-ignore */ module) -} - -exports.__hmr_import = __hmr_import -exports.registerExportsForReactRefresh = registerExportsForReactRefresh -exports.validateRefreshBoundaryAndEnqueueUpdate = - validateRefreshBoundaryAndEnqueueUpdate diff --git a/playground/react/__tests__/react.spec.ts b/playground/react/__tests__/react.spec.ts index 3c17d963b..d5d9c7d97 100644 --- a/playground/react/__tests__/react.spec.ts +++ b/playground/react/__tests__/react.spec.ts @@ -1,6 +1,7 @@ import { expect, test } from 'vitest' import { editFile, + escapeRegex, isBuild, isServe, page, @@ -82,7 +83,13 @@ if (!isBuild) { code.replace('An Object', 'Updated'), ), [ - '[vite] invalidate /hmr/no-exported-comp.jsx: Could not Fast Refresh ("Foo" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports', + new RegExp( + `^${escapeRegex( + '[vite] invalidate /hmr/no-exported-comp.jsx: Could not Fast Refresh ("Foo" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/', + )}plugin-react(?:-\\w+)?${escapeRegex( + '#consistent-components-exports', + )}`, + ), '[vite] hot updated: /hmr/no-exported-comp.jsx', '[vite] hot updated: /hmr/parent.jsx', 'Parent rendered', @@ -107,7 +114,13 @@ if (!isBuild) { code.replace('context provider', 'context provider updated'), ), [ - '[vite] invalidate /context/CountProvider.jsx: Could not Fast Refresh ("CountContext" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports', + new RegExp( + `^${escapeRegex( + '[vite] invalidate /context/CountProvider.jsx: Could not Fast Refresh ("CountContext" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/', + )}plugin-react(?:-\\w+)?${escapeRegex( + '#consistent-components-exports', + )}`, + ), '[vite] hot updated: /context/CountProvider.jsx', '[vite] hot updated: /App.jsx', '[vite] hot updated: /context/ContextButton.jsx', diff --git a/playground/test-utils.ts b/playground/test-utils.ts index dabc63c07..6d8e730d1 100644 --- a/playground/test-utils.ts +++ b/playground/test-utils.ts @@ -202,6 +202,11 @@ async function untilBrowserLog( return logs } +const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g +export function escapeRegex(str: string): string { + return str.replace(escapeRegexRE, '\\$&') +} + /** * Before implementing a new util, check if it's not available in core https://github.com/vitejs/vite/blob/main/playground/test-utils.ts */ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a764c1b0..4d24662e3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -114,6 +114,9 @@ importers: specifier: ^0.14.2 version: 0.14.2 devDependencies: + '@vitejs/react-common': + specifier: workspace:* + version: link:../common unbuild: specifier: ^3.5.0 version: 3.5.0(typescript@5.8.2) From b9a884e868e9f767daea51ccada01722a5766605 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Mon, 7 Apr 2025 19:14:42 +0900 Subject: [PATCH 13/18] fix: fix sourcemap for oxc plugin --- packages/common/refresh-utils.ts | 41 ++++++++++++++++++++------ packages/plugin-react-oxc/src/index.ts | 6 ++-- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/packages/common/refresh-utils.ts b/packages/common/refresh-utils.ts index 00a1c86e5..93451eedb 100644 --- a/packages/common/refresh-utils.ts +++ b/packages/common/refresh-utils.ts @@ -14,20 +14,30 @@ window.$RefreshSig$ = () => (type) => type;` export const getPreambleCode = (base: string): string => preambleCode.replace('__BASE__', base) -export function addRefreshWrapper( +export const avoidSourceMapOption = Symbol() + +export function addRefreshWrapper( code: string, - map: M | string, + map: M | string | undefined | typeof avoidSourceMapOption, pluginName: string, id: string, -): { code: string; map: M | string } { +): { code: string; map: M | undefined | string } { const hasRefresh = refreshContentRE.test(code) const onlyReactComp = !hasRefresh && reactCompRE.test(code) - if (!hasRefresh && !onlyReactComp) return { code, map } + const newMap = + map === avoidSourceMapOption + ? undefined + : typeof map === 'string' + ? (JSON.parse(map) as M) + : map + if (!hasRefresh && !onlyReactComp) return { code, map: newMap } + + const avoidSourceMap = map === avoidSourceMapOption - const newMap = typeof map === 'string' ? (JSON.parse(map) as M) : map let newCode = code if (hasRefresh) { - newCode = `let prevRefreshReg; + const refreshHead = removeLineBreaksIfNeeded( + `let prevRefreshReg; let prevRefreshSig; if (import.meta.hot && !inWebWorker) { @@ -43,7 +53,11 @@ if (import.meta.hot && !inWebWorker) { window.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform; } -${newCode} +`, + avoidSourceMap, + ) + + newCode = `${refreshHead}${newCode} if (import.meta.hot && !inWebWorker) { window.$RefreshReg$ = prevRefreshReg; @@ -55,10 +69,15 @@ if (import.meta.hot && !inWebWorker) { } } - newCode = `import * as RefreshRuntime from "${runtimePublicPath}"; + const sharedHead = removeLineBreaksIfNeeded( + `import * as RefreshRuntime from "${runtimePublicPath}"; const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope; -${newCode} +`, + avoidSourceMap, + ) + + newCode = `${sharedHead}${newCode} if (import.meta.hot && !inWebWorker) { RefreshRuntime.__hmr_import(import.meta.url).then((currentExports) => { @@ -81,3 +100,7 @@ if (import.meta.hot && !inWebWorker) { return { code: newCode, map: newMap } } + +function removeLineBreaksIfNeeded(code: string, enabled: boolean): string { + return enabled ? code.replace(/\n/g, '') : code +} diff --git a/packages/plugin-react-oxc/src/index.ts b/packages/plugin-react-oxc/src/index.ts index c9fdf129f..5eb93088b 100644 --- a/packages/plugin-react-oxc/src/index.ts +++ b/packages/plugin-react-oxc/src/index.ts @@ -4,6 +4,7 @@ import { readFileSync } from 'node:fs' import type { BuildOptions, Plugin, PluginOption } from 'vite' import { addRefreshWrapper, + avoidSourceMapOption, getPreambleCode, runtimePublicPath, silenceUseClientWarning, @@ -123,12 +124,13 @@ export default function viteReact(opts: Options = {}): PluginOption[] { code.includes(jsxImportRuntime)) if (!useFastRefresh) return - return addRefreshWrapper( + const { code: newCode } = addRefreshWrapper( code, - undefined, + avoidSourceMapOption, '@vitejs/plugin-react-oxc', id, ) + return { code: newCode, map: null } }, }, transformIndexHtml(_, config) { From 0d834be9f3fb693d4b9418ee75bf66cadcb61da2 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Mon, 7 Apr 2025 19:17:56 +0900 Subject: [PATCH 14/18] docs: update misc --- packages/plugin-react-oxc/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-react-oxc/README.md b/packages/plugin-react-oxc/README.md index 64a6213e2..f717cbf8e 100644 --- a/packages/plugin-react-oxc/README.md +++ b/packages/plugin-react-oxc/README.md @@ -40,7 +40,7 @@ export default defineConfig({ }) ``` -> `node_modules` are never processed by this plugin (but esbuild will) +> `node_modules` are never processed by this plugin (but Oxc will) ### jsxImportSource From 700af5b9ca12b872799bc063038920ba83f1a52f Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:49:07 +0900 Subject: [PATCH 15/18] refactor: remove react-refresh dep --- packages/plugin-react-oxc/package.json | 3 --- pnpm-lock.yaml | 4 ---- 2 files changed, 7 deletions(-) diff --git a/packages/plugin-react-oxc/package.json b/packages/plugin-react-oxc/package.json index 3e85a5155..3aeb7d4a4 100644 --- a/packages/plugin-react-oxc/package.json +++ b/packages/plugin-react-oxc/package.json @@ -39,9 +39,6 @@ "url": "https://github.com/vitejs/vite-plugin-react/issues" }, "homepage": "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#readme", - "dependencies": { - "react-refresh": "^0.14.2" - }, "peerDependencies": { "vite": "^6.3.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d24662e3..6e5181280 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -109,10 +109,6 @@ importers: version: 3.5.0(typescript@5.8.2) packages/plugin-react-oxc: - dependencies: - react-refresh: - specifier: ^0.14.2 - version: 0.14.2 devDependencies: '@vitejs/react-common': specifier: workspace:* From 76dbc772a4a2185a534aa95d0bc30a6278e4e59c Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:50:43 +0900 Subject: [PATCH 16/18] fix: call JSON.parse only when needed --- packages/common/refresh-utils.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/common/refresh-utils.ts b/packages/common/refresh-utils.ts index 93451eedb..e4d56d04d 100644 --- a/packages/common/refresh-utils.ts +++ b/packages/common/refresh-utils.ts @@ -21,18 +21,18 @@ export function addRefreshWrapper( map: M | string | undefined | typeof avoidSourceMapOption, pluginName: string, id: string, -): { code: string; map: M | undefined | string } { +): { code: string; map: M | null | undefined | string } { const hasRefresh = refreshContentRE.test(code) const onlyReactComp = !hasRefresh && reactCompRE.test(code) - const newMap = - map === avoidSourceMapOption - ? undefined - : typeof map === 'string' - ? (JSON.parse(map) as M) - : map - if (!hasRefresh && !onlyReactComp) return { code, map: newMap } + const normalizedMap = map === avoidSourceMapOption ? null : map + + if (!hasRefresh && !onlyReactComp) return { code, map: normalizedMap } const avoidSourceMap = map === avoidSourceMapOption + const newMap = + typeof normalizedMap === 'string' + ? (JSON.parse(normalizedMap) as M) + : normalizedMap let newCode = code if (hasRefresh) { From 2b00637c45b7fa62390a726f4946af3815922376 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Tue, 8 Apr 2025 11:01:49 +0900 Subject: [PATCH 17/18] fix: sourcemap line count --- packages/common/refresh-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/refresh-utils.ts b/packages/common/refresh-utils.ts index e4d56d04d..e068f1901 100644 --- a/packages/common/refresh-utils.ts +++ b/packages/common/refresh-utils.ts @@ -65,7 +65,7 @@ if (import.meta.hot && !inWebWorker) { } ` if (newMap) { - newMap.mappings = ';'.repeat(17) + newMap.mappings + newMap.mappings = ';'.repeat(16) + newMap.mappings } } From 8f90cb7a822bd8bd737d687cdaab63d03375a347 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Tue, 8 Apr 2025 23:07:37 +0900 Subject: [PATCH 18/18] refactor: remove `map: undefined` from `addRefreshWrapper` --- packages/common/refresh-utils.ts | 4 ++-- packages/plugin-react/src/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/common/refresh-utils.ts b/packages/common/refresh-utils.ts index e068f1901..008828797 100644 --- a/packages/common/refresh-utils.ts +++ b/packages/common/refresh-utils.ts @@ -18,10 +18,10 @@ export const avoidSourceMapOption = Symbol() export function addRefreshWrapper( code: string, - map: M | string | undefined | typeof avoidSourceMapOption, + map: M | string | typeof avoidSourceMapOption, pluginName: string, id: string, -): { code: string; map: M | null | undefined | string } { +): { code: string; map: M | null | string } { const hasRefresh = refreshContentRE.test(code) const onlyReactComp = !hasRefresh && reactCompRE.test(code) const normalizedMap = map === avoidSourceMapOption ? null : map diff --git a/packages/plugin-react/src/index.ts b/packages/plugin-react/src/index.ts index 14e1fd02a..8b1b2b1fc 100644 --- a/packages/plugin-react/src/index.ts +++ b/packages/plugin-react/src/index.ts @@ -255,7 +255,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] { } return addRefreshWrapper( result.code!, - result.map ?? undefined, + result.map!, '@vitejs/plugin-react', id, )