Skip to content

refactor(core): remove duplicate types#6359

Merged
qxprakash merged 4 commits into
transloadit:merge-into-corefrom
qxprakash:core-merge-5-type-unification
Jun 30, 2026
Merged

refactor(core): remove duplicate types#6359
qxprakash merged 4 commits into
transloadit:merge-into-corefrom
qxprakash:core-merge-5-type-unification

Conversation

@qxprakash

Copy link
Copy Markdown
Collaborator

This PR removes the duplicate companion/provider bridge types (CompanionClientProvider CompanionClientSearchProvider, and theview: any escape hatch) and wires the real Provider/ProviderView types directly, now possible since everything lives in @uppy/core Net gain in type safety; no behavior change.

for more context on the approach see description of #6351

@qxprakash qxprakash requested a review from Copilot June 23, 2026 15:53
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 888a29f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@qxprakash qxprakash self-assigned this Jun 23, 2026
@qxprakash qxprakash added the 6.0 For the 6.0 major release label Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors the “Companion provider” type plumbing by removing the duplicated bridge types in @uppy/core/utils and wiring Uppy’s provider plugins and provider views directly to the real Provider / SearchProvider / ProviderView types now living in @uppy/core, aiming for improved type safety without behavior changes.

Changes:

  • Removes the duplicate CompanionClientProvider / CompanionClientSearchProvider / RequestOptions type definitions previously exported from @uppy/core/utils.
  • Moves RequestOptions to @uppy/core/companion-client (exported via RequestClient) and updates imports accordingly.
  • Updates provider-view call sites to use the generic Provider.list/search response typing and updates plugin/provider typings to use the real classes.

Reviewed changes

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

Show a summary per file
File Description
packages/@uppy/webdav/src/Webdav.tsx Makes uppyVersions optional/defaulted in the WebDAV provider login override to match the updated core Provider login signature.
packages/@uppy/core/src/utils/index.ts Stops exporting the duplicate companion/provider bridge types from the utils entrypoint.
packages/@uppy/core/src/utils/CompanionClientProvider.ts Removes the duplicated bridge type definitions file entirely.
packages/@uppy/core/src/Uppy.ts Switches UnknownProviderPlugin / UnknownSearchProviderPlugin typings to use real Provider/SearchProvider + ProviderView types.
packages/@uppy/core/src/provider-views/utils/companionFileToUppyFile.ts Updates provider parameter types to the real Provider / SearchProvider classes.
packages/@uppy/core/src/provider-views/utils/addFiles.ts Updates provider parameter types to the real Provider / SearchProvider classes.
packages/@uppy/core/src/provider-views/ProviderView/ProviderView.tsx Adds a typed response shape for list/search and applies it at call sites using generic Provider methods.
packages/@uppy/core/src/companion-client/SearchProvider.ts Removes dependency on the now-deleted bridge interface; keeps the concrete class.
packages/@uppy/core/src/companion-client/RequestClient.ts Defines and exports RequestOptions here (new authoritative location).
packages/@uppy/core/src/companion-client/Provider.ts Removes dependency on bridge types; makes uppyVersions optional/defaulted in login.
packages/@uppy/core/src/companion-client/index.ts Re-exports RequestOptions from RequestClient via the companion-client entrypoint.
packages/@uppy/aws-s3/src/index.ts Updates RequestOptions import to come from @uppy/core/companion-client.

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

Comment thread packages/@uppy/core/src/utils/index.ts
Comment thread packages/@uppy/core/src/Uppy.ts Outdated
Comment thread packages/@uppy/core/src/Uppy.ts Outdated
@qxprakash qxprakash marked this pull request as draft June 24, 2026 08:26
@qxprakash qxprakash marked this pull request as ready for review June 24, 2026 11:14
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@qxprakash qxprakash requested a review from mifi June 24, 2026 11:58
@qxprakash qxprakash merged commit 6c05477 into transloadit:merge-into-core Jun 30, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.0 For the 6.0 major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants