Skip to content

refactor: include optional bundledDev in DevEnvironment instead of having a separate FBM DevEnvironment - #22587

Merged
sapphi-red merged 9 commits into
mainfrom
refactor/include-bundle-in-dev-environment
Jun 11, 2026
Merged

sapphi-red merged 9 commits into
mainfrom
refactor/include-bundle-in-dev-environment

Conversation

@sheremet-va

@sheremet-va sheremet-va commented Jun 2, 2026 •

Copy link
Copy Markdown
Member

This PR refactors how full bundle mode is handled inside Vite. Previously it was a separate environment that extended from DevEnvironment. Now it is a property on a DevEnvironment.

When implementing #21626, we need to provide separate versions of a runnable/fetchable environment if we are to keep the existing architecture (even if we keep the SSR handling inside FullBundleDevEnvironment). This makes it needlessly complex to deal with when working with environment API in userland.

By abandoning inheritance and refactoring it to use composition we can keep the existing architecture of a single "DevEnvironment".

There should be no change to the functionality itself, and I managed to keep the implementation intact.

I am open to changing the naming!

@sheremet-va sheremet-va changed the title refactor: include optional bundle in DevEnvironment instead of having a separate FBM DevEnvironment refactor: include optional bundledDev in DevEnvironment instead of having a separate FBM DevEnvironment Jun 2, 2026
const headers = isDev
? server.config.server.headers
: server.config.preview.headers
const headers = server.config.server.headers

@sheremet-va sheremet-va Jun 2, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isDev is always true here because fullBundle requires it

@sheremet-va
sheremet-va requested a review from sapphi-red June 3, 2026 05:55
@sapphi-red sapphi-red added the p1-chore Doesn't change code behavior (priority) label Jun 3, 2026
Comment thread packages/vite/src/node/config.ts Resolved
Co-authored-by: 翠 <green@sapphi.red>
@sapphi-red

Copy link
Copy Markdown
Member

I'll merge this after #22593 is merged

@sapphi-red
sapphi-red merged commit 5edd1d5 into main Jun 11, 2026
20 checks passed
@sapphi-red
sapphi-red deleted the refactor/include-bundle-in-dev-environment branch June 11, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p1-chore Doesn't change code behavior (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants