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: Add optional typescript peerDependency to apollo-composable package #1546

Closed

Conversation

jnoordsij
Copy link
Contributor

Fixes #1499

@jnoordsij jnoordsij changed the title Add optional typescript peerDependency to apollo-composable package fix: Add optional typescript peerDependency to apollo-composable package Mar 26, 2024
@nickmessing
Copy link
Member

@jnoordsij, This is probably not the correct fix. This project can and is used by some people with plain JS. We should not add typescript as a peerDependency

@jnoordsij
Copy link
Contributor Author

Hey there, thanks for checking this! I do think this is the correct fix for this case, given

  • ts-essentials is listed as a (hard) dependency, although this is also only required for those using TypeScript
  • given that ts-essentials requires a (very broad but technically speaking still a) specific range of TypeScript versions and lists this as peerDependency, it is up to this package to fulfill that in some way
  • by explicitly marking it here as an optional peerDependency, it is up to the end-user to decide on wether or not to use TypeScript, therefore not adding an additional package (even though ts-essentials still is added)

The only alternative I see is moving ts-essentials to be an optional peerDependency, but I think that is more breaking and invasive to end-users, given that it is harder to realise that they should be providing that in case they are using TypeScript, compared to them installing typescript when they want to use TypeScript.

@nickmessing
Copy link
Member

@jnoordsij, oh, didn't realise that ts-essentials is a dependency O_O.

@Akryum wdyt on this?

@jnoordsij
Copy link
Contributor Author

As ts-essentials now has its typescript dependency marked as optional (see ts-essentials/ts-essentials#371), this is no longer required to fix the issue. One may opt to still add this as some possibly useful metadata, although maybe having it at ts-essentials and leaving it there suffices. So feel free to close this if there's no time or reason to review/merge this further.

@Akryum Akryum closed this Aug 14, 2024
@jnoordsij jnoordsij deleted the fix-apollo-composable-peer-deps branch August 14, 2024 14:53
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.

Missing peer dependency on typescript in @vue/apollo-composable
3 participants