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

[Bug]: Cannot find package '@internationalized/date' [email protected] #797

Closed
MellKam opened this issue Mar 30, 2024 · 3 comments · Fixed by #798
Closed

[Bug]: Cannot find package '@internationalized/date' [email protected] #797

MellKam opened this issue Mar 30, 2024 · 3 comments · Fixed by #798
Labels
bug Something isn't working

Comments

@MellKam
Copy link
Collaborator

MellKam commented Mar 30, 2024

Describe the bug

After the version 1.6.0 when you try to use radix-vue, without @internationalized/date package installed, it will throw an error. Although the package is listed as an optional peer dependency, it gets imported anyway when bundled into the single index.js file, causing the error.

We probably need to move the @internationalized/date package back to be just dependency.

Looking ahead, it would make sense to split the radix-vue package into a sub-packages for each component (as it does radix-ui). That would resolve this PR #469 and allow us to install only dependencies that we actually need.

Context & Screenshots (if applicable)

image

@zernonia
Copy link
Member

I don't really like splitting components into their own packages.. There's many depedency versioning issue, as you may observe in radix-ui. I prefer not to let dev worry about what version of DismissableLayer is compatible with which version of Dialog. This also ensure that we won't have much compatibility issue.

As for the case of @internationalized/date, I think we can future improve on this, maybe a different way to bundle the lib?
For now yeah we can add it back as deps to unblock 1.6.0

@zernonia zernonia reopened this Mar 30, 2024
@sadeghbarati
Copy link
Collaborator

sadeghbarati commented Mar 30, 2024

@MellKam, hi, can you share your project?

having a lot of deps for package is not good imo

peerDependency means it's user duty to install the package (it's not included in the radix-vue package)

Having it in dependencies means for every release the make we should do it too, which is not good for package maintainers


MeltUI is using it as dependency 🥲 I'm still not sure what will happen if we use that date pkg with different versions for example

  • one from radix-vue for example a lower version of @internationalized/date
  • and second from latest @internationalized/date

https://github.com/melt-ui/melt-ui/blob/develop/package.json#L66

@MellKam
Copy link
Collaborator Author

MellKam commented Mar 31, 2024

@sadeghbarati No, sorry. I can't share it. It's my work project. But I think you can easily reproduce it. Since we are bundling all the components into one index.js file, the import for @internationalized/date is also included in that file. So if you decide not to use any date components and do not install this dependency, you will see an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants