@nasti-toolchain/nasti 2.4.4 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -0
- package/dist/cli.cjs +1716 -215
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1707 -206
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +2160 -318
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -1
- package/dist/index.d.ts +85 -1
- package/dist/index.js +2158 -317
- package/dist/index.js.map +1 -1
- package/package.json +18 -1
package/README.md
CHANGED
|
@@ -183,6 +183,82 @@ function myPlugin(): NastiPlugin {
|
|
|
183
183
|
}
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
+
## React pipeline
|
|
187
|
+
|
|
188
|
+
React projects keep the existing automatic JSX and Fast Refresh behavior. The transform is now
|
|
189
|
+
configured through a dedicated pipeline whose option names follow `@vitejs/plugin-react`:
|
|
190
|
+
|
|
191
|
+
```ts
|
|
192
|
+
export default defineConfig({
|
|
193
|
+
framework: 'react',
|
|
194
|
+
react: {
|
|
195
|
+
include: /\.[tj]sx?$/,
|
|
196
|
+
exclude: /node_modules/,
|
|
197
|
+
jsxRuntime: 'automatic',
|
|
198
|
+
jsxImportSource: 'react',
|
|
199
|
+
},
|
|
200
|
+
})
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The pipeline stays in the legacy transform slot: existing plugins still receive the same source
|
|
204
|
+
shape and run in the same order in development and production.
|
|
205
|
+
|
|
206
|
+
### React Compiler (experimental)
|
|
207
|
+
|
|
208
|
+
Install the optional native compiler and enable it explicitly:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
npm install -D oxc-transform-react
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
export default defineConfig({
|
|
216
|
+
framework: 'react',
|
|
217
|
+
react: {
|
|
218
|
+
compiler: true,
|
|
219
|
+
// Or: compiler: { compilationMode: 'annotation', target: '19' },
|
|
220
|
+
},
|
|
221
|
+
})
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Compiler optimization is limited to `client` consumers. Server environments still use the same
|
|
225
|
+
JSX runtime transform without compiling component memoization, which keeps server/client graphs
|
|
226
|
+
explicit for full-stack frameworks.
|
|
227
|
+
|
|
228
|
+
### RSC reference generator (experimental)
|
|
229
|
+
|
|
230
|
+
The opt-in `rsc()` plugin provides the low-level bundler generation needed by React Server
|
|
231
|
+
Components: `"use client"` proxies in the RSC graph, file-level `"use server"` references,
|
|
232
|
+
automatic client-boundary entries, the `react-server` condition, and an inspectable chunk
|
|
233
|
+
manifest.
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
npm install react-server-dom-webpack
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
import { defineConfig, rsc } from '@nasti-toolchain/nasti'
|
|
241
|
+
|
|
242
|
+
export default defineConfig({
|
|
243
|
+
framework: 'react',
|
|
244
|
+
plugins: [
|
|
245
|
+
rsc({
|
|
246
|
+
entries: {
|
|
247
|
+
client: 'src/entry.client.tsx',
|
|
248
|
+
ssr: 'src/entry.ssr.tsx',
|
|
249
|
+
rsc: 'src/entry.rsc.tsx',
|
|
250
|
+
},
|
|
251
|
+
}),
|
|
252
|
+
],
|
|
253
|
+
})
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Production builds emit `rsc-manifest.json`, mapping stable `/<root-relative-module>#<export>`
|
|
257
|
+
reference IDs to real client/RSC chunks. A framework remains responsible for request routing,
|
|
258
|
+
Flight streaming, and installing its server-function dispatcher at
|
|
259
|
+
`globalThis[Symbol.for('nasti.rsc.callServer')]`. This split lets Kunlun Next.js own application
|
|
260
|
+
conventions without coupling Nasti to a specific runtime.
|
|
261
|
+
|
|
186
262
|
## Vue 支持
|
|
187
263
|
|
|
188
264
|
Vue 支持需要安装可选依赖:
|