-
Notifications
You must be signed in to change notification settings - Fork 264
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
fix(utils): getRootNodes flattens only one depth of children #1546
Conversation
✅ Deploy Preview for vue-test-utils-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
I also have no idea how this works. The default depth is 1, which is obviously different from Infinity. That said, if the tests pass, I guess it's fine? I'd rather not have code we don't understand - if the tests pass, I'm guessing the default of 1 is fine. Another alternative would be |
I think TS blows when the depth is > 20. Maybe @freakzlike or @xanf can tell us if depth 1 is fine. If not, I guess we can merge and release, but maybe as a beta version to avoid breaking too many people if that doesn't work? That way we can test on our projects and release a stable version when we are OK with the changes. |
I'm not sure the value of a beta branch - who's going to test it other than us? Maybe we can run this fix against our code bases and see how it goes. Unless someone can come up with a failing case, I think we need to have confidence in our test suite. |
Let me check something in the upcoming day. I might have a case in my mind where this happens |
@lmiller1990 Some teams are running Renovate/dependabot updates with unstable versions to check for breaking changes (I know my teams do). A beta release makes it easy to test and makes sure we're not breaking everybody who updates automatically to the latest stable version 😉 If that's too much hassle for you to cut the releases, I can help if you grant me the permissions on NPM @freakzlike Thanks, that would be great! |
@cexbrayat curious what you mean by beta here - like How will anyone other than people reading this thread (which is just us, really) know to try the beta? As for permissions, you will need to ping Evan - it sure would be good for someone other than me to be able to cut releases 👍 |
Yeah it could be A beta release does not cost much, and people following the repo can see the beta release and give it a try. I agree this won't be a ton of people, but it's still better than going blindly IMHO. And even for people using a bot, having a failing bot PR adds work that is unnecessary: they have to investigate why, check for opened issues, open a new one, etc. I think this is OK when opting for unstable releases but not for stable ones. Again, this is just my POV. No worries if you prefer to go straight to production 😉 |
Ok, I will do a beta release. I will do it tomorrow. |
I was not able to reproduce the usage of export declare type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom> I tried this, but the arrays get wrapped by a vnode fragment and added by the recursive call: const wrapper = mount({
render() {
return [
h('span', 'Text 1'),
[
h('span', 'Text 2'),
h('span', 'Text 3'),
[h('span', 'Text 4'), h('span', 'Text 5')]
]
]
}
}) Might be that the |
TS v4.7 is now trying to compute the type more accurately in
flat()
andInfinity
is not playing very well: it throwsI'm wondering if we really need to flatten infinitely, as the following lines call
getRootNodes
recursively on each element. But as I'm a bit fuzzy on how this part of the code works, I'd like more informed opinions 😉