Skip to content

Explicitly Semantic VersioningΒ #3099

@Ryan-Dia

Description

@Ryan-Dia

The problem
The current package.json for @emotion/react and @emotion/styled is as follows:

"peerDependencies": {
    "react": ">=16.8.0"
  },
  "peerDependenciesMeta": {
    "@types/react": {
      "optional": true
    }
  },

This code is ultimately equivalent to the following code.

"peerDependencies": {
    "react": ">=16.8.0",
    "@types/react": "*"
  },
  "peerDependenciesMeta": {
    "@types/react": {
      "optional": true
    }
  },
image

Upon verification, I learned that the addition of peerDependenciesMeta was due to errors occurring in v10.

If using Meta, I believe it would be even better to explicitly align the version of react within peerDependencies. This is why I decided to write this message. Since you've already set React to be >=16.8.0, specifying @types/react >= 16.8.0 seems safer and more suitable for common practices than using @types/react "*" indiscriminately.

Proposed solution

Explicitly adding

@emotion/react

"peerDependencies": {
    "react": ">=16.8.0",
    "@types/react": ">=16.8.0"
  },
  "peerDependenciesMeta": {
    "@types/react": {
      "optional": true
    }
  },

@emotion/styled

"peerDependencies": {
    "@emotion/react": "^11.0.0-rc.0",
    "react": ">=16.8.0",
    "@types/react": ">=16.8.0"
  },
  "peerDependenciesMeta": {
    "@types/react": {
      "optional": true
    }
  },

Alternative solutions

Additional context

#3100

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions