-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat: Bindable
types
#11225
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
Merged
Merged
feat: Bindable
types
#11225
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b05d8fa
feat: add types for expressing bindable types
dummdidumm b9b0235
Merge branch 'main' into bindable-types
dummdidumm 61a73a4
wip
dummdidumm 4feb112
Merge branch 'main' into bindable-types
dummdidumm 0a07f95
Merge branch 'main' into bindable-types
dummdidumm 3ea49f4
remove _explicit_ dance, language tools will generate an overriding c…
dummdidumm fadb489
work around TS limitation
dummdidumm b9ee487
Merge branch 'main' into bindable-types
dummdidumm 6d04a5b
hide helper type from public api
dummdidumm 971427f
simpler type
dummdidumm f61c7c3
update
dummdidumm 1f58030
fix
dummdidumm 8451a79
Merge branch 'main' into bindable-types
dummdidumm e951ae3
tweak
dummdidumm 09617ba
Merge branch 'main' into bindable-types
dummdidumm f08aba0
more docs, fix type
dummdidumm 359653f
changeset
dummdidumm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"svelte": patch | ||
--- | ||
|
||
feat: introduce types to express bindability |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
import type { Bindable } from '../index.js'; | ||
|
||
/** Anything except a function */ | ||
export type NotFunction<T> = T extends Function ? never : T; | ||
|
||
export type RemoveBindable<Props extends Record<string, any>> = { | ||
[Key in keyof Props]: Props[Key] extends Bindable<infer Value> ? Value : Props[Key]; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
tangential to this PR but it seems extremely weird to pass in
filename
here, just so it can be attached to an error object if there's a parse error. i think we should get rid of that