Skip to content

[Feat] Simplified peerDependencies policy #8802

Open
@donmccurdy

Description

@donmccurdy

Target Use Case

An idea for discussion.

Some modules now have a significant number of peer dependencies. @deck.gl/carto is one example, with seven peer dependencies, soon to be eight, which increases the complexity of setup for new users.

As a maintainer, it's not always clear to me which modules belong in dependencies vs. peerDependencies, or whether there's an established policy. See the @luma.gl/* dependencies here:

"dependencies": {
"@luma.gl/constants": "^9.0.11",
"@luma.gl/shadertools": "^9.0.11",
"@math.gl/web-mercator": "^4.0.0",
"d3-hexbin": "^0.2.1"
},
"peerDependencies": {
"@deck.gl/core": "^9.0.0-beta",
"@deck.gl/layers": "^9.0.0-beta",
"@luma.gl/core": "^9.0.0",
"@luma.gl/engine": "^9.0.0"
},

Each time a peer dependency is added, or its version incremented, that is technically a breaking change under semver. Whether it breaks users in practice would depend on whether the package in question was already somewhere in the dependency chain, which is hard to predict.

Proposal

Perhaps a way to simplify this — while avoiding the "mismatched dependencies" risk — would be to take a policy that the relevant */core module is always a peer dependency, while any other visgl-related modules are production dependencies, unless there's some particular reason for an exception?

Because everything else depends on the */core modules, I think that could be a way to minimize what end-users need to install, while also ensuring that compatible versions are used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions