-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Basic attribute inheritance #4049
Conversation
Sorry, I should have run all the tests locally, not just the ones with |
I don't understand some of the test failures, because it looks like e.g. ... There has to be a better way to approach this. This approach sucks. |
Are you still working on this? There are multiple cases to handle. Scenario 1: Only one root tag<template>
<div></div>
</template> Should inherit Scenario 2: Multiple root tags<template>
<div class="111"></div>
<div class="111"></div>
</template> Should not inherit. Scenario 3: Using v-bind without
|
Yeah I have scenario 1 and 2, I'm not planning on ever supporting scenario 3, and I'm not sure how to approach scenario 4. (I'm not sure how to reach in and get the value of But I'm running into roadblocks for the more trivial task of "always inherit attrs from the child, if there's only 1" as seen by failing test cases here... I tried fixing one thing (the latest commit) and it both breaks component typing in some cases and also breaks what initially worked w/r/t inheriting attributes. Do you think there's a better way to approach implementing this? |
I can give it a shot, but I prefer to work in a separate PR to avoid git reset. I can add you as a co-author. WDYT? 👀 |
Sure, that would work! I only started this cause I made some dumb mistakes that would have been caught with |
d0abf57
to
aab3a8a
Compare
31e60a3
to
b7fdfc3
Compare
c25bd5a
to
35f876d
Compare
c6cab9a
to
ab8df96
Compare
This PR adds attribute inheritance irrelevant of the
inheritAttrs
configuration option (for now). This is in pursuit of makingstrictTemplates
more useful.I'm not sure how to check
inheritAttrs
as a follow up: I suppose probablyscriptSetupRanges
/scriptRanges
?Two things I noticed (not sure if these are already tracked or if I just am incorrect about these):
@vue-expect-error
doesn't seem to error if the next statement doesn't error<template>
just don't seem to get typed? (this must be expected behavior that I just don't get given that I don't use vue much...)