Skip to content

Implicit dependency on plugins extended by external Day.js versions #957

@1o1w1

Description

@1o1w1

Issue

Picker props depend on an external Day.js instance, creating an implicit dependency on its plugins. This breaks when the app uses a different Day.js version.

It's very easy for multiple versions of Day.js to coexist in a single project. For example, see this commit: simply adding a latest Day.js dependency to my-component results in two different Day.js versions being present in the project.

In my actual project, the issue was even more subtle—merely updating a component that depends on Day.js inadvertently introduced a second Day.js version.

Reproduction Issue

  1. Clone the repository:
    git clone git@github.com:1o1w1/reproduction-rc-picker.git
  2. Install dependencies:
    pnpm install
  3. Start the component dev server:
    cd packages/my-component && npm run dev
  4. Start the application dev server:
    cd packages/my-app && npm run dev
  5. Open http://localhost:3000/ in your browser.
  6. Click the RangePicker — the app crashes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions