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

fix(runtime): runtime HMR affects only imported files #15898

Merged
merged 15 commits into from
Feb 22, 2024

Conversation

sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Feb 13, 2024

Description

Currently, any full-reload event will reload all entrypoints in Vite Runtime. This PR adds a trigger property to the full-reload payload that is used to determine if the file is imported by the entrypoint (or if it's the entrypoint).

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines, especially the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

stackblitz bot commented Feb 13, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@sheremet-va sheremet-va changed the title fix(runtime): HMR affects only imported files fix(runtime): runtime HMR affects only imported files Feb 13, 2024
@sheremet-va sheremet-va marked this pull request as ready for review February 14, 2024 13:28
@sheremet-va sheremet-va added the p2-to-be-discussed Enhancement under consideration (priority) label Feb 14, 2024
@patak-dev patak-dev added the feat: environment API Vite Environment API label Feb 14, 2024
@sheremet-va
Copy link
Member Author

sheremet-va commented Feb 14, 2024

@patak-dev this can be reviewed. I think it would be nice to have this fix for #15774 (comment)

But it does affect the HMR API (adds a property), so I wanted to see what other people think

@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

📝 Ran ecosystem CI on 4ebc815: Open

suite result latest scheduled
analogjs success success
astro success success
histoire success success
ladle success success
laravel success success
marko success success
nuxt success success
nx failure failure
previewjs success success
qwik success success
rakkas success success
sveltekit success success
unocss success success
vike success success
vite-plugin-pwa success success
vite-plugin-react success success
vite-plugin-react-pages success success
vite-plugin-react-swc success success
vite-plugin-svelte success success
vite-plugin-vue success success
vite-setup-catalogue success success
vitepress success success
vitest success success

patak-dev
patak-dev previously approved these changes Feb 21, 2024
Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

@bluwy @sapphi-red I leave this one open until tomorrow in case you'd like to check it out before we merge it.

sapphi-red
sapphi-red previously approved these changes Feb 21, 2024
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

LGTM 👍

bluwy
bluwy previously approved these changes Feb 22, 2024
packages/vite/src/node/ssr/runtime/moduleCache.ts Outdated Show resolved Hide resolved
@patak-dev patak-dev merged commit 57463fc into vitejs:main Feb 22, 2024
10 checks passed
@sheremet-va sheremet-va deleted the fix/vite-node-hmr branch February 22, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: environment API Vite Environment API p2-to-be-discussed Enhancement under consideration (priority)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants