Skip to content

🐛 Should not pinned dependencies #283

Description

@AntoLC

Problem

ui-kit is a dependency, so it is not good practice to pin the dependencies version, because it can result to multiple versions of a same dependency to the final app.

ui-kit/package.json

Lines 49 to 66 in e38a4a5

"dependencies": {
"@dnd-kit/core": "6.3.1",
"@dnd-kit/modifiers": "9.0.0",
"@dnd-kit/sortable": "10.0.0",
"@fontsource/material-icons": "5.2.5",
"@gouvfr-lasuite/cunningham-react": "4.3.0",
"@gouvfr-lasuite/cunningham-tokens": "3.1.0",
"@gouvfr-lasuite/integration": "1.0.2",
"@types/node": "22.10.7",
"clsx": "2.1.1",
"cmdk": "1.0.4",
"react-arborist": "3.4.3",
"react-aria-components": "1.16.0",
"react-resizable-panels": "2.1.7",
"react-stately": "3.37.0",
"react-virtualized": "9.22.6",
"react-pdf": "10.1.0"
},

Example

Docs app used @gouvfr-lasuite/cunningham-react": "4.3.1" and "@gouvfr-lasuite/ui-kit": "0.27.0", but @gouvfr-lasuite/ui-kit pin "@gouvfr-lasuite/cunningham-react": "4.3.0", meaning multiples versions of cunningham are in the app, creating these kind of side effects:

Image

Potential fix

 "dependencies": { 
   "@dnd-kit/core": "^6.3.1", 
   "@dnd-kit/modifiers": "^9.0.0", 
   "@dnd-kit/sortable": "^10.0.0", 
   "@fontsource/material-icons": "^5.2.5", 
   "@gouvfr-lasuite/cunningham-react": "^4.3.0", 
   "@gouvfr-lasuite/cunningham-tokens": "^3.1.0", 
   "@gouvfr-lasuite/integration": "^1.0.2", 
   "@types/node": "^22.10.7", 
   "clsx": "^2.1.1", 
   "cmdk": "^1.0.4", 
   "react-arborist": "^3.4.3", 
   "react-aria-components": "^1.16.0", 
   "react-resizable-panels": "^2.1.7", 
   "react-stately": "^3.37.0", 
   "react-virtualized": "^9.22.6", 
   "react-pdf": "^10.1.0" 
 }, 

Ref: suitenumerique/docs#2509

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions