Skip to content

fallthroughAttributes does not work with generic components #4884

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

Closed
jods4 opened this issue Sep 25, 2024 · 3 comments · Fixed by #4886
Closed

fallthroughAttributes does not work with generic components #4884

jods4 opened this issue Sep 25, 2024 · 3 comments · Fixed by #4886
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@jods4
Copy link

jods4 commented Sep 25, 2024

Vue - Official extension or vue-tsc version

2.1.6

VSCode version

1.93.1

Vue version

5.4.8

TypeScript version

5.6.2

System Info

I have a playground repro, check it out

package.json dependencies

No response

Steps to reproduce

Check out the repro in playground link below.

It seems that all you need to break fallthroughAttributes is a generic component as the wrapper.

What is expected?

In playground, I expect completion for :str, which is a props of Comp2, that is wrapped by Comp1 with fallthrough.

What is actually happening?

I don't get completion.
Note that all it takes to fix it is to remove the generic="T" in Comp1. If the wrapper is not generic, it seems to work.

Link to minimal reproduction

https://play.vuejs.org/#eNqNUk1r3DAQ/StTXTaFYNNtC8U4C2kJtD20oQ30Iihee+xVKktCGm0XjP97RjbxZkMSchHz+ebN6A3i0rlsH1EUogy1V44gIEW3kUb1znqCATy2MELrbQ8rLl0tqS+2d+/mhBRZPrkJTApppKmtCQR96OAiQZytvqLWFv5Yr5s3q7fSlPk8kWexQ9g7XRGyB1DO0EV1IcUHKSDnaJk/KBHnggJPaFWX3QZrmP+QGqWouVNp9D8dKWYgRQFTJuUqJvD/+xQjH/H8Pl7vsP73RPw2HFJMimuPAf2eN1tyVPkOaU5f/f6BB7aXZG+bqLn6heQvDFbHxHEu+xxNw7Qf1E1sv02nVqa7CVcHQhPul0pEU+U41UvBd09He271ltFo523sdpdEXm0j4SmONCNfdfnEx4oAXZmOv4O4Czo06FXN7g3wcmiawELZFmBiv0XPYOKooAS5PpXJ+iiTBltl8NpbF8oBqiPE5uwVGllvBm6CcSxn3Cd0ssx7aSMuPSUSyBfp4cu/gkqj9pPBZtCWJr2ync/xx4z+7tGnf2RC77OP2Scx3gEwRi8l

Any additional comments?

No response

@KazariEX KazariEX added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first design limitation and removed pending triage labels Sep 26, 2024
@KazariEX
Copy link
Member

KazariEX commented Sep 26, 2024

Generic cannot be passed across components. It might be a design limitation.

It is better to explicitly specify the parent component that has root generic component as a generic component, rather than passing it via fallthrough attributes.

@jods4
Copy link
Author

jods4 commented Sep 26, 2024

@KazariEX Indeed, a wrapped (root) generic component cannot be inferred automatically across another component.
I also agree that the best approach for this issue is to have the wrapper use some explicit generic instantiation.

My issue here is that if the wrapper is generic -- and the inner component might not be -- there is no fallthrough happening at all, as demonstrated in repro.

This case should be doable, I've managed to do it myself here: #4882 (comment)

@KazariEX
Copy link
Member

Sorry, I misread it. This is indeed a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants