Skip to content

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

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

eltigerchino
Copy link
Member

@eltigerchino eltigerchino commented May 15, 2025

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:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@eltigerchino eltigerchino changed the title fix: avoid caching static analysis results during dev fix: correctly invalidate static analysis cache during dev May 15, 2025
Copy link

changeset-bot bot commented May 15, 2025

🦋 Changeset detected

Latest commit: 129c2bb

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

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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) => {
Copy link
Member

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

Copy link
Member Author

@eltigerchino eltigerchino May 16, 2025

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.

@eltigerchino eltigerchino changed the title fix: correctly invalidate static analysis cache during dev fix: correctly invalidate static analysis cache of child nodes during dev May 16, 2025
@eltigerchino eltigerchino marked this pull request as draft May 16, 2025 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy