Skip to content

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

Merged
patak-cat merged 15 commits intovitejs:mainfrom
sheremet-va:fix/vite-node-hmr
Feb 22, 2024
Merged

fix(runtime): runtime HMR affects only imported files#15898
patak-cat merged 15 commits intovitejs:mainfrom
sheremet-va:fix/vite-node-hmr

Conversation

@sheremet-va
Copy link
Copy Markdown
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.

@bolt-new-by-stackblitz
Copy link
Copy Markdown

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-cat patak-cat added the feat: environment API Vite Environment API label Feb 14, 2024
@sheremet-va
Copy link
Copy Markdown
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-cat
Copy link
Copy Markdown
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link
Copy Markdown

📝 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-cat
patak-cat previously approved these changes Feb 21, 2024
Copy link
Copy Markdown
Member

@patak-cat patak-cat 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
Copy Markdown
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
Comment thread packages/vite/src/node/ssr/runtime/moduleCache.ts Outdated
@sheremet-va sheremet-va dismissed stale reviews from bluwy, sapphi-red, and patak-cat via 417c33a February 22, 2024 11:52
@patak-cat patak-cat merged commit 57463fc into vitejs:main Feb 22, 2024
@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