-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
detect missing ids when prerendering #7375
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
Conversation
🦋 Changeset detectedLatest commit: d1431c2 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 |
|
The deploy failure is because this is working — it's identified an incorrect link |
…er.handleMissingId
|
This replaces Remaining question is whether the default for |
dummdidumm
left a comment
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.
Apart from a minor naming (which I'm ok with if you turn it down) thing this looks good!
| const expected_deeplinks = new Map(); | ||
|
|
||
| /** @type {Map<string, string[]>} */ | ||
| const actual_deeplinks = new Map(); |
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.
I was confused for a moment because I understand a regular link to not just the home page by "deeplink", I think something like "hashlink" would be better.
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.
agree — fixed
Closes #3955. This throws an error in the case where a page links to
/a#band/adoesn't include an element withid="b".We probably want to make that behaviour configurable somehow, since some people might want a warning rather than an error, or even custom error handling. For normal prerendering errors this is enabled via
config.kit.prerender.onError, but the API can't accommodate these errors. I'm not really sure what to do about that, so I'm just going to leave this in draft for now.Also not pictured: tests of funky IDs that involve URL or HTML encoding. No idea if that works in this branch currently but either way it needs tests.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. All changesets should bepatchuntil SvelteKit 1.0