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

breaking: stricter type for depends #11201

Merged
merged 4 commits into from
Dec 7, 2023
Merged

breaking: stricter type for depends #11201

merged 4 commits into from
Dec 7, 2023

Conversation

dummdidumm
Copy link
Member

require a : when passing a string now
closes #9763

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:.

require a `:` when passing a string now
closes #9763
Copy link

changeset-bot bot commented Dec 5, 2023

🦋 Changeset detected

Latest commit: 2df43bc

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 Major

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

@benmccann benmccann added this to the 2.0 milestone Dec 5, 2023
@benmccann
Copy link
Member

Looks like some tests are failing because they don't contain : in the strings passed to invalidate

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
@dummdidumm
Copy link
Member Author

This actually unveiled a mistake I made - invalidate should still be allowed to be passed a string, because you can pass root-relative URLs to it and it will prepend the current host to it then.

@dummdidumm dummdidumm changed the title breaking: stricten types around depends and invalidate breaking: stricten type for depends Dec 6, 2023
@benmccann benmccann changed the title breaking: stricten type for depends breaking: stricter type for depends Dec 6, 2023
@benmccann
Copy link
Member

Should depends also support root-relative URLs? I'm not super familiar with the APIs, but it seems a little surprising to me that it'd be allowed in only one of the two

@dummdidumm
Copy link
Member Author

I don't think it should. depends is a low-level "pass a string here that you invalidate yourself manually", and you wouldn't pass root relative URLs in that case - URLs from fetch are already added to the invalidate array automatically by SvelteKit.

@dummdidumm dummdidumm merged commit 184331a into version-2 Dec 7, 2023
13 checks passed
@dummdidumm dummdidumm deleted the stricter-type branch December 7, 2023 12:48
@github-actions github-actions bot mentioned this pull request Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants