-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add double check for 'keepFocus' and 'noScroll' in goto to allow for backcompatibity #7678
Conversation
…backcompatibility
🦋 Changeset detectedLatest commit: 691c9a9 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 |
I don't know whether you did something with line endings, but every single line appears as changed in Git. |
Which library depends on this and wants to be able to use both? Why doesn't the library do a major version bump (or a minor if in prerelease mode)? |
This change doesn't make sense to me. Why only throw an error if both the old and new form are set? Wouldn't this mean that someone who still only has |
My bad it was line endings, i fixed it now
I have a library that i've already fixed with the new case and bumped the version. But this way if an user uses my library (or some other library that want to mantain backcompatibility) they can use it either if they use a newer version of kit or an older one. And it also seems much more reasonable to check if both case exist instead of just one. |
It'll throw if there's no keepFocus AND there's keepfocus instead of throwing only if there's keepfocus. Basically if you have both it will not throw. If you have keepfocus without keepFocus it will throw. Here's the table of truth
|
Oh, I missed the |
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.
this addresses @Conduitry's response and fixes the typechecking failure
please fix the indentation. the diff should be 2 lines, not 1,726! |
I tested the formula but i'm an idiot and i tested the wrong thing. Fixed now...i'm trying to fix line endings now. |
I finally did it...sorry. |
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.
it's failing CI because you didn't run pnpm format
we got there in the end — thanks! |
Thank for your patience...did this rapidly with GitHub.dev but it got me in more trouble than cloning apparently lol |
It's a very simple change. It avoids throwing an error when keepfocus or noscroll it's in the opts of goto if there are also the correct case inside the opts. This should allow for back compatibility for library writers because they can pass both.
I wasn't able to run test for this.
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. All changesets should bepatch
until SvelteKit 1.0