This repository was archived by the owner on Mar 19, 2026. It is now read-only.
forked from vitejs/vite
-
-
Notifications
You must be signed in to change notification settings - Fork 19
feat: rolldown vite full bundle mode #107
Closed
Closed
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
0d4d6c0
feat: rolldown full bundle mode
underfin 25f3e0e
feat: make memory files middleware work
underfin f183472
fix: make js define plugin works at dev build
underfin c57d182
fix: disable rolldown minify at devlopment build
underfin 2bbb201
fix: make watcher + rolldown hmr build work
underfin cf9e3cc
chore: disable ws validate connnection
underfin 6390882
chore: disable dev plugin relate logic
underfin 804a636
chore: enable loadfallback plugin at dev build
underfin 809c553
chore: disable depOptimizer
underfin 2715861
fix: set correct header for memory files
underfin bba3e73
chore: make test work, avoid overrides vitest vite
underfin 0a5a51a
chore: avoid watcher outdir
underfin 8a6293d
chore: fix lint
underfin d47db7c
fix: some isBuild using production mode
underfin 065e406
feat: using vite hmr runtime
underfin 947ec1e
fix: using rolldown hmr info
underfin 2cf5ff5
fix: define plugin should handle import.meta.hot
underfin 4452731
chore: revert ws connection logic
underfin f3fe74d
chore: patch rolldown runtime update
underfin c90d37b
fix: disable chunksReporter at development build
underfin f9c4c9f
fix: aovid resolveConfig twice at dev build
underfin 01ed745
feat: add experimental.fullBundleMode option
underfin 2e990e6
chore: add comment code
underfin 86e5869
chore: update pnpm.lock
underfin 0294228
chore: fix createBuilder typing
underfin 0768736
chore: fix cli fullBundleMode
underfin 8a0f40c
fix: __FULL_BUNDLE_MODE__ replace
underfin 7aba832
fix: merge experimental options
sapphi-red 3d991d9
fix: aovid replace import.meta.hot at full bundle mode
underfin 0d4f34c
fix: unit test
underfin 9278245
fix: define at full bundle mode
underfin 647fba4
Update packages/vite/src/client/hmrModuleRunner.ts
underfin 3909c8b
Update packages/vite/src/client/hmrModuleRunner.ts
underfin 9f4cdc5
chore: update clientInjection
underfin 23d8d36
fix: skip cachedTransformMiddleware at full bundle mode
underfin cb6710f
fix: enable servePublicMiddleware at full bundle mode
underfin 5e9a7ca
fix: make sure the server port and then start build
underfin cff15fb
refatcor: extract replaceClientConfigValues
underfin 7966b11
fix: aoivd import @vite/env at custome rolldown runtime
underfin 1aafd0d
fix: hmr root
underfin d3feb62
fix: close bundle at cli exit
underfin e75f4e9
fix: aovid replace import.met.hot to undefined
underfin 9b34da0
feat: setup full bundle mode test
underfin 60b406e
fix: aovid replace import.met.hot to undefined
underfin c509336
fix: enable createEsmInitializer createCjsInitializer
underfin b2493f2
chore: update hmr log
underfin 10b6a47
chore: update hmr test
underfin 532b4f0
fix: pass hmr self accept test
underfin c1d2a74
chore: disable dynamic import warning at dev build
underfin bbb1def
chore: remove watch changed file log
underfin 662fbb7
chore: pass deps related tests
underfin 064c268
fix: pass some hmr invalidate tests
underfin 28ad636
fix: ignored hmr soft invalidate
underfin c404332
fix: invalidate in circular dep
underfin 6d4a115
chore: disable not entry html hmr test and css hmr test
underfin 4d51f1d
chore: skip rolldown hmr for outside module graph
underfin 955a7ab
chore: fix lint
underfin 930092e
fix: disable treeshake becasue the minify is disabled
underfin 7976768
fix: htmlFallbackMiddleware should check fullBundleMode memoryFiles
underfin 09e498e
fix: patch rolldown module runner changes
underfin bac444e
feat: add hmr hot getExports
underfin 7ade2bc
chore: patch rolldown module runner changes
underfin eb361ca
chore: run hmr at first
underfin 467b118
feat: debounce reBuild
underfin bd44ee2
chore: using await bundle.watchFiles
underfin 950428b
chore: add hmr html files to rollupOptions.input
underfin 9c7f704
fix: react plugin get module exports
underfin 80f53db
feat: add build moduleGraph
underfin acd2c41
feat: make sourcemap work at full bundle mode dev
underfin f03bc47
chore: disable BuildModuleGraph
underfin bdb70a9
chore: rebase
underfin f7dc0b7
fix: aovid build oxc pluin enable jsx option
underfin 9f56cb8
fix: eanble native nativeModulePreloadPolyfillPlugin
underfin 01090e0
chore: fix fmt
underfin a28f815
fix: add cwd to hmr test
underfin bfb953f
chore: add test-full-bundle-mode in ci
underfin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| import { createHotContext } from './client' | ||
|
|
||
| declare const __FULL_BUNDLE_MODE__: boolean | ||
|
|
||
| if (__FULL_BUNDLE_MODE__) { | ||
| class DevRuntime { | ||
| modules: Record<string, { exports: any }> = {} | ||
|
|
||
| static getInstance() { | ||
| // @ts-expect-error __rolldown_runtime__ | ||
| let instance = globalThis.__rolldown_runtime__ | ||
| if (!instance) { | ||
| instance = new DevRuntime() | ||
| // @ts-expect-error __rolldown_runtime__ | ||
| globalThis.__rolldown_runtime__ = instance | ||
| } | ||
| return instance | ||
| } | ||
|
|
||
| createModuleHotContext(moduleId: string) { | ||
| return createHotContext(moduleId) | ||
| } | ||
|
|
||
| applyUpdates(_boundaries: string[]) { | ||
| // | ||
| } | ||
|
|
||
| registerModule( | ||
| id: string, | ||
| module: { exports: Record<string, () => unknown> }, | ||
| ) { | ||
| this.modules[id] = module | ||
| } | ||
|
|
||
| loadExports(id: string) { | ||
| const module = this.modules[id] | ||
| if (module) { | ||
| return module.exports | ||
| } else { | ||
| console.warn(`Module ${id} not found`) | ||
| return {} | ||
| } | ||
| } | ||
|
|
||
| // __esmMin | ||
| // @ts-expect-error need to add typing | ||
| createEsmInitializer = (fn, res) => () => (fn && (res = fn((fn = 0))), res) | ||
| // __commonJSMin | ||
| // @ts-expect-error need to add typing | ||
| createCjsInitializer = (cb, mod) => () => ( | ||
| mod || cb((mod = { exports: {} }).exports, mod), mod.exports | ||
| ) | ||
| // @ts-expect-error it is exits | ||
| __toESM = __toESM | ||
| // @ts-expect-error it is exits | ||
| __toCommonJS = __toCommonJS | ||
| // @ts-expect-error it is exits | ||
| __export = __export | ||
| } | ||
|
|
||
| // @ts-expect-error __rolldown_runtime__ | ||
| globalThis.__rolldown_runtime__ ||= new DevRuntime() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,10 +75,7 @@ describe('transformCjsImport', () => { | |
| ), | ||
| ).toBe( | ||
| 'import __vite__cjsImport0_react from "./node_modules/.vite/deps/react.js"; ' + | ||
| 'const react = ((m) => m?.__esModule ? m : {\n' + | ||
| '\t...typeof m === "object" && !Array.isArray(m) || typeof m === "function" ? m : {},\n' + | ||
| '\tdefault: m\n' + | ||
| '})(__vite__cjsImport0_react)', | ||
| 'const react = ((m) => m?.__esModule ? m : { ...typeof m === "object" && !Array.isArray(m) || typeof m === "function" ? m : {}, default: m })(__vite__cjsImport0_react)', | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is wired for it coudle be success at rolldown-vite branch.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's probably caused by the |
||
| ) | ||
| }) | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, I think it's good to have the types exposed from rolldown so that we can use it like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah.