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

Consider peerDependencies for provider SDK to Pulumi Core SDK dependency in Node #1240

Open
t0yv0 opened this issue Dec 19, 2024 · 4 comments
Labels
kind/engineering Work that is not visible to an external user

Comments

@t0yv0
Copy link
Member

t0yv0 commented Dec 19, 2024

Going from:

https://github.com/pulumi/pulumi-aws/blob/master/sdk/nodejs/package.json#L16C5-L16C38

To a peerDependency.

TBD. pro/con? Is it breaking (likely yes).

@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Dec 19, 2024
@t0yv0
Copy link
Member Author

t0yv0 commented Dec 19, 2024

Prior art: pulumi/pulumi#3090

@guineveresaenger
Copy link
Contributor

What are peerDependencies: https://nodejs.org/en/blog/npm/peer-dependencies

Sounds like a big con would be that manual intervention would have to happen on npm install if the dependency doesn't exist?

@guineveresaenger guineveresaenger removed the needs-triage Needs attention from the triage team label Dec 19, 2024
@t0yv0
Copy link
Member Author

t0yv0 commented Dec 19, 2024

Was just jotting this down from standup convo, I need to read up on peerDependencies. Some more context why this came up is that in pulumi/pulumi-aws-apigateway#178 YARN linked two versions of '@pulumi/pulumiinto the provider build which made if fail with a very obscure error. We're going to solve this withyarn deduplicate` but it was suggested that peerDependencies could be another way.

@t0yv0
Copy link
Member Author

t0yv0 commented Dec 19, 2024

Yeah the article explains it well I think. The suggestion here would be to treat @pulumi/aws SDK as a "plugin" that requests to be used with a certain range of @pulumi/pulumi versions by a peer dependency but not actually depend on it directly to avoid grabbing its own copy. So if that were done, the issue with pulumi-aws-apigateway having two copies of @pulumi/pulumi would not have occurred.

However @flostadler mentioned that moving from a direct dependency to a peer dependency is a breaking change, though I've not figured out why yet.

@mjeffryes mjeffryes added the kind/engineering Work that is not visible to an external user label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/engineering Work that is not visible to an external user
Projects
None yet
Development

No branches or pull requests

4 participants