-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: correctly invalidate static analysis cache of child nodes during dev #13793
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 129c2bb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@@ -387,10 +387,14 @@ export async function dev(vite, vite_config, svelte_config) { | |||
} | |||
}); | |||
|
|||
// changing the svelte config requires restarting the dev server | |||
// the config is only read on start and passed on to vite-plugin-svelte | |||
// which needs up-to-date values to operate correctly | |||
vite.watcher.on('change', async (file) => { |
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.
could you add a comment here and/or 30 lines above where we have watch('change', (file) => { ...
? From a quick glance, I'm not sure what the difference is between them and why we need two file watchers
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.
Good idea. Found out these all use the same vite.watcher
but watch
only runs for certain files. The problem lies elsewhere.
Forgot to add the static analysis cache invalidation to the Vite file change listener.Currently, if the page options of a parent node is updated during development, the child nodes incorrectly use the stale cached results instead of inheriting the new page options of the parent.This PR intends to ensure updating the page options in a layout during development updates the affected children too.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits