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

Self-referencing components are an undocumented breaking change #765

Closed
palant opened this issue Dec 25, 2020 · 2 comments
Closed

Self-referencing components are an undocumented breaking change #765

palant opened this issue Dec 25, 2020 · 2 comments

Comments

@palant
Copy link

palant commented Dec 25, 2020

The template compiler behavior changed for the following case:

<template>
  <custom-component />
</template>

With Vue 2 this would always resolve custom-component via component registration. With Vue 3, if this file is named CustomComponent.vue (camel-cased version of the tag name) this is automatically considered a self-reference, regardless of the component registration. While this behavior is intentional judging from the source code, it actually caused an infinite recursion in my code because of an unintended self-reference. So it needs to be documented in “Migration from Vue 2” at the very least.

For reference, the relevant commit: vuejs/core@67d1aac

@skirtles-code
Copy link
Contributor

There does seem to be an open discussion about how exactly this should work: vuejs/core#2827 (comment). See also vuejs/core#2821.

@skirtles-code
Copy link
Contributor

This has been changed in 3.0.8. It should now be consistent with Vue 2. The name of the file is now only taken into account if all else fails.

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

No branches or pull requests

2 participants