Skip to content
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(config): Do not use config.renderStubDefaultSlot #1797

Merged
merged 1 commit into from Oct 16, 2022

Conversation

xanf
Copy link
Collaborator

@xanf xanf commented Oct 6, 2022

Right now I've spent 30 minutes figuring why my default slots in stubs were not rendered, just to figure out, that our docs mention global.renderStubDefaultSlot as the way to control stub behavior, however we have both config.renderStubDefaultSlot and config.global.renderStubDefaultSlot with first being a preference

While technically this is a breaking change, I find an ability to define same thing in two places extremely confusing and fix for affected codebases will be trivial (swap config.renderStubDefaultSlot with config.global.renderStubDefaultSlot)

Otherwise, if we decide that we do not want to have such breaking change, I suggest swapping priority, so config.global.renderStubDefaultSlot will be taken into account before config.renderStubDefaultSlot and mark config.renderStubDefaultSlot as deprecated

@netlify
Copy link

netlify bot commented Oct 6, 2022

Deploy Preview for vue-test-utils-docs ready!

Name Link
🔨 Latest commit e5b7c9c
🔍 Latest deploy log https://app.netlify.com/sites/vue-test-utils-docs/deploys/634af5315741b400094d7bbd
😎 Deploy Preview https://deploy-preview-1797--vue-test-utils-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@xanf xanf force-pushed the xanf-drop-config-renderStubDefaultSlot branch from 93a6a3d to d16ceb7 Compare October 6, 2022 11:12
Copy link
Member

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine - I don't think that many people are using this, except people who know VTU really well.

Can you write a short and simple explanation for this so we can include it in the patch notes @xanf? Then we can merge and release.

Copy link
Member

@cexbrayat cexbrayat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I don't think this is too breaking, but maybe we could have an intermediate state that does not remove the option but logs a warning about its deprecation and indicates that config.global.renderStubDefaultSlot should be preferred? I think marking it with @deprecated can also help in the meantime, as people can spot the deprecation via their IDE or ESLint. Then we could really remove the option in the following release (maybe v2.1)

But I'm fine with going straight ahead as well if it is properly documented, as I don't think this is widely used.

* docs mention config.global.renderStubDefaultSlot
* get rid of double definition
@xanf xanf force-pushed the xanf-drop-config-renderStubDefaultSlot branch from d16ceb7 to e5b7c9c Compare October 15, 2022 18:00
@xanf
Copy link
Collaborator Author

xanf commented Oct 15, 2022

@lmiller1990 @cexbrayat I've updated PR with your suggestions:

  • config.renderStubDefaultSlot is marked as deprecated in typescript
  • We will trigger console warning when config.renderStubDefaultSlot is set to true even if user is not using TypeScript

Copy link
Member

@cexbrayat cexbrayat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cexbrayat cexbrayat merged commit 348d651 into main Oct 16, 2022
@cexbrayat cexbrayat deleted the xanf-drop-config-renderStubDefaultSlot branch October 16, 2022 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants