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 manifest not updating on route creation #5157

Merged
merged 13 commits into from
Jun 22, 2022

Conversation

gtm-nayan
Copy link
Contributor

@gtm-nayan gtm-nayan commented Jun 4, 2022

Just checking CI for now, hopefully won't break #4997 (merci Windows gods 🙏) Yayy

Fixes #5142

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. All changesets should be patch until SvelteKit 1.0

@changeset-bot
Copy link

changeset-bot bot commented Jun 4, 2022

🦋 Changeset detected

Latest commit: 2a96daf

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

@gtm-nayan gtm-nayan changed the title fix glob for ignoring outDir fix manifest not updating on route creation Jun 4, 2022
@gtm-nayan
Copy link
Contributor Author

Not sure what to do about tests, this test should've caught #5142, no?

@benmccann
Copy link
Member

I ran test/apps/basics and created a new route as that test does. I didn't have any problem visiting the new route, but when I visited /routing again the page contents were totally different. Maybe we should update test to also visit /routing and check that "Great success!" is on the page or something along those lines

if a dir is ignored, its children aren't tried at all
@gtm-nayan
Copy link
Contributor Author

Still passes, it shows the correct text for a brief moment before it changes to the wrong one during hydration. Is there a way to wait for hydration to complete or should I just add a timeout?

@Rich-Harris
Copy link
Member

page.goto already waits for hydration...

const goto = page.goto;
page.goto =
/**
* @param {string} url
* @param {object} opts
*/
async function (url, opts) {
const res = await goto.call(page, url, opts);
if (javaScriptEnabled) {
await page.waitForSelector('body.started', { timeout: 5000 });
}
return res;
};
await use(page);
...which basically means you can only test non-hydrated content by checking !javaScriptEnabled

@benmccann
Copy link
Member

It's weird the text is updating. The test only runs if JavaScript is not enabled

@gtm-nayan
Copy link
Contributor Author

If it's not skipped when javascriptEnabled is true, then it errors with
waiting for selector "body.started" to be visible

This means it's failing the hydration right? Even before the assertion

@gtm-nayan
Copy link
Contributor Author

gtm-nayan commented Jun 6, 2022

Lol if I use something like zzz.svelte instead of bar it actually fails at the right point because it loads the wrong route when navigating to zzz,

no clue why it doesn't work with bar

I'll run it a few more times to see if it's reliable or not

@gtm-nayan
Copy link
Contributor Author

Failing test is from adapter-static, it passed in the previous run

@Rich-Harris Rich-Harris merged commit a6781ae into sveltejs:master Jun 22, 2022
@Rich-Harris
Copy link
Member

👍

@gtm-nayan gtm-nayan deleted the manifest-bug branch June 27, 2022 12:07
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.

New pages redirect to index or throw a 500 error
3 participants