Skip to content

[WC-3666]: update react-dropzone to v20.1.4 - #2515

Merged
gjulivan merged 3 commits into
mainfrom
chore/bump-react-dropzone
Nov 19, 2026
Merged

gjulivan merged 3 commits into
mainfrom
chore/bump-react-dropzone

Conversation

@gjulivan

@gjulivan gjulivan commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Pull request type

Dependency changes (any modification to dependencies in package.json)


Description

Updates react-dropzone from 14.4.1 to 20.1.4 in file-uploader-web and rich-text-web. This also brings in attr-accept 4.0.1 and file-selector 5.0.2, and drops prop-types.

The local patch patches/react-dropzone.patch (stricter isExt extension check) is still needed, because 20.1.4 has the same regex. v16 removed dist/es/ and the UMD build, so the patch now targets dist/index.js, dist/index.cjs and src/utils/index.ts.

Breaking changes from 15 to 20, checked against our code:

  • v15, isDragReject cleared after drop: no impact. Both widgets read it only together with isDragActive.
  • v17, React >= 18 required, prop-types removed: no impact.
  • v18, full extension-to-MIME table no longer bundled: File Uploader's predefined formats (PDF, Office, CSV, ZIP, TXT, images, audio, video) are matched by MIME type only. file-selector 5 still includes a default table that covers all of them, so files the browser leaves without a type are still accepted. Only a custom format with an uncommon MIME type and no extensions loses that fallback.
  • v19, files up to the limit are accepted instead of the whole batch being rejected: Rich Text's image dialog uses multiple: false. When several images are dropped at once, the first one is now used; before, nothing happened. This is in the changelog. File Uploader sets no file limit, so it is not affected.
  • v20, Node >= 22 required: no impact. The repo requires Node 26.

Unit tests pass (File Uploader 137/137, Rich Text 605/605), lint has no errors, and both widgets build with the patched regex in the bundle.

What should be covered while testing?

  • File Uploader: drag and drop, and file picking, for each predefined format. Check that a disallowed file type is rejected.
  • File Uploader (WC-3675): on Windows with classic Outlook, in Chrome and Edge, with the app on HTTPS, drag an email attachment directly into the drop zone. It should upload without a SecurityError from FileSystemFileHandle.getFile in the console. If possible, also try the new web-based Outlook.
  • Rich Text: in the image dialog, upload one image, drop a file that is not an image, and drop several images at once (the first image is used).

🤖 Generated with Claude Code

@gjulivan
gjulivan requested a review from a team as a code owner November 4, 2026 15:08
@github-actions

This comment has been minimized.

@gjulivan gjulivan changed the title chore: update react-dropzone to v20.1.4 [WC-3666]: update react-dropzone to v20.1.4 Nov 4, 2026
@gjulivan
gjulivan force-pushed the chore/bump-react-dropzone branch from 6ed85d6 to 3a6ebd1 Compare November 16, 2026 23:08
@github-actions

This comment has been minimized.

@gjulivan
gjulivan force-pushed the chore/bump-react-dropzone branch from 3a6ebd1 to 1ac6a13 Compare November 18, 2026 10:30
@github-actions

This comment has been minimized.

r0b1n
r0b1n previously approved these changes Nov 18, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

leonardomendix
leonardomendix previously approved these changes Nov 19, 2026
gjulivan and others added 2 commits November 19, 2026 14:55
Bump react-dropzone from 14.4.1 to 20.1.4 in file-uploader-web and
rich-text-web. Regenerate the isExt patch for the new dist layout
(dist/index.js, dist/index.cjs), since the upstream regex is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rowser type

react-dropzone 18+ only guesses a file type from a small built-in table. Pass
file-selector's COMMON_MIME_TYPES through getFilesFromEvent so files such as
.log, .yaml, .flac, .mkv and .odt still match their format.

Also document the react-dropzone 20 behavior changes in the File Uploader and
Rich Text changelogs: wildcard MIME types narrowed by extensions, paste to
upload, and hyphenated extensions now accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gjulivan
gjulivan force-pushed the chore/bump-react-dropzone branch from 1afebba to bcf566b Compare November 19, 2026 13:55
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

AI Code Review

⚠️ Approved with suggestions — low-severity items only, safe to merge


What was reviewed

File Change
file-uploader-web/src/components/Dropzone.tsx Passes a custom getFilesFromEvent that uses file-selector with the full COMMON_MIME_TYPES table, so files with no browser MIME type still match their format
file-uploader-web/src/components/__tests__/Dropzone.spec.tsx New tests: extension-only files are accepted for each format, and a file of another type is still rejected
file-uploader-web/{package.json,tsconfig.json} react-dropzone ^20.1.4, file-selector ^5.0.2, and a path mapping for file-selector/mime types
rich-text-web/package.json react-dropzone ^20.1.4
file-uploader-web/CHANGELOG.md, rich-text-web/CHANGELOG.md Unreleased entries for both widgets
patches/react-dropzone.patch Regenerated for the new dist/index.js, dist/index.cjs and src/utils/index.ts layout

Skipped (out of scope): pnpm-lock.yaml

CI: pending: sigridci · unrelated failures: security/snyk (external scanner, 16 tests; not tied to this diff, but worth a look because this is a dependency bump)


Findings

⚠️ Low — Changelog entries describe the library, not widget behavior

File: packages/pluggableWidgets/file-uploader-web/CHANGELOG.md line 19 (same entry in rich-text-web/CHANGELOG.md)
Problem: "We updated the react-dropzone library to version 20." is an implementation detail. AGENTS.md says changelogs cover widget behavior only. The behavior changes are already listed in the other entries.
Fix: Remove this entry from both changelogs.


Questions

  • The File Uploader now accepts custom formats that combine a wildcard MIME type with extensions (for example image/* plus .png) only for those extensions. This narrows what existing configurations accept, and it is listed under "Changed" rather than as a breaking change. Is that the intended severity?

Positives

  • The File Uploader's extension-less file handling is covered by behavior tests that drive a real drop event. Each test is paired with a rejection case, so a loose accept rule would fail them.
  • The PR description lists the v15–v20 breaking changes and checks each against both widgets.
  • file-selector is declared as a direct dependency instead of being imported through a transitive one.

@gjulivan
gjulivan merged commit 4ab1494 into main Nov 19, 2026
15 of 16 checks passed
@gjulivan
gjulivan deleted the chore/bump-react-dropzone branch November 19, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants