-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
use native useId
from Vue.js 3.5 when available
#3458
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@P4sca1 is attempting to deploy a commit to the Tailwind Labs Team on Vercel. A member of the Team first needs to authorize it. |
Relying on Vue 3.5 means that we have to introduce a breaking change and make a 2.0 release. Instead, `^3.2.0` also matches `3.5.x`. This means that we can check whether `useId` is available and use it, if not we fallback to our implementation.
Internal note: Vercel previews are currently failing because they are setup for the |
useId
from Vue.js 3.5 when available
Thank you for the change to keep support for older versions of vue! @RobinMalfait I am wondering if there is still a use case for providing a custom id generator with versions > 3.5? |
@P4sca1 the changes were introduced to prevent a breaking change. Thanks for the initial work on this! Regarding your question, I think the only real use case for providing custom Worst case, for testing reasons, you could mock the /cc @thecrypticace worked on this initially, so he might have some better insights on this. |
I suspect the answer to that question is no. The reason we added support for it in the first place was that Nuxt had its own With Vue v3.5 Nuxt is now using the native useId that's built in so the need for custom useId hooks is probably limited to pre-Vue 3.5 projects: https://github.com/nuxt/nuxt/pull/28285/files#diff-56fa79b2b6b6d55801e7e885441f1ee98891adfbbe7d11844721dcfdc2dc5583 |
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.
LGTM — works in Vue normally + when SSR'd in Nuxt
Thank you @P4sca1, this has been released in the latest version. |
What about insiders version? |
#3457
Vue 3.5 added a native SSR-safe
useId
function. This PR updates the code to use that function by default if no custom function has been provided.Theoretically this is a breaking change, as versions prior to Vue 3.5 are no longer supported.
However, package managers should emit a warning or an error when the peer dependency range is no longer satisfied.