-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
feat(tsx): add support for passing generics to child components #11478
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1b8408d
feat(tsx): add support for passing generics to child components
Procrustes5 0f03fcf
test: add a component test
Procrustes5 7d9b1b0
Merge branch 'minor' into feat/tsx-generics
Procrustes5 1ee6911
Merge branch 'minor' into feat/tsx-generics
Procrustes5 2a06a1f
Merge branch 'minor' into feat/tsx-generics
Procrustes5 236be53
Merge branch 'minor' into feat/tsx-generics
Procrustes5 77d5e88
fix(types/custom-element): `defineCustomElement` with required props …
andylizi 15a5269
Merge branch 'minor' into feat/tsx-generics
Procrustes5 0a1b72b
Merge remote-tracking branch 'upstream/minor' into feat/tsx-generics
Procrustes5 5545aa2
fix(test): move test to defineComponent.test-d.tsx
Procrustes5 af13488
Merge branch 'minor' into feat/tsx-generics
Procrustes5 ee510d0
fix: modify the test to check only test
Procrustes5 afeda80
Revert "fix: modify the test to check only test"
Procrustes5 e46dfdd
fix: change test for component
Procrustes5 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 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 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 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 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
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.
What is the reason for this change? It doesn't seem to be related to types.
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.
@edison1105
The original code had logic to convert function components into objects, but I changed the runtime behavior using Proxy. This was intended to handle props when using Generic Components in TSX.
As you pointed out, this isn't related to types. I realized that by removing extraOptions in this modification, I might have eliminated the ability to extend types.
I'm planning to revert these changes, but is my thought process correct?
Thank you for reviewing multiple times.
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 am not sure about this, keep this, waiting for other team members' review
It looks like the test case is incorrect because it still passes without the changes in this PR.
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.
Thank you for review!
Does the fact that the test passes without this change mean that the following writing style already exists?
core/packages-private/dts-test/defineComponent.test-d.tsx
Lines 2058 to 2061 in e46dfdd
Or is there a possibility that the original type checking was loose and designed not to throw errors regardless of the writing style?
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.
@edison1105
It has been left here for a long time in a state where I can't proceed with anything. Is there anything I can do?