Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: environment api #16129

Merged
merged 118 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
83068fe
feat: separate module graphs per environment
patak-dev Mar 10, 2024
5f5e0ec
feat: abstract moduleGraph into ModuleExecutionEnvironment
patak-dev Mar 10, 2024
281cf97
fix: call updateModules for each environmnet
patak-dev Mar 11, 2024
4808b27
chore: rename server environment to node environment
patak-dev Mar 11, 2024
95ae29b
refactor: move safeModulesPath set to server
patak-dev Mar 11, 2024
d8ff12a
chore: rename module and error back to ssrModule and ssrError
patak-dev Mar 11, 2024
e966ba0
feat: add `hot` property to environments
sheremet-va Mar 11, 2024
1fe63b1
chore: run prettier on environment file
sheremet-va Mar 11, 2024
5e60d8a
refactor: hooks get an environment object instead of a string
patak-dev Mar 11, 2024
30be775
fix: HotContext only gets ModuleExecutionEnvironment
patak-dev Mar 11, 2024
e30b858
refactor: options and environment are required when calling container…
patak-dev Mar 11, 2024
03d3889
refactor: rework resolveId in ModuleExecutionEnvironment constructor
patak-dev Mar 11, 2024
fcebb7d
feat: environment.transformRequest
patak-dev Mar 12, 2024
f927702
chore: lint
patak-dev Mar 12, 2024
88fea3b
feat: configureDevEnvironments + configureBuildEnvironments
patak-dev Mar 12, 2024
60f7f2b
feat: vite runtime renamed to module runner (#16137)
sheremet-va Mar 13, 2024
81abf6e
wip: environment config overrides
patak-dev Mar 13, 2024
a99475e
chore: merge main
patak-dev Mar 13, 2024
92eccf9
chore: lint
patak-dev Mar 13, 2024
f4789a3
feat: builder config, runBuildTasks option
patak-dev Mar 14, 2024
7f94c03
feat: server.runHmrTasks
patak-dev Mar 14, 2024
9a600fe
chore: update
patak-dev Mar 14, 2024
b9ad620
chore: merge main
patak-dev Mar 14, 2024
5c6b6ff
fix: type error
patak-dev Mar 14, 2024
3e6216c
refactor: hooks to config for creating environments
patak-dev Mar 16, 2024
6e71b24
refactor: ModuleExecutionEnvironment -> DevEnvironment
patak-dev Mar 16, 2024
29f1b7b
refactor: environment id,type -> name + fixes
patak-dev Mar 16, 2024
cef1091
feat: inject environment in build hooks
patak-dev Mar 16, 2024
e03bac8
refactor: node -> ssr for default environment
patak-dev Mar 17, 2024
f1d660c
refactor: environments as array instead of map (#16193)
patak-dev Mar 18, 2024
ccf3de4
refactor: clientEnvironment instead of browserEnvironment (#16194)
patak-dev Mar 20, 2024
27e6488
chore: merge main
patak-dev Mar 22, 2024
a7a06fe
refactor: environments array to plain object
patak-dev Mar 22, 2024
8000e8e
refactor: isolate back compat module graph in its own module
patak-dev Mar 22, 2024
fee54ea
refactor: configEnvironment hook + enviroment config resolving
patak-dev Mar 22, 2024
d9ed857
test: fix after merge
patak-dev Mar 22, 2024
dbcc375
feat: support transport options to communicate between the environmen…
sheremet-va Mar 22, 2024
3806fe6
fix: optimizeDeps backward compatibility layer
patak-dev Mar 22, 2024
85ada0d
fix: partial backward compat for config.ssr
patak-dev Mar 22, 2024
c4f4dfb
fix: use "register" event for remote environment transport
sheremet-va Mar 25, 2024
a5ef42e
test: add test for worker transport
sheremet-va Mar 25, 2024
f29e95a
refactor: remove default nodeModuleRunner because it's not used anywhere
sheremet-va Mar 25, 2024
c9abcfc
refactor: rename createSsrEnvironment to createNodeEnvironment
sheremet-va Mar 25, 2024
6040ab3
chore: fix lint
sheremet-va Mar 25, 2024
b4e46fe
chore: fix lint
sheremet-va Mar 25, 2024
fbe6361
feat: environment in hooks, context vs param (#16261)
patak-dev Mar 26, 2024
36463d2
chore: merge main
patak-dev Mar 27, 2024
52edfc9
refactor: pass down name to the environment factory
sheremet-va Mar 27, 2024
9005841
refactor: allow custom connections in node module runner
sheremet-va Mar 27, 2024
8785f4f
chore: lint
sheremet-va Mar 27, 2024
96e825a
feat: --environment in CLI
patak-dev Mar 28, 2024
5477972
refactor: use ssr environment module graph in ssrFixStacktrace
sheremet-va Mar 28, 2024
a160a1b
fix: add auto complete to server.environments
sheremet-va Mar 28, 2024
31e1d3a
fix: fine-grained hmr
sheremet-va Mar 28, 2024
72fe84e
refactor: rename ssrInvalidates to invalidates
sheremet-va Mar 28, 2024
c7e4da2
refactor: base environment.config + environment.options
patak-dev Mar 28, 2024
2ddf28e
chore: update environment.server.config
patak-dev Mar 28, 2024
681ccd4
fix: injectEnvironmentToHooks
patak-dev Mar 29, 2024
a1d385c
fix: injectEnvironmentInContext
patak-dev Mar 29, 2024
c1fc111
refactor: buildEnvironments + hmrEnvironments
patak-dev Mar 29, 2024
3d37ac1
feat(hmr): call `hotUpdate` hook with file create/delete (#16249)
sapphi-red Mar 29, 2024
6f9467e
chore: merge main
patak-dev Mar 29, 2024
a5c7e4f
test(environment): add environment playground (#16299)
hi-ogawa Mar 29, 2024
ca0ecf9
test: skip hmt ssr test for now
sheremet-va Mar 29, 2024
a0b7edb
refactor: rename "hmrEnvironments" to "hotUpdateEnvironments"
sheremet-va Mar 29, 2024
4986641
test: fix windows test
sheremet-va Mar 29, 2024
41dcca1
chore: merge main
patak-dev Mar 29, 2024
fb9365c
fix: resolve.externalConditions
patak-dev Mar 30, 2024
beb40ef
fix: missing externalConditions back compat
patak-dev Mar 31, 2024
ef8c9b9
feat: build.ssrEmitAssets -> build.emitAssets
patak-dev Mar 31, 2024
a183a0f
refactor: remove environment name from the hmr context
sheremet-va Apr 2, 2024
9cfa916
refactor: move transport to properties
sheremet-va Apr 2, 2024
dd6332e
feat: environment aware createResolver and resolvePlugin
patak-dev Apr 3, 2024
f1dcd2c
feat: environment aware createIdResolver
patak-dev Apr 3, 2024
0bec1b9
feat: environment id resolver for css plugin
patak-dev Apr 3, 2024
a7e52aa
feat: environment aware depsOptimizer
patak-dev Apr 4, 2024
5bd8e95
refactor: ssrConfig.optimizeDeps.include/exclude
patak-dev Apr 4, 2024
1a7d290
feat: ssr.target -> environment.webCompatible
patak-dev Apr 5, 2024
2a0b524
feat: ssr.external/noExternal -> resolve.external/noExternal
patak-dev Apr 5, 2024
f96f682
release: v6.0.0-alpha.0
patak-dev Apr 5, 2024
3a27870
docs: fix capitalization typos (#16309)
jay-es Mar 29, 2024
67a74f8
fix: csp nonce injection when no closing tag (#16281) (#16282)
gregtwallace Mar 31, 2024
b39a7ed
ci: run lint in node 20 (#16338)
sapphi-red Apr 3, 2024
833dabf
chore: merge
sapphi-red Apr 3, 2024
a88d572
chore(deps): update tj-actions/changed-files action to v44 (#16326)
renovate[bot] Apr 3, 2024
c7efec4
chore(deps): update all non-major dependencies (#16325)
renovate[bot] Apr 3, 2024
9699ba3
fix: fix sourcemap when using object as `define` value (#15805)
hi-ogawa Apr 3, 2024
6c5536b
fix: do not access document in `/@vite/client` when not defined (#16318)
keyding Apr 3, 2024
dfce45b
chore: `pnpm audit --fix` (#16346)
sapphi-red Apr 3, 2024
bcac048
chore: merge
sapphi-red Apr 3, 2024
8d08db4
ci: run publish in node 20 (#16348)
sapphi-red Apr 3, 2024
a9bf430
perf: reduce size of injected __vite__mapDeps code (#16184)
panstromek Apr 5, 2024
f61d8b1
perf(css): only replace empty chunk if imported (#16349)
bluwy Apr 5, 2024
5f3c44f
chore: merge main
patak-dev Apr 5, 2024
8621c3f
fix(environment): use `environments.client.build.outDir` for preview …
hi-ogawa Apr 6, 2024
27371dc
chore: remove ssrConfig
patak-dev Apr 6, 2024
d91714b
refactor: isFileServingAllowed load fallback for SSR
patak-dev Apr 6, 2024
ea1c7eb
refactor: environment.dev.recoverable
patak-dev Apr 6, 2024
0ea8be9
chore: remove ssr.target use
patak-dev Apr 6, 2024
3ba9214
feat: dedupe/preserveSymlinks
patak-dev Apr 8, 2024
70731ce
refactor: lib options
patak-dev Apr 8, 2024
d15a157
feat: async createEnvironment
patak-dev Apr 8, 2024
f10561b
chore: merge main
patak-dev Apr 8, 2024
bdf13bb
fix: package types
patak-dev Apr 8, 2024
7254175
release: v6.0.0-alpha.1
patak-dev Apr 8, 2024
1f644d0
feat: rework more ssr.target webworker branches
patak-dev Apr 9, 2024
9f9a716
feat: environment aware define
patak-dev Apr 9, 2024
4cd3183
chore: merge main
patak-dev Apr 9, 2024
46c8910
chore: update
patak-dev Apr 9, 2024
9c5321b
release: v6.0.0-alpha.2
patak-dev Apr 9, 2024
84299f3
feat: environment.dev.warmup
patak-dev Apr 10, 2024
59b995e
refactor: proxy environment logger, remove hardcoded `[vite]` from hm…
sheremet-va Apr 12, 2024
52a71e6
refactor: environments have colors in the logger, update logger.info …
sheremet-va Apr 12, 2024
ae1798f
chore: rename runner to evaluator in serverModuleRunner
sheremet-va Apr 16, 2024
5b57f63
feat: deprecate ssrLoadModule (#16431)
sheremet-va Apr 16, 2024
b4fdfaf
feat: keep url queries in ssr mode (#16400)
sheremet-va Apr 16, 2024
319b8e0
feat: decouple DevEnvironment and server (#16460)
patak-dev Apr 19, 2024
635e6d5
chore: merge main
patak-dev Apr 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/config/build-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,18 @@ When set to `true`, the build will also generate an SSR manifest for determining

Produce SSR-oriented build. The value can be a string to directly specify the SSR entry, or `true`, which requires specifying the SSR entry via `rollupOptions.input`.

## build.emitAssets

- **Type:** `boolean`
- **Default:** `false`

During non-client builds, static assets aren't emitted as it is assumed they would be emitted as part of the client build. This option allows frameworks to force emitting them in other environments build. It is responsibility of the framework to merge the assets with a post build step.

## build.ssrEmitAssets

- **Type:** `boolean`
- **Default:** `false`
- **Deprecated:** use `build.emitAssets`

During the SSR build, static assets aren't emitted as it is assumed they would be emitted as part of the client build. This option allows frameworks to force emitting them in both the client and SSR build. It is responsibility of the framework to merge the assets with a post build step.

Expand Down
1 change: 1 addition & 0 deletions docs/guide/api-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ interface ViteDevServer {
/**
* Programmatically resolve, load and transform a URL and get the result
* without going through the http request pipeline.
* @deprecated use environment.transformRequest
*/
transformRequest(
url: string,
Expand Down
14 changes: 4 additions & 10 deletions docs/guide/api-vite-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ export class ViteRuntime {
/**
* URL to execute. Accepts file path, server path, or id relative to the root.
*/
public async executeUrl<T = any>(url: string): Promise<T>
/**
* Entry point URL to execute. Accepts file path, server path or id relative to the root.
* In the case of a full reload triggered by HMR, this is the module that will be reloaded.
* If this method is called multiple times, all entry points will be reloaded one at a time.
*/
public async executeEntrypoint<T = any>(url: string): Promise<T>
public async import<T = any>(url: string): Promise<T>
/**
* Clear all caches including HMR listeners.
*/
Expand All @@ -57,7 +51,7 @@ The `ViteRuntime` class requires `root` and `fetchModule` options when initiated

Runner in `ViteRuntime` is responsible for executing the code. Vite exports `ESModulesRunner` out of the box, it uses `new AsyncFunction` to run the code. You can provide your own implementation if your JavaScript runtime doesn't support unsafe evaluation.

The two main methods that runtime exposes are `executeUrl` and `executeEntrypoint`. The only difference between them is that all modules executed by `executeEntrypoint` will be reexecuted if HMR triggers `full-reload` event. Be aware that Vite Runtime doesn't update `exports` object when this happens (it overrides it), you would need to run `executeUrl` or get the module from `moduleCache` again if you rely on having the latest `exports` object.
Module runner exposes `import` method. When Vite server triggers `full-reload` HMR event, all affected modules will be re-executed. Be aware that Module Runner doesn't update `exports` object when this happens (it overrides it), you would need to run `import` or get the module from `moduleCache` again if you rely on having the latest `exports` object.

**Example Usage:**

Expand All @@ -74,7 +68,7 @@ const runtime = new ViteRuntime(
new ESModulesRunner(),
)

await runtime.executeEntrypoint('/src/entry-point.js')
await runtime.import('/src/entry-point.js')
```

## `ViteRuntimeOptions`
Expand Down Expand Up @@ -209,7 +203,7 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url))
await server.listen()

const runtime = await createViteRuntime(server)
await runtime.executeEntrypoint('/src/entry-point.js')
await runtime.import('/src/entry-point.js')
})()
```

Expand Down
123 changes: 123 additions & 0 deletions packages/vite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,114 @@
## 6.0.0-alpha.2 (2024-04-09)

* chore: update ([46c8910](https://github.com/vitejs/vite/commit/46c8910))
* feat: environment aware define ([9f9a716](https://github.com/vitejs/vite/commit/9f9a716))
* feat: rework more ssr.target webworker branches ([1f644d0](https://github.com/vitejs/vite/commit/1f644d0))



## 6.0.0-alpha.1 (2024-04-08)

* fix: `fsp.rm` removing files does not take effect (#16032) ([b05c405](https://github.com/vitejs/vite/commit/b05c405)), closes [#16032](https://github.com/vitejs/vite/issues/16032)
* fix: csp nonce injection when no closing tag (#16281) (#16282) ([67a74f8](https://github.com/vitejs/vite/commit/67a74f8)), closes [#16281](https://github.com/vitejs/vite/issues/16281) [#16282](https://github.com/vitejs/vite/issues/16282)
* fix: do not access document in `/@vite/client` when not defined (#16318) ([6c5536b](https://github.com/vitejs/vite/commit/6c5536b)), closes [#16318](https://github.com/vitejs/vite/issues/16318)
* fix: fix sourcemap when using object as `define` value (#15805) ([9699ba3](https://github.com/vitejs/vite/commit/9699ba3)), closes [#15805](https://github.com/vitejs/vite/issues/15805)
* fix: package types ([bdf13bb](https://github.com/vitejs/vite/commit/bdf13bb))
* fix(deps): update all non-major dependencies (#16376) ([58a2938](https://github.com/vitejs/vite/commit/58a2938)), closes [#16376](https://github.com/vitejs/vite/issues/16376)
* fix(environment): use `environments.client.build.outDir` for preview (#16301) ([8621c3f](https://github.com/vitejs/vite/commit/8621c3f)), closes [#16301](https://github.com/vitejs/vite/issues/16301)
* feat: async createEnvironment ([d15a157](https://github.com/vitejs/vite/commit/d15a157))
* feat: dedupe/preserveSymlinks ([3ba9214](https://github.com/vitejs/vite/commit/3ba9214))
* refactor: environment.dev.recoverable ([ea1c7eb](https://github.com/vitejs/vite/commit/ea1c7eb))
* refactor: isFileServingAllowed load fallback for SSR ([d91714b](https://github.com/vitejs/vite/commit/d91714b))
* refactor: lib options ([70731ce](https://github.com/vitejs/vite/commit/70731ce))
* chore: merge ([bcac048](https://github.com/vitejs/vite/commit/bcac048))
* chore: merge ([833dabf](https://github.com/vitejs/vite/commit/833dabf))
* chore: remove ssr.target use ([0ea8be9](https://github.com/vitejs/vite/commit/0ea8be9))
* chore: remove ssrConfig ([27371dc](https://github.com/vitejs/vite/commit/27371dc))
* chore: update region comment (#16380) ([77562c3](https://github.com/vitejs/vite/commit/77562c3)), closes [#16380](https://github.com/vitejs/vite/issues/16380)
* chore(deps): update all non-major dependencies (#16325) ([c7efec4](https://github.com/vitejs/vite/commit/c7efec4)), closes [#16325](https://github.com/vitejs/vite/issues/16325)
* perf: reduce size of injected __vite__mapDeps code (#16184) ([a9bf430](https://github.com/vitejs/vite/commit/a9bf430)), closes [#16184](https://github.com/vitejs/vite/issues/16184)
* perf: reduce size of injected __vite__mapDeps code (#16184) ([c0ec6be](https://github.com/vitejs/vite/commit/c0ec6be)), closes [#16184](https://github.com/vitejs/vite/issues/16184)
* perf(css): only replace empty chunk if imported (#16349) ([f61d8b1](https://github.com/vitejs/vite/commit/f61d8b1)), closes [#16349](https://github.com/vitejs/vite/issues/16349)



## 6.0.0-alpha.0 (2024-04-05)

* feat: abstract moduleGraph into ModuleExecutionEnvironment ([5f5e0ec](https://github.com/vitejs/vite/commit/5f5e0ec))
* feat: add `hot` property to environments ([e966ba0](https://github.com/vitejs/vite/commit/e966ba0))
* feat: build.ssrEmitAssets -> build.emitAssets ([ef8c9b9](https://github.com/vitejs/vite/commit/ef8c9b9))
* feat: builder config, runBuildTasks option ([f4789a3](https://github.com/vitejs/vite/commit/f4789a3))
* feat: configureDevEnvironments + configureBuildEnvironments ([88fea3b](https://github.com/vitejs/vite/commit/88fea3b))
* feat: environment aware createIdResolver ([f1dcd2c](https://github.com/vitejs/vite/commit/f1dcd2c))
* feat: environment aware createResolver and resolvePlugin ([dd6332e](https://github.com/vitejs/vite/commit/dd6332e))
* feat: environment aware depsOptimizer ([a7e52aa](https://github.com/vitejs/vite/commit/a7e52aa))
* feat: environment id resolver for css plugin ([0bec1b9](https://github.com/vitejs/vite/commit/0bec1b9))
* feat: environment in hooks, context vs param (#16261) ([fbe6361](https://github.com/vitejs/vite/commit/fbe6361)), closes [#16261](https://github.com/vitejs/vite/issues/16261)
* feat: environment.transformRequest ([fcebb7d](https://github.com/vitejs/vite/commit/fcebb7d))
* feat: inject environment in build hooks ([cef1091](https://github.com/vitejs/vite/commit/cef1091))
* feat: separate module graphs per environment ([83068fe](https://github.com/vitejs/vite/commit/83068fe))
* feat: server.runHmrTasks ([7f94c03](https://github.com/vitejs/vite/commit/7f94c03))
* feat: ssr.external/noExternal -> resolve.external/noExternal ([2a0b524](https://github.com/vitejs/vite/commit/2a0b524))
* feat: ssr.target -> environment.webCompatible ([1a7d290](https://github.com/vitejs/vite/commit/1a7d290))
* feat: support transport options to communicate between the environment and the runner (#16209) ([dbcc375](https://github.com/vitejs/vite/commit/dbcc375)), closes [#16209](https://github.com/vitejs/vite/issues/16209)
* feat: vite runtime renamed to module runner (#16137) ([60f7f2b](https://github.com/vitejs/vite/commit/60f7f2b)), closes [#16137](https://github.com/vitejs/vite/issues/16137)
* feat(hmr): call `hotUpdate` hook with file create/delete (#16249) ([3d37ac1](https://github.com/vitejs/vite/commit/3d37ac1)), closes [#16249](https://github.com/vitejs/vite/issues/16249)
* refactor: allow custom connections in node module runner ([9005841](https://github.com/vitejs/vite/commit/9005841))
* refactor: base environment.config + environment.options ([c7e4da2](https://github.com/vitejs/vite/commit/c7e4da2))
* refactor: buildEnvironments + hmrEnvironments ([c1fc111](https://github.com/vitejs/vite/commit/c1fc111))
* refactor: clientEnvironment instead of browserEnvironment (#16194) ([ccf3de4](https://github.com/vitejs/vite/commit/ccf3de4)), closes [#16194](https://github.com/vitejs/vite/issues/16194)
* refactor: configEnvironment hook + enviroment config resolving ([fee54ea](https://github.com/vitejs/vite/commit/fee54ea))
* refactor: environment id,type -> name + fixes ([29f1b7b](https://github.com/vitejs/vite/commit/29f1b7b))
* refactor: environments array to plain object ([a7a06fe](https://github.com/vitejs/vite/commit/a7a06fe))
* refactor: environments as array instead of map (#16193) ([f1d660c](https://github.com/vitejs/vite/commit/f1d660c)), closes [#16193](https://github.com/vitejs/vite/issues/16193)
* refactor: hooks get an environment object instead of a string ([5e60d8a](https://github.com/vitejs/vite/commit/5e60d8a))
* refactor: hooks to config for creating environments ([3e6216c](https://github.com/vitejs/vite/commit/3e6216c))
* refactor: isolate back compat module graph in its own module ([8000e8e](https://github.com/vitejs/vite/commit/8000e8e))
* refactor: ModuleExecutionEnvironment -> DevEnvironment ([6e71b24](https://github.com/vitejs/vite/commit/6e71b24))
* refactor: move safeModulesPath set to server ([95ae29b](https://github.com/vitejs/vite/commit/95ae29b))
* refactor: move transport to properties ([9cfa916](https://github.com/vitejs/vite/commit/9cfa916))
* refactor: node -> ssr for default environment ([e03bac8](https://github.com/vitejs/vite/commit/e03bac8))
* refactor: options and environment are required when calling container.hook ([e30b858](https://github.com/vitejs/vite/commit/e30b858))
* refactor: pass down name to the environment factory ([52edfc9](https://github.com/vitejs/vite/commit/52edfc9))
* refactor: remove default nodeModuleRunner because it's not used anywhere ([f29e95a](https://github.com/vitejs/vite/commit/f29e95a))
* refactor: remove environment name from the hmr context ([a183a0f](https://github.com/vitejs/vite/commit/a183a0f))
* refactor: rename "hmrEnvironments" to "hotUpdateEnvironments" ([a0b7edb](https://github.com/vitejs/vite/commit/a0b7edb))
* refactor: rename createSsrEnvironment to createNodeEnvironment ([c9abcfc](https://github.com/vitejs/vite/commit/c9abcfc))
* refactor: rename ssrInvalidates to invalidates ([72fe84e](https://github.com/vitejs/vite/commit/72fe84e))
* refactor: rework resolveId in ModuleExecutionEnvironment constructor ([03d3889](https://github.com/vitejs/vite/commit/03d3889))
* refactor: ssrConfig.optimizeDeps.include/exclude ([5bd8e95](https://github.com/vitejs/vite/commit/5bd8e95))
* refactor: use ssr environment module graph in ssrFixStacktrace ([5477972](https://github.com/vitejs/vite/commit/5477972))
* fix: add auto complete to server.environments ([a160a1b](https://github.com/vitejs/vite/commit/a160a1b))
* fix: call updateModules for each environmnet ([281cf97](https://github.com/vitejs/vite/commit/281cf97))
* fix: fine-grained hmr ([31e1d3a](https://github.com/vitejs/vite/commit/31e1d3a))
* fix: HotContext only gets ModuleExecutionEnvironment ([30be775](https://github.com/vitejs/vite/commit/30be775))
* fix: injectEnvironmentInContext ([a1d385c](https://github.com/vitejs/vite/commit/a1d385c))
* fix: injectEnvironmentToHooks ([681ccd4](https://github.com/vitejs/vite/commit/681ccd4))
* fix: missing externalConditions back compat ([beb40ef](https://github.com/vitejs/vite/commit/beb40ef))
* fix: optimizeDeps backward compatibility layer ([3806fe6](https://github.com/vitejs/vite/commit/3806fe6))
* fix: partial backward compat for config.ssr ([85ada0d](https://github.com/vitejs/vite/commit/85ada0d))
* fix: resolve.externalConditions ([fb9365c](https://github.com/vitejs/vite/commit/fb9365c))
* fix: use "register" event for remote environment transport ([c4f4dfb](https://github.com/vitejs/vite/commit/c4f4dfb))
* fix(css): unknown file error happened with lightningcss (#16306) ([01af308](https://github.com/vitejs/vite/commit/01af308)), closes [#16306](https://github.com/vitejs/vite/issues/16306)
* fix(hmr): multiple updates happened when invalidate is called while multiple tabs open (#16307) ([21cc10b](https://github.com/vitejs/vite/commit/21cc10b)), closes [#16307](https://github.com/vitejs/vite/issues/16307)
* fix(scanner): duplicate modules for same id if glob is used in html-like types (#16305) ([eca68fa](https://github.com/vitejs/vite/commit/eca68fa)), closes [#16305](https://github.com/vitejs/vite/issues/16305)
* test: add test for worker transport ([a5ef42e](https://github.com/vitejs/vite/commit/a5ef42e))
* test: fix after merge ([d9ed857](https://github.com/vitejs/vite/commit/d9ed857))
* test(environment): add environment playground (#16299) ([a5c7e4f](https://github.com/vitejs/vite/commit/a5c7e4f)), closes [#16299](https://github.com/vitejs/vite/issues/16299)
* chore: fix lint ([b4e46fe](https://github.com/vitejs/vite/commit/b4e46fe))
* chore: fix lint ([6040ab3](https://github.com/vitejs/vite/commit/6040ab3))
* chore: lint ([8785f4f](https://github.com/vitejs/vite/commit/8785f4f))
* chore: lint ([92eccf9](https://github.com/vitejs/vite/commit/92eccf9))
* chore: lint ([f927702](https://github.com/vitejs/vite/commit/f927702))
* chore: rename module and error back to ssrModule and ssrError ([d8ff12a](https://github.com/vitejs/vite/commit/d8ff12a))
* chore: rename server environment to node environment ([4808b27](https://github.com/vitejs/vite/commit/4808b27))
* chore: run prettier on environment file ([1fe63b1](https://github.com/vitejs/vite/commit/1fe63b1))
* chore: update ([9a600fe](https://github.com/vitejs/vite/commit/9a600fe))
* chore: update environment.server.config ([2ddf28e](https://github.com/vitejs/vite/commit/2ddf28e))
* wip: environment config overrides ([81abf6e](https://github.com/vitejs/vite/commit/81abf6e))



## <small>5.2.9 (2024-04-15)</small>

* fix: `fsp.rm` removing files does not take effect (#16032) ([b05c405](https://github.com/vitejs/vite/commit/b05c405)), closes [#16032](https://github.com/vitejs/vite/issues/16032)
Expand All @@ -9,6 +120,18 @@



## <small>5.2.8 (2024-04-03)</small>

* release: v5.2.8 ([8b8d402](https://github.com/vitejs/vite/commit/8b8d402))
* fix: csp nonce injection when no closing tag (#16281) (#16282) ([3c85c6b](https://github.com/vitejs/vite/commit/3c85c6b)), closes [#16281](https://github.com/vitejs/vite/issues/16281) [#16282](https://github.com/vitejs/vite/issues/16282)
* fix: do not access document in `/@vite/client` when not defined (#16318) ([646319c](https://github.com/vitejs/vite/commit/646319c)), closes [#16318](https://github.com/vitejs/vite/issues/16318)
* fix: fix sourcemap when using object as `define` value (#15805) ([445c4f2](https://github.com/vitejs/vite/commit/445c4f2)), closes [#15805](https://github.com/vitejs/vite/issues/15805)
* chore(deps): update all non-major dependencies (#16325) ([a78e265](https://github.com/vitejs/vite/commit/a78e265)), closes [#16325](https://github.com/vitejs/vite/issues/16325)
* refactor: use types from sass instead of @types/sass (#16340) ([4581e83](https://github.com/vitejs/vite/commit/4581e83)), closes [#16340](https://github.com/vitejs/vite/issues/16340)




## <small>5.2.8 (2024-04-03)</small>

* fix: csp nonce injection when no closing tag (#16281) (#16282) ([3c85c6b](https://github.com/vitejs/vite/commit/3c85c6b)), closes [#16281](https://github.com/vitejs/vite/issues/16281) [#16282](https://github.com/vitejs/vite/issues/16282)
Expand Down
12 changes: 6 additions & 6 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite",
"version": "5.2.9",
"version": "6.0.0-alpha.2",
"type": "module",
"license": "MIT",
"author": "Evan You",
Expand Down Expand Up @@ -32,9 +32,9 @@
"./client": {
"types": "./client.d.ts"
},
"./runtime": {
"types": "./dist/node/runtime.d.ts",
"import": "./dist/node/runtime.js"
"./module-runner": {
"types": "./dist/node/module-runner.d.ts",
"import": "./dist/node/module-runner.js"
},
"./dist/client/*": "./dist/client/*",
"./types/*": {
Expand All @@ -44,8 +44,8 @@
},
"typesVersions": {
"*": {
"runtime": [
"dist/node/runtime.d.ts"
"module-runner": [
"dist/node/module-runner.d.ts"
]
}
},
Expand Down
12 changes: 6 additions & 6 deletions packages/vite/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ function createNodeConfig(isProduction: boolean) {
})
}

function createRuntimeConfig(isProduction: boolean) {
function createModuleRunnerConfig(isProduction: boolean) {
return defineConfig({
...sharedNodeOptions,
input: {
runtime: path.resolve(__dirname, 'src/runtime/index.ts'),
'module-runner': path.resolve(__dirname, 'src/module-runner/index.ts'),
},
output: {
...sharedNodeOptions.output,
Expand All @@ -202,7 +202,7 @@ function createRuntimeConfig(isProduction: boolean) {
isProduction ? false : './dist/node',
),
esbuildMinifyPlugin({ minify: false, minifySyntax: true }),
bundleSizeLimit(45),
bundleSizeLimit(47),
],
})
}
Expand Down Expand Up @@ -240,7 +240,7 @@ export default (commandLineArgs: any): RollupOptions[] => {
envConfig,
clientConfig,
createNodeConfig(isProduction),
createRuntimeConfig(isProduction),
createModuleRunnerConfig(isProduction),
createCjsConfig(isProduction),
])
}
Expand Down Expand Up @@ -332,10 +332,10 @@ const __require = require;
name: 'cjs-chunk-patch',
renderChunk(code, chunk) {
if (!chunk.fileName.includes('chunks/dep-')) return
// don't patch runtime utils chunk because it should stay lightweight and we know it doesn't use require
// don't patch runner utils chunk because it should stay lightweight and we know it doesn't use require
if (
chunk.name === 'utils' &&
chunk.moduleIds.some((id) => id.endsWith('/ssr/runtime/utils.ts'))
chunk.moduleIds.some((id) => id.endsWith('/ssr/module-runner/utils.ts'))
)
return
const match = code.match(/^(?:import[\s\S]*?;\s*)+/)
Expand Down
Loading
Loading