Skip to content

fix(FileUpload): declare file-selector as a dependency - #12730

Open
sebdanielsson wants to merge 1 commit into
patternfly:mainfrom
sebdanielsson:fix/react-core-declare-file-selector
Open

sebdanielsson wants to merge 1 commit into
patternfly:mainfrom
sebdanielsson:fix/react-core-declare-file-selector

Conversation

@sebdanielsson

@sebdanielsson sebdanielsson commented Nov 23, 2026 •

Copy link
Copy Markdown

What: Closes #12729

FileUpload imports fromEvent from file-selector, which @patternfly/react-core didn't declare: it only resolved through react-dropzone's own dependency being hoisted. With a strict node_modules layout (pnpm without hoisting, or pnpm's global virtual store), bundling an app that uses @patternfly/react-core fails with Can't resolve 'file-selector'.

This adds file-selector to @patternfly/react-core's dependencies with the range react-dropzone 14 uses (^2.1.0), so both resolve to the same copy; yarn.lock only gains the line in react-core's workspace entry. FileUpload.tsx is the only file in packages/ that imports it.

Additional issues: none.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NZ5218DQiHeeKGzo7MRyA3

Summary by CodeRabbit

  • Chores
    • Included a small internal maintenance update. No changes to user-visible features or app behavior are included in this pull request.

FileUpload imports fromEvent from file-selector, which @patternfly/react-core
doesn't declare: it only resolves because react-dropzone depends on it and
the package manager hoists it. With a strict node_modules layout, such as
pnpm without hoisting or its global virtual store, bundling an app that uses
@patternfly/react-core fails with "Can't resolve 'file-selector'".

Declare it with the range react-dropzone 14 uses (^2.1.0), so both resolve
to the same copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZ5218DQiHeeKGzo7MRyA3
Signed-off-by: Sebastian Danielsson <sebastian.danielsson@trafikverket.se>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The @patternfly/react-core package manifest now declares file-selector version ^2.1.0 as a dependency.

Changes

FileUpload dependency declaration

Layer / File(s) Summary
Declare file-selector dependency
packages/react-core/package.json
The package manifest adds file-selector version ^2.1.0 to the dependencies.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: kmcfaul, thatblindgeye

Merge Risk: Minimal · up to 1185f · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the FileUpload fix and the dependency added to @patternfly/react-core, which is the main change in the summary and objectives: file-selector is declared because FileUpload imports it d…
Linked Issues check Passed Issue #12729 requires that @patternfly/react-core declare every package it imports, so that FileUpload resolves in strict node_modules layouts. The reviewed change adds "file-selector": "^2.1.0" to pa…
Out of Scope Changes check Passed The reviewed change touches one file: packages/react-core/package.json, adding one dependency line. This line directly implements the dependency declaration required by #12729. No unrelated source, te…
Full details: Title check

Explanation

The title names the FileUpload fix and the dependency added to @patternfly/react-core, which is the main change in the summary and objectives: file-selector is declared because FileUpload imports it directly. The title uses the conventional fix(scope) form and is specific enough for a teammate scanning history.

Full details: Linked Issues check

Explanation

Issue #12729 requires that @patternfly/react-core declare every package it imports, so that FileUpload resolves in strict node_modules layouts. The reviewed change adds "file-selector": "^2.1.0" to packages/react-core/package.json dependencies (+1/-0, per the change summary). This declares the package that FileUpload.tsx imports through fromEvent. The declared range matches the range that react-dropzone 14 uses, as stated in the issue, so the requirement is met without a second version. No automated test is required by the issue. Limit: the change summary is the only evidence of the package.json edit. The source of FileUpload.tsx was not inspected, so the import is confirmed only by the issue text and the PR description.

Full details: Out of Scope Changes check

Explanation

The reviewed change touches one file: packages/react-core/package.json, adding one dependency line. This line directly implements the dependency declaration required by #12729. No unrelated source, test, or documentation changes are reported. yarn.lock is listed in ignored_files and was not inspected. Its contents are not needed to judge the scope of the coding change, and its absence is not treated as evidence of a problem.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4ec29e41-9450-40a0-ac63-449eb285d36a
Commits

Reviewing files that changed from the base of the PR and between 5276afd and 1185f4b.

Files ignored due to path filters: 1

  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing: 1

  • packages/react-core/package.json

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

This branch has not been deployed

No deployments
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.

Bug - FileUpload - @patternfly/react-core imports file-selector without declaring it

1 participant