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

Handle Vite 4.3 module graph changes #6716

Closed
wants to merge 1 commit into from
Closed

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Mar 31, 2023

Changes

DRAFT until the Vite PR is merged

Handle the changes for vitejs/vite#11973

We use the module graph to scan for CSS to prevent FOUC. We crawl it using mod.importedModules, but the field is meant for client-side imports only. Vite had mixed it with SSR and is now un-mixing it in vitejs/vite#11973.

Although this feels like a breaking change, I think it can be justified that we should've used mod.ssrTransformResult.deps instead for SSR stuff, and that mod.importedModules were only supposed to be client-side only.

Vite 4.3 will introduce mod.ssrImportedModules instead so I've updated to anticipate it when we upgrade to Vite 4.3.

Testing

Existing tests should pass. Though we're not using Vite 4.3 yet, vite-ecosystem-ci will test against it.

Docs

n/a. bug fix.

@changeset-bot
Copy link

changeset-bot bot commented Mar 31, 2023

🦋 Changeset detected

Latest commit: 9c0551d

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 31, 2023
@bluwy
Copy link
Member Author

bluwy commented Apr 19, 2023

Closing as the Vite change will happen in Vite 5.

@bluwy bluwy closed this Apr 19, 2023
@bluwy bluwy deleted the handle-vite-4.3-imports branch April 19, 2023 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant