Skip to content

Import Preact from @uppy/utils to guarantee a single version#6206

Open
Murderlon wants to merge 5 commits intomainfrom
preact-utils
Open

Import Preact from @uppy/utils to guarantee a single version#6206
Murderlon wants to merge 5 commits intomainfrom
preact-utils

Conversation

@Murderlon
Copy link
Member

@Murderlon Murderlon commented Mar 3, 2026

fixes #6173
closes #6202

@changeset-bot
Copy link

changeset-bot bot commented Mar 3, 2026

🦋 Changeset detected

Latest commit: e353bd4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 41 packages
Name Type
@uppy/google-photos-picker Major
@uppy/google-drive-picker Major
@uppy/image-generator Major
@uppy/provider-views Major
@uppy/screen-capture Major
@uppy/google-drive Major
@uppy/image-editor Major
@uppy/components Major
@uppy/compressor Major
@uppy/status-bar Major
@uppy/dashboard Major
@uppy/drag-drop Major
@uppy/instagram Major
@uppy/facebook Major
@uppy/onedrive Major
@uppy/unsplash Major
@uppy/dropbox Major
@uppy/svelte Major
@uppy/webcam Major
@uppy/webdav Major
@uppy/audio Major
@uppy/react Major
@uppy/utils Minor
@uppy/core Minor
@uppy/zoom Major
@uppy/box Major
@uppy/url Major
@uppy/vue Major
uppy Patch
@uppy/remote-sources Major
@uppy/angular Major
@uppy/golden-retriever Major
@uppy/xhr-upload Major
@uppy/aws-s3 Major
@uppy/companion-client Major
@uppy/drop-target Major
@uppy/form Major
@uppy/locales Patch
@uppy/thumbnail-generator Major
@uppy/transloadit Major
@uppy/tus Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mifi mifi marked this pull request as ready for review March 10, 2026 15:35
@mifi mifi requested a review from qxprakash March 10, 2026 15:35
Copy link
Contributor

@mifi mifi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit unusual approach imo but we can try and see if it works on the next release, worst case we just revert it

Copy link
Collaborator

@qxprakash qxprakash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pragmatic approach for us ! , btw no changeset ?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses the Preact multi-version/runtime mismatch that can occur when Uppy packages and the consuming app end up resolving different preact instances, by centralizing Preact imports through @uppy/utils and removing direct preact dependencies from many packages.

Changes:

  • Add @uppy/utils/preact and @uppy/utils/preact/hooks entrypoints (re-exporting from preact).
  • Update TS/TSX/Svelte/Vue/React wrappers across packages to import Preact APIs via @uppy/utils/preact* instead of preact*.
  • Remove preact from many package dependencies and update the lockfile accordingly.

Reviewed changes

