Skip to content

Fix package.json dependency declaration#50

Open
zackdotcomputer wants to merge 1 commit intozoom:masterfrom
zackdotcomputer:master
Open

Fix package.json dependency declaration#50
zackdotcomputer wants to merge 1 commit intozoom:masterfrom
zackdotcomputer:master

Conversation

@zackdotcomputer
Copy link

@zackdotcomputer zackdotcomputer commented Aug 17, 2023

There are two issues with the current structure of the package.json file that cause friction for consumers of this package.

  1. The package.json file declares identical dependencies and peerDependencies objects. This causes confusion as to what packages are actually being installed, as dependencies causes downstream consumers to download the requirements while peerDependencies does not but rather causes package managers to throw warnings if the package requested does not appear as a top-level dependency of the consuming package itself. (Sorry that was the word "package" an awful lot in there - starting to hit semantic exhaustion.) The TLDR here is each package should either be declared as a dependency OR as a peer dependency, but not both. I've opted to fix this in my suggestion by removing the peer dependencies other than react, but I acknowledge that's a personal choice I made because my project does not use redux or lodash. If your intention would be that consuming apps should explicitly install those packages as well, then they also should be moved to peer dependencies and noted in the documentation.
  2. The package.json file declares a precise, fixed version for every dependency (other than lodash). This is risky because it can cause multiple copies of a dependency like react, which is known to cause annoying bugs due to name collisions. Instead, flexible packages like react should be declared with version ranges (here I've suggested using > your specified version for react, and ^ the specified version for redux).

I'm aware that because this SDK is, unfortunately, closed source that it's unlikely you can apply this patch directly. However, since this is causing us active issues in our usage of the SDK, I'm hoping you can incorporate this to your closed source and then issue an update that uses it. I would really appreciate being able to loosen some of our overriding resolutions definitions to fix type conflicts between your dependencies and our own.

@zackdotcomputer
Copy link
Author

Additionally, there's an issue with the latest version where you have imported redux-thunk@2.4.2, which depends on redux@^4 but you haven't updated your redux install from v3 to match.

@zackdotcomputer
Copy link
Author

I've updated this to latest.

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.

1 participant