-
Notifications
You must be signed in to change notification settings - Fork 264
POC - Render all stub slots via config #102
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
Conversation
I think we should make an RFC explaining why we are doing this and what solution we offer. I can write up an RFC, explaining what we tried, what the limitations are and what alternatives people can use, along with what we are offering as "official" solution for the problem. This thing should imho be in the guides later on, so people are fully aware that this way of testing is not reliable, and will lead to problems if you rely 100% on it. |
Hm - we can do an RFC, sure. I feel like most of the people who have a strong opinion about rendering slots of stubbed components hold that opinion because that's how beta worked, and it will cause extra work for them to update their code-bases, not because it actually makes sense. Could we have a flag that attempts to simulate the old behavior to let people upgrade - kind of like what you did here where a component passed to I understand a lot of code-bases will break, and we do need to consider those people, and this flag (might) make it easier to upgrade. I don't think re-implementing this behavior purely because that's how it worked before is the right answer. |
Yeah, we can't really reimplement it fully anyway. It will be behind a flag, I just want to make sure people get it. |
I see two things to consider:
|
…s-config # Conflicts: # src/config.ts # src/stubs.ts
This looks pretty good. Are we going to bundle a helper too? Once that is done, I think we should take this chance to update the docs and explain how this works, and provide some examples on testing slots and stubs. I can look into shallowMount soon, it should be pretty easy with this PR merged in. |
# Conflicts: # src/stubs.ts
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.
This all seems good and well.
We will focus on docs for a bit now. Are you able to write about slots and stubs and shallowMount? You know it best and how it is used in large production apps.
Yeah ofc. |
@dobromir-hristov maybe we can add this info around here. We should also add a section about This can be done at any time, no rush. |
This is what I got... and I am not sure I like it...
shallowMount
.Check it out, play with it if you want. I wanted Evan to give me an advice on this, but yeah...
Related to #69