Copilot reviewed 96 out of 115 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
yarn.lock Removes many workspace-level preact deps and adds @uppy/utils where needed to reflect new import strategy.
packages/@uppy/zoom/src/Zoom.tsx Switches Preact import to @uppy/utils/preact.
packages/@uppy/zoom/package.json Drops direct preact dependency.
packages/@uppy/webdav/src/Webdav.tsx Switches Preact + hooks imports to @uppy/utils/preact*.
packages/@uppy/webdav/package.json Drops direct preact dependency.
packages/@uppy/webcam/src/Webcam.tsx Switches Preact import to @uppy/utils/preact (plus minor import reordering).
packages/@uppy/webcam/src/VideoSourceSelect.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/webcam/src/PermissionsScreen.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/webcam/src/CameraScreen.tsx Switches Preact component/types import to @uppy/utils/preact.
packages/@uppy/webcam/src/CameraIcon.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/webcam/package.json Drops direct preact dependency.
packages/@uppy/vue/src/headless/generated/UploadButton.ts Switches Preact imports to @uppy/utils/preact in Vue wrapper.
packages/@uppy/vue/src/headless/generated/Thumbnail.ts Switches Preact imports to @uppy/utils/preact in Vue wrapper.
packages/@uppy/vue/src/headless/generated/ProviderIcon.ts Switches Preact imports to @uppy/utils/preact in Vue wrapper.
packages/@uppy/vue/src/headless/generated/FilesList.ts Switches Preact imports to @uppy/utils/preact in Vue wrapper.
packages/@uppy/vue/src/headless/generated/FilesGrid.ts Switches Preact imports to @uppy/utils/preact in Vue wrapper.
packages/@uppy/vue/src/headless/generated/Dropzone.ts Switches Preact imports to @uppy/utils/preact in Vue wrapper.
packages/@uppy/vue/package.json Replaces preact dependency with @uppy/utils.
packages/@uppy/utils/src/preact/index.ts Adds @uppy/utils/preact re-export entrypoint.
packages/@uppy/utils/src/preact/hooks.ts Adds @uppy/utils/preact/hooks re-export entrypoint.
packages/@uppy/utils/package.json Exposes new export subpaths for the Preact re-exports.
packages/@uppy/url/src/UrlUI.tsx Switches Preact imports to @uppy/utils/preact.
packages/@uppy/url/src/Url.tsx Switches Preact import to @uppy/utils/preact.
packages/@uppy/url/package.json Drops direct preact dependency.
packages/@uppy/unsplash/src/Unsplash.tsx Switches Preact import to @uppy/utils/preact.
packages/@uppy/unsplash/package.json Drops direct preact dependency.
packages/@uppy/svelte/src/lib/components/headless/generated/UploadButton.svelte Switches Preact imports to @uppy/utils/preact in Svelte wrapper.
packages/@uppy/svelte/src/lib/components/headless/generated/Thumbnail.svelte Switches Preact imports to @uppy/utils/preact in Svelte wrapper.
packages/@uppy/svelte/src/lib/components/headless/generated/ProviderIcon.svelte Switches Preact imports to @uppy/utils/preact in Svelte wrapper.
packages/@uppy/svelte/src/lib/components/headless/generated/FilesList.svelte Switches Preact imports to @uppy/utils/preact in Svelte wrapper.
packages/@uppy/svelte/src/lib/components/headless/generated/FilesGrid.svelte Switches Preact imports to @uppy/utils/preact in Svelte wrapper.
packages/@uppy/svelte/src/lib/components/headless/generated/Dropzone.svelte Switches Preact imports to @uppy/utils/preact in Svelte wrapper.
packages/@uppy/svelte/package.json Replaces preact dependency with @uppy/utils.
packages/@uppy/status-bar/src/StatusBar.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/status-bar/package.json Drops direct preact dependency.
packages/@uppy/screen-capture/src/SubmitButton.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/screen-capture/src/StopWatch.tsx Switches Preact import to @uppy/utils/preact.
packages/@uppy/screen-capture/src/ScreenCapture.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/screen-capture/src/RecorderScreen.tsx Switches Preact imports to @uppy/utils/preact.
packages/@uppy/screen-capture/src/RecordButton.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/screen-capture/src/DiscardButton.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/screen-capture/package.json Drops direct preact dependency.
packages/@uppy/react/src/headless/generated/UploadButton.tsx Switches Preact imports to @uppy/utils/preact in React wrapper.
packages/@uppy/react/src/headless/generated/Thumbnail.tsx Switches Preact imports to @uppy/utils/preact in React wrapper.
packages/@uppy/react/src/headless/generated/ProviderIcon.tsx Switches Preact imports to @uppy/utils/preact in React wrapper.
packages/@uppy/react/src/headless/generated/FilesList.tsx Switches Preact imports to @uppy/utils/preact in React wrapper.
packages/@uppy/react/src/headless/generated/FilesGrid.tsx Switches Preact imports to @uppy/utils/preact in React wrapper.
packages/@uppy/react/src/headless/generated/Dropzone.tsx Switches Preact imports to @uppy/utils/preact in React wrapper.
packages/@uppy/react/package.json Replaces preact dependency with @uppy/utils.
packages/@uppy/provider-views/src/useSearchForm.ts Switches Preact hooks imports to @uppy/utils/preact/hooks.
packages/@uppy/provider-views/src/SearchView.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/provider-views/src/ProviderView/User.tsx Switches Fragment import to @uppy/utils/preact.
packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/provider-views/src/ProviderView/Header.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/provider-views/src/ProviderView/AuthView.tsx Switches Preact + hooks imports to @uppy/utils/preact*.
packages/@uppy/provider-views/src/Item/index.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/provider-views/src/Item/components/ListItem.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/provider-views/src/Item/components/ItemIcon.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/provider-views/src/Item/components/GridItem.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/provider-views/src/GooglePicker/googlePicker.ts Switches Preact hook type import to @uppy/utils/preact/hooks.
packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx Switches Preact hooks imports to @uppy/utils/preact/hooks.
packages/@uppy/provider-views/src/FooterActions.tsx Switches useMemo import to @uppy/utils/preact/hooks.
packages/@uppy/provider-views/src/Browser.tsx Switches Preact hooks imports to @uppy/utils/preact/hooks.
packages/@uppy/provider-views/src/Breadcrumbs.tsx Switches Preact imports to @uppy/utils/preact.
packages/@uppy/provider-views/package.json Drops direct preact dependency.
packages/@uppy/onedrive/src/OneDrive.tsx Switches Preact import to @uppy/utils/preact.
packages/@uppy/onedrive/package.json Drops direct preact dependency.
packages/@uppy/instagram/src/Instagram.tsx Switches Preact import to @uppy/utils/preact.
packages/@uppy/instagram/package.json Drops direct preact dependency.
packages/@uppy/image-generator/src/index.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/image-generator/package.json Drops direct preact dependency.
packages/@uppy/image-editor/src/Editor.tsx Switches Component import to @uppy/utils/preact.
packages/@uppy/image-editor/package.json Drops direct preact dependency.
packages/@uppy/google-photos-picker/package.json Drops direct preact dependency.
packages/@uppy/google-drive/src/GoogleDrive.tsx Switches Preact import to @uppy/utils/preact.
packages/@uppy/google-drive/package.json Drops direct preact dependency.
packages/@uppy/google-drive-picker/package.json Drops direct preact dependency.
packages/@uppy/facebook/src/Facebook.tsx Switches Preact import to @uppy/utils/preact.
packages/@uppy/facebook/package.json Drops direct preact dependency.
packages/@uppy/dropbox/src/Dropbox.tsx Switches Preact import to @uppy/utils/preact.
packages/@uppy/dropbox/package.json Drops direct preact dependency.
packages/@uppy/drag-drop/src/DragDrop.tsx Switches Preact imports to @uppy/utils/preact.
packages/@uppy/drag-drop/package.json Drops direct preact dependency.
packages/@uppy/dashboard/src/components/StatusBar/StatusBar.tsx Switches Preact imports to @uppy/utils/preact.
packages/@uppy/dashboard/src/components/Slide.tsx Switches Preact + hooks imports to @uppy/utils/preact*.
packages/@uppy/dashboard/src/components/PickerPanelContent.tsx Switches Preact hook import to @uppy/utils/preact/hooks.
packages/@uppy/dashboard/src/components/Informer/TransitionGroup.ts Switches Preact imports to @uppy/utils/preact.
packages/@uppy/dashboard/src/components/Informer/Informer.tsx Switches Preact imports to @uppy/utils/preact.
packages/@uppy/dashboard/src/components/Informer/FadeIn.tsx Switches Preact imports to @uppy/utils/preact.
packages/@uppy/dashboard/src/components/FileList.tsx Switches Preact hook import to @uppy/utils/preact/hooks.
packages/@uppy/dashboard/src/components/FileItem/index.tsx Switches Preact imports to @uppy/utils/preact.
packages/@uppy/dashboard/src/components/FileItem/FileProgress/index.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/dashboard/src/components/FileCard/index.tsx Switches Preact hooks imports to @uppy/utils/preact/hooks.
packages/@uppy/dashboard/src/components/FileCard/RenderMetaFields.tsx Switches h import to @uppy/utils/preact.
packages/@uppy/dashboard/src/components/Dashboard.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/dashboard/src/components/AddFiles.tsx Switches Preact imports to @uppy/utils/preact.
packages/@uppy/dashboard/src/Dashboard.tsx Switches Preact type imports to @uppy/utils/preact.
packages/@uppy/dashboard/package.json Drops direct preact dependency.
packages/@uppy/core/src/Uppy.ts Switches Preact type import to @uppy/utils/preact.
packages/@uppy/core/src/UIPlugin.ts Switches render import to @uppy/utils/preact.
packages/@uppy/core/package.json Drops direct preact dependency.
packages/@uppy/compressor/package.json Drops direct preact dependency.
packages/@uppy/components/src/Thumbnail.tsx Switches Preact hooks imports to @uppy/utils/preact/hooks.
packages/@uppy/components/src/FilesList.tsx Switches Preact + hooks imports to @uppy/utils/preact*.
packages/@uppy/components/src/FilesGrid.tsx Switches Preact + hooks imports to @uppy/utils/preact*.
packages/@uppy/components/src/Dropzone.tsx Switches Preact hook import to @uppy/utils/preact/hooks.
packages/@uppy/components/package.json Adds @uppy/utils dependency and drops direct preact dependency.
packages/@uppy/components/migrate.mjs Updates migration templates to import Preact via @uppy/utils/preact.
packages/@uppy/box/src/Box.tsx Switches Preact import to @uppy/utils/preact.
packages/@uppy/box/package.json Drops direct preact dependency.
packages/@uppy/audio/src/RecordingScreen.tsx Switches Preact hooks imports to @uppy/utils/preact/hooks.
packages/@uppy/audio/src/PermissionsScreen.tsx Switches Preact type import to @uppy/utils/preact.
packages/@uppy/audio/package.json Drops direct preact dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -51,7 +51,6 @@
"classnames": "^2.2.6",
"lodash": "^4.17.23",
"nanoid": "^5.0.9",
Comment on lines 31 to 35
"exports": {
".": "./lib/index.js",
"./preact": "./lib/preact/index.js",
"./preact/hooks": "./lib/preact/hooks.js",
"./package.json": "./package.json"
Comment on lines 31 to 35
"exports": {
".": "./lib/index.js",
"./preact": "./lib/preact/index.js",
"./preact/hooks": "./lib/preact/hooks.js",
"./package.json": "./package.json"
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.

Uncaught TypeError when running with preact 10.28.3

4 participants