Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .changeset/bumpy-breads-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
"@uppy/google-photos-picker": minor
"@uppy/google-drive-picker": minor
"@uppy/image-generator": minor
"@uppy/provider-views": minor
"@uppy/screen-capture": minor
"@uppy/google-drive": minor
"@uppy/image-editor": minor
"@uppy/components": minor
"@uppy/compressor": minor
"@uppy/status-bar": minor
"@uppy/dashboard": minor
"@uppy/drag-drop": minor
"@uppy/instagram": minor
"@uppy/facebook": minor
"@uppy/onedrive": minor
"@uppy/unsplash": minor
"@uppy/dropbox": minor
"@uppy/svelte": minor
"@uppy/webcam": minor
"@uppy/webdav": minor
"@uppy/audio": minor
"@uppy/react": minor
"@uppy/utils": minor
"@uppy/core": minor
"@uppy/zoom": minor
"@uppy/box": minor
"@uppy/url": minor
"@uppy/vue": minor
---

Import Preact from @uppy/utils to guarantee a single version across packages
3 changes: 1 addition & 2 deletions packages/@uppy/audio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"./package.json": "./package.json"
},
"dependencies": {
"@uppy/utils": "workspace:^",
"preact": "^10.26.10"
"@uppy/utils": "workspace:^"
},
"devDependencies": {
"cssnano": "^7.0.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/audio/src/PermissionsScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { I18n } from '@uppy/utils'
import type { h } from 'preact'
import type { h } from '@uppy/utils/preact'

interface PermissionsScreenProps {
icon: () => h.JSX.Element | null
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/audio/src/RecordingScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { I18n } from '@uppy/utils'
import { useEffect, useRef } from 'preact/hooks'
import { useEffect, useRef } from '@uppy/utils/preact/hooks'
import AudioSourceSelect, {
type AudioSourceSelectProps,
} from './AudioSourceSelect.js'
Expand Down
3 changes: 1 addition & 2 deletions packages/@uppy/box/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
"dependencies": {
"@uppy/companion-client": "workspace:^",
"@uppy/provider-views": "workspace:^",
"@uppy/utils": "workspace:^",
"preact": "^10.26.10"
"@uppy/utils": "workspace:^"
},
"peerDependencies": {
"@uppy/core": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/box/src/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { ProviderViews } from '@uppy/provider-views'

import type { LocaleStrings } from '@uppy/utils'
// biome-ignore lint/style/useImportType: h is not a type
import { type ComponentChild, h } from 'preact'
import { type ComponentChild, h } from '@uppy/utils/preact'
import packageJson from '../package.json' with { type: 'json' }
import locale from './locale.js'

Expand Down
6 changes: 3 additions & 3 deletions packages/@uppy/components/migrate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import {
%%ComponentName%% as %%PreactComponentName%%,
type %%PropsTypeName%%,
} from '@uppy/components'
import { h as preactH, render as preactRender } from 'preact'
import { h as preactH, render as preactRender } from '@uppy/utils/preact'
import { useContext, useEffect, useRef } from 'react'
import { UppyContext } from '../UppyContextProvider.js'

Expand Down Expand Up @@ -96,7 +96,7 @@ import {
%%ComponentName%% as %%PreactComponentName%%,
type %%PropsTypeName%%,
} from '@uppy/components'
import { h as preactH, render as preactRender } from 'preact'
import { h as preactH, render as preactRender } from '@uppy/utils/preact'
import { useUppyContext } from '../useUppyContext.js'

export default defineComponent({
Expand Down Expand Up @@ -149,7 +149,7 @@ const SVELTE_TEMPLATE = `\
type %%PropsTypeName%%,
type UppyContext,
} from '@uppy/components'
import { h as preactH, render as preactRender } from 'preact'
import { h as preactH, render as preactRender } from '@uppy/utils/preact'
import { UppyContextKey } from '../UppyContextProvider.svelte'

const props: Omit<%%PropsTypeName%%, 'ctx'> = $props()
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"./package.json": "./package.json"
},
"dependencies": {
"@uppy/utils": "workspace:^",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep preact for emitted JSX runtime imports

In packages that still compile TSX, adding @uppy/utils does not replace the direct preact runtime dependency: tsconfig.shared.json uses jsx: react-jsx with jsxImportSource: preact, so built files from sources such as packages/@uppy/components/src/FilesGrid.tsx will still contain compiler-generated imports from preact/jsx-runtime. With preact removed from @uppy/components dependencies, consumers using pnpm/Yarn PnP or any install where only @uppy/utils owns preact can fail to resolve those imports at runtime; keep preact as a direct dependency or route the JSX runtime through an exported @uppy/utils subpath before dropping it.

Useful? React with 👍 / 👎.

"clsx": "^2.1.1",
"dequal": "^2.0.3",
"preact": "^10.26.10",
"pretty-bytes": "^6.1.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/components/src/Dropzone.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from '@uppy/utils/preact/hooks'
import { clsx } from 'clsx'
import { useMemo } from 'preact/hooks'
import { createDropzone } from './hooks/dropzone.js'
import type { NonNullableUppyContext, UppyContext } from './types.js'

Expand Down
4 changes: 2 additions & 2 deletions packages/@uppy/components/src/FilesGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Body, Meta, UppyEventMap, UppyFile } from '@uppy/core'
import { Fragment } from '@uppy/utils/preact'
import { useEffect, useState } from '@uppy/utils/preact/hooks'
import { clsx } from 'clsx'
import { Fragment } from 'preact'
import { useEffect, useState } from 'preact/hooks'
import prettyBytes from 'pretty-bytes'
import { Thumbnail } from './index.js'
import type { UppyContext } from './types.js'
Expand Down
4 changes: 2 additions & 2 deletions packages/@uppy/components/src/FilesList.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Body, Meta, UppyEventMap, UppyFile } from '@uppy/core'
import { Fragment } from '@uppy/utils/preact'
import { useEffect, useState } from '@uppy/utils/preact/hooks'
import { clsx } from 'clsx'
import { Fragment } from 'preact'
import { useEffect, useState } from 'preact/hooks'
import prettyBytes from 'pretty-bytes'
import { Thumbnail, type UppyContext } from './index.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/components/src/Thumbnail.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Body, Meta, UppyFile } from '@uppy/core'
import { useEffect, useMemo } from 'preact/hooks'
import { useEffect, useMemo } from '@uppy/utils/preact/hooks'
import type { UppyContext } from './types.js'

export type ThumbnailProps = {
Expand Down
1 change: 0 additions & 1 deletion packages/@uppy/compressor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@transloadit/prettier-bytes": "^0.3.4",
"@uppy/utils": "workspace:^",
"compressorjs": "^1.2.1",
"preact": "^10.26.10",
"promise-queue": "^2.2.5"
},
"peerDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/@uppy/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
"lodash": "^4.17.23",
"mime-match": "^1.0.2",
"namespace-emitter": "^2.0.1",
"nanoid": "^5.0.9",
"preact": "^10.26.10"
"nanoid": "^5.0.9"
},
"devDependencies": {
"@types/deep-freeze": "^0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/core/src/UIPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Body, Meta } from '@uppy/utils'
import { findDOMElement, getTextDirection } from '@uppy/utils'
import { render } from 'preact'
import { render } from '@uppy/utils/preact'
import type { PluginOpts } from './BasePlugin.js'
import BasePlugin from './BasePlugin.js'
import type { State } from './Uppy.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/core/src/Uppy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import {
getSafeFileId,
Translator,
} from '@uppy/utils'
import type { h } from '@uppy/utils/preact'
import throttle from 'lodash/throttle.js'
// @ts-ignore untyped
import ee from 'namespace-emitter'
import { nanoid } from 'nanoid/non-secure'
import type { h } from 'preact'
import packageJson from '../package.json' with { type: 'json' }
import type BasePlugin from './BasePlugin.js'
import getFileName from './getFileName.js'
Expand Down
1 change: 0 additions & 1 deletion packages/@uppy/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"classnames": "^2.2.6",
"lodash": "^4.17.23",
"nanoid": "^5.0.9",
"preact": "^10.26.10",
"shallow-equal": "^3.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/dashboard/src/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { defaultPickerIcon } from '@uppy/provider-views'
import ThumbnailGenerator from '@uppy/thumbnail-generator'
import type { LocaleStrings } from '@uppy/utils'
import { findAllDOMElements, getDroppedFiles, toArray } from '@uppy/utils'
import type { ComponentChild, h, VNode } from '@uppy/utils/preact'
import { nanoid } from 'nanoid/non-secure'
import type { ComponentChild, h, VNode } from 'preact'
import packageJson from '../package.json' with { type: 'json' }
import DashboardUI from './components/Dashboard.js'
import locale from './locale.js'
Expand Down
7 changes: 6 additions & 1 deletion packages/@uppy/dashboard/src/components/AddFiles.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import type { I18n, Translator } from '@uppy/utils'
import { Component, type ComponentChild, Fragment, type h } from 'preact'
import {
Component,
type ComponentChild,
Fragment,
type h,
} from '@uppy/utils/preact'
import type { DashboardState, TargetWithRender } from '../Dashboard.js'

interface AddFilesProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/dashboard/src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import type {
} from '@uppy/core'
import type { I18n, Translator } from '@uppy/utils'
import { isDragDropSupported } from '@uppy/utils'
import type { h } from '@uppy/utils/preact'
import classNames from 'classnames'
import type { h } from 'preact'
import type { DashboardState, TargetWithRender } from '../Dashboard.js'
import AddFiles from './AddFiles.js'
import AddFilesPanel from './AddFilesPanel.js'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { h } from 'preact'
import { h } from '@uppy/utils/preact'

type $TSFixMe = any

Expand Down
7 changes: 6 additions & 1 deletion packages/@uppy/dashboard/src/components/FileCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import {
useCallback,
useEffect,
useRef,
useState,
} from '@uppy/utils/preact/hooks'
import classNames from 'classnames'
import { nanoid } from 'nanoid/non-secure'
import { useCallback, useEffect, useRef, useState } from 'preact/hooks'
import getFileTypeIcon from '../../utils/getFileTypeIcon.js'
import ignoreEvent from '../../utils/ignoreEvent.js'
import FilePreview from '../FilePreview.js'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils'
import type { ComponentChild } from 'preact'
import type { ComponentChild } from '@uppy/utils/preact'

interface Props<M extends Meta, B extends Body> {
uppy: Uppy<M, B>
Expand Down
4 changes: 2 additions & 2 deletions packages/@uppy/dashboard/src/components/FileItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type Uppy from '@uppy/core'
import type { Body, Meta, State, UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils'
import classNames from 'classnames'
// biome-ignore lint/style/useImportType: h is not a type
import { Component, type ComponentChild, h } from 'preact'
import { Component, type ComponentChild, h } from '@uppy/utils/preact'
import classNames from 'classnames'
import { shallowEqualObjects } from 'shallow-equal'
import type { DashboardState } from '../../Dashboard.js'
import Buttons from './Buttons/index.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/dashboard/src/components/FileList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils'
// @ts-ignore untyped
import { VirtualList } from '@uppy/utils'
import { useMemo } from 'preact/hooks'
import { useMemo } from '@uppy/utils/preact/hooks'
import type { DashboardState } from '../Dashboard.js'
import FileItem from './FileItem/index.js'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, type ComponentChild, createRef } from 'preact'
import { Component, type ComponentChild, createRef } from '@uppy/utils/preact'

const TRANSITION_MS = 300

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UIPluginOptions, Uppy } from '@uppy/core'
import { Component, type ComponentChild } from 'preact'
import { Component, type ComponentChild } from '@uppy/utils/preact'
import FadeIn from './FadeIn.js'
import TransitionGroup from './TransitionGroup.js'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @source https://github.com/developit/preact-transition-group
*/

import { Component, cloneElement, h, toChildArray } from 'preact'
import { Component, cloneElement, h, toChildArray } from '@uppy/utils/preact'

function assign(obj, props) {
return Object.assign(obj, props)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useRef } from '@uppy/utils/preact/hooks'
import classNames from 'classnames'
import { useRef } from 'preact/hooks'
import ignoreEvent from '../utils/ignoreEvent.js'

type $TSFixMe = any
Expand Down
11 changes: 8 additions & 3 deletions packages/@uppy/dashboard/src/components/Slide.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import classNames from 'classnames'
import {
type ComponentChildren,
cloneElement,
toChildArray,
type VNode,
} from 'preact'
import { useCallback, useEffect, useRef, useState } from 'preact/hooks'
} from '@uppy/utils/preact'
import {
useCallback,
useEffect,
useRef,
useState,
} from '@uppy/utils/preact/hooks'
import classNames from 'classnames'

const transitionName = 'uppy-transition-slideDownUp'
const duration = 250
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils'
import { emaFilter } from '@uppy/utils'
import type { ComponentChild } from 'preact'
import { Component } from 'preact'
import type { ComponentChild } from '@uppy/utils/preact'
import { Component } from '@uppy/utils/preact'
import statusBarStates from './StatusBarStates.js'
import StatusBarUI, { type StatusBarUIProps } from './StatusBarUI.js'

Expand Down
3 changes: 1 addition & 2 deletions packages/@uppy/drag-drop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
"./package.json": "./package.json"
},
"dependencies": {
"@uppy/utils": "workspace:^",
"preact": "^10.26.10"
"@uppy/utils": "workspace:^"
},
"peerDependencies": {
"@uppy/core": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/drag-drop/src/DragDrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
import { UIPlugin } from '@uppy/core'
import type { LocaleStrings } from '@uppy/utils'
import { getDroppedFiles, isDragDropSupported, toArray } from '@uppy/utils'
import type { ComponentChild, h } from 'preact'
import type { ComponentChild, h } from '@uppy/utils/preact'
import packageJson from '../package.json' with { type: 'json' }
import locale from './locale.js'

Expand Down
3 changes: 1 addition & 2 deletions packages/@uppy/dropbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
"dependencies": {
"@uppy/companion-client": "workspace:^",
"@uppy/provider-views": "workspace:^",
"@uppy/utils": "workspace:^",
"preact": "^10.26.10"
"@uppy/utils": "workspace:^"
},
"peerDependencies": {
"@uppy/core": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/dropbox/src/Dropbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { ProviderViews } from '@uppy/provider-views'

import type { LocaleStrings } from '@uppy/utils'
// biome-ignore lint/style/useImportType: h is not a type
import { type ComponentChild, h } from 'preact'
import { type ComponentChild, h } from '@uppy/utils/preact'
import packageJson from '../package.json' with { type: 'json' }
import locale from './locale.js'

Expand Down
3 changes: 1 addition & 2 deletions packages/@uppy/facebook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
"dependencies": {
"@uppy/companion-client": "workspace:^",
"@uppy/provider-views": "workspace:^",
"@uppy/utils": "workspace:^",
"preact": "^10.26.10"
"@uppy/utils": "workspace:^"
},
"peerDependencies": {
"@uppy/core": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/facebook/src/Facebook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { ProviderViews } from '@uppy/provider-views'

import type { LocaleStrings } from '@uppy/utils'
// biome-ignore lint/style/useImportType: h is not a type
import { type ComponentChild, h } from 'preact'
import { type ComponentChild, h } from '@uppy/utils/preact'
import packageJson from '../package.json' with { type: 'json' }
import locale from './locale.js'

Expand Down
Loading
Loading