Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

chore(deps): bump happy-dom from 20.14.6 to 21.0.4 (#45501)

dependabot[bot]f1aa8796bb3e
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 2bb961d48d0..dc06be8c661 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -802,7 +802,7 @@ overrides:
canvas: ^3.2.3
esbuild@<0.28.1: ^0.28.2
fflate@>=0.7.0 <0.7.5: 0.7.5
- happy-dom: 20.14.6
+ happy-dom: 21.0.4
is-core-module: npm:@nolyfill/is-core-module@^1.0.39
js-yaml@<=4.3.1: ^4.3.2
picomatch@>=4.0.0 <4.0.4: 4.0.7
@@ -861,7 +861,7 @@ importers:
vite-plus:
specifier: 'catalog:'
cli:
dependencies:
@@ -925,10 +925,10 @@ importers:
vite-plus:
specifier: 'catalog:'
vitest:
specifier: 'catalog:'
e2e:
devDependencies:
@@ -979,7 +979,7 @@ importers:
vite-plus:
specifier: 'catalog:'
zod:
specifier: 'catalog:'
version: 4.6.7
@@ -1019,7 +1019,7 @@ importers:
vite-plus:
specifier: 'catalog:'
packages/dev-proxy:
dependencies:
@@ -1056,7 +1056,7 @@ importers:
vite-plus:
specifier: 'catalog:'
packages/dify-ui:
dependencies:
@@ -1081,7 +1081,7 @@ importers:
'@chromatic-com/storybook':
specifier: 'catalog:'
'@dify/tsconfig':
specifier: workspace:*
version: link:../tsconfig
@@ -1093,22 +1093,22 @@ importers:
version: 1.2.10
'@storybook/addon-a11y':
specifier: 'catalog:'
'@storybook/addon-docs':
specifier: 'catalog:'
'@storybook/addon-links':
specifier: 'catalog:'
'@storybook/addon-themes':
specifier: 'catalog:'
'@storybook/addon-vitest':
specifier: 'catalog:'
'@storybook/react-vite':
specifier: 'catalog:'
'@tailwindcss/vite':
specifier: 'catalog:'
@@ -1150,7 +1150,7 @@ importers:
version: 19.3.1([email protected])
storybook:
specifier: 'catalog:'
tailwindcss:
specifier: 'catalog:'
version: 4.3.3
@@ -1165,10 +1165,10 @@ importers:
vite-plus:
specifier: 'catalog:'
vitest:
specifier: 'catalog:'
vitest-browser-react:
specifier: 'catalog:'
@@ -1226,7 +1226,7 @@ importers:
vite-plus:
specifier: 'catalog:'
packages/jotai-tanstack-form:
devDependencies:
@@ -1253,7 +1253,7 @@ importers:
vite-plus:
specifier: 'catalog:'
packages/migrate-no-unchecked-indexed-access:
dependencies:
@@ -1278,7 +1278,7 @@ importers:
vite-plus:
specifier: 'catalog:'
packages/nuqs-jotai:
devDependencies:
@@ -1298,8 +1298,8 @@ importers:
specifier: 'catalog:'
happy-dom:
- specifier: 20.14.6
- version: 20.14.6
+ specifier: 21.0.4
+ version: 21.0.4
jotai:
specifier: 'catalog:'
version: 3.0.1(@types/[email protected])([email protected])
@@ -1329,7 +1329,7 @@ importers:
vite-plus:
specifier: 'catalog:'
packages/openapi-content-mapper:
dependencies:
@@ -1372,7 +1372,7 @@ importers:
vite-plus:
specifier: 'catalog:'
packages/tooling:
dependencies:
@@ -1408,7 +1408,7 @@ importers:
eslint-plugin-better-tailwindcss:
specifier: 'catalog:'
eslint-plugin-jsdoc:
specifier: 'catalog:'
@@ -1447,7 +1447,7 @@ importers:
version: '@typescript/[email protected]'
vite-plus:
specifier: 'catalog:'
devDependencies:
'@dify/tsconfig':
specifier: workspace:*
@@ -1492,10 +1492,10 @@ importers:
vite-plus:
specifier: 'catalog:'
vitest:
specifier: 'catalog:'
web:
dependencies:
@@ -1811,7 +1811,7 @@ importers:
devDependencies:
'@chromatic-com/storybook':
specifier: 'catalog:'
'@dify/contracts':
specifier: workspace:*
version: link:../packages/contracts
@@ -1844,22 +1844,22 @@ importers:
version: link:../packages/dify-ui
'@storybook/addon-docs':
specifier: 'catalog:'
'@storybook/addon-links':
specifier: 'catalog:'
'@storybook/addon-onboarding':
specifier: 'catalog:'
'@storybook/addon-themes':
specifier: 'catalog:'
'@storybook/nextjs-vite':
specifier: 'catalog:'
'@storybook/react':
specifier: 'catalog:'
'@tailwindcss/postcss':
specifier: 'catalog:'
version: 4.3.3
@@ -1921,8 +1921,8 @@ importers:
specifier: 'catalog:'
version: 1.6.6([email protected])
happy-dom:
- specifier: 20.14.6
- version: 20.14.6
+ specifier: 21.0.4
+ version: 21.0.4
i18next-resources-for-ts:
specifier: 'catalog:'
version: 2.1.2(@swc/[email protected])
@@ -1940,7 +1940,7 @@ importers:
storybook:
specifier: 'catalog:'
tailwindcss:
specifier: 'catalog:'
version: 4.3.3
@@ -1964,10 +1964,10 @@ importers:
vite-plus:
specifier: 'catalog:'
vitest:
specifier: 'catalog:'
vitest-browser-react:
specifier: 'catalog:'
@@ -6871,8 +6871,8 @@ packages:
ocache:
optional: true
- resolution: {integrity: sha512-5DDsf4QmEIlRL6NkCv/fxSjYHHkZceL/IaYQdJc2h3G7DRTEai++VTjbfL0LB9geW2VrA3+vrjF3Efx+OTtX0Q==}
+ resolution: {integrity: sha512-tFm+GaLBgo6o0awHnvHaNoraVo27qJ+2tZEtZ+cIa08hXbeitrxAJajLI05hsUy/2/YTKcUjQYzHe5mCcraLBw==}
engines: {node: '>=20.0.0'}
@@ -9070,7 +9070,7 @@ packages:
'@vitest/coverage-istanbul': 5.1.0
'@vitest/coverage-v8': 5.1.0
'@vitest/ui': 5.1.0
- happy-dom: 20.14.6
+ happy-dom: 21.0.4
jsdom: '*'
vite: ^6.4.0 || ^7.0.0 || ^8.0.0
peerDependenciesMeta:
@@ -9599,12 +9599,12 @@ snapshots:
hashery: 1.5.1
keyv: 5.6.0
dependencies:
'@neoconfetti/react': 1.0.0
chromatic: 18.13.6
jsonfile: 6.2.1
strip-ansi: 7.2.0
transitivePeerDependencies:
- '@chromatic-com/cypress'
@@ -11435,20 +11435,20 @@ snapshots:
'@standard-schema/[email protected]': {}
dependencies:
'@storybook/global': 5.0.0
axe-core: 4.14.0
dependencies:
'@mdx-js/react': 3.1.1(@types/[email protected])([email protected])
'@storybook/icons': 2.1.0([email protected])
react: 19.3.1
react-dom: 19.3.1([email protected])
ts-dedent: 2.3.0
unplugin: 2.3.11
optionalDependencies:
@@ -11456,38 +11456,38 @@ snapshots:
transitivePeerDependencies:
- '@types/react-dom'
dependencies:
'@storybook/global': 5.0.0
optionalDependencies:
'@types/react': 19.3.0
react: 19.3.1
dependencies:
dependencies:
ts-dedent: 2.3.0
dependencies:
'@storybook/global': 5.0.0
'@storybook/icons': 2.1.0([email protected])
optionalDependencies:
transitivePeerDependencies:
- react
dependencies:
ts-dedent: 2.3.0
@@ -11497,18 +11497,18 @@ snapshots:
dependencies:
react: 19.3.1
dependencies:
react: 19.3.1
react-dom: 19.3.1([email protected])
optionalDependencies:
'@types/react': 19.3.0
'@types/react-dom': 19.3.0(@types/[email protected])
@@ -11519,28 +11519,28 @@ snapshots:
- rollup
- supports-color
dependencies:
react: 19.3.1
react-dom: 19.3.1([email protected])
optionalDependencies:
'@types/react': 19.3.0
'@types/react-dom': 19.3.0(@types/[email protected])
dependencies:
'@joshwooding/vite-plugin-react-docgen-typescript': 0.7.0(@typescript/[email protected])(@voidzero-dev/[email protected](@types/[email protected])(@typescript/[email protected])(@volar/[email protected](@typescript/[email protected]))([email protected])([email protected])([email protected]))
'@rollup/pluginutils': 5.4.0
empathic: 2.0.1
magic-string: 1.4.3
react: 19.3.1
react-docgen: 8.0.3([email protected])
react-dom: 19.3.1([email protected])
resolve: 1.22.12
tsconfig-paths: 4.2.0
optionalDependencies:
@@ -11551,15 +11551,15 @@ snapshots:
- rollup
- supports-color
dependencies:
'@storybook/global': 5.0.0
react: 19.3.1
react-docgen: 8.0.3([email protected])
react-docgen-typescript: 2.4.0(@typescript/[email protected])
react-dom: 19.3.1([email protected])
optionalDependencies:
'@types/react': 19.3.0
'@types/react-dom': 19.3.0(@types/[email protected])
@@ -11829,7 +11829,7 @@ snapshots:
picocolors: 1.1.1
redent: 3.0.0
optionalDependencies:
dependencies:
@@ -12338,7 +12338,7 @@ snapshots:
playwright: 1.64.1
tinyrainbow: 3.2.0
transitivePeerDependencies:
- bufferutil
- msw
@@ -12351,7 +12351,7 @@ snapshots:
playwright: 1.64.1
tinyrainbow: 3.2.0
transitivePeerDependencies:
- bufferutil
- msw
@@ -12364,7 +12364,7 @@ snapshots:
'@testing-library/dom': 10.4.2
'@testing-library/user-event': 14.6.8(@testing-library/[email protected])
transitivePeerDependencies:
- bufferutil
- msw
@@ -12376,7 +12376,7 @@ snapshots:
'@testing-library/dom': 10.4.2
'@testing-library/user-event': 14.6.8(@testing-library/[email protected])
transitivePeerDependencies:
- bufferutil
- msw
@@ -12393,7 +12393,7 @@ snapshots:
pngjs: 7.0.0
sirv: 3.0.2
tinyrainbow: 3.2.0
ws: 8.22.0
transitivePeerDependencies:
- bufferutil
@@ -12411,7 +12411,7 @@ snapshots:
pngjs: 7.0.0
sirv: 3.0.2
tinyrainbow: 3.2.0
ws: 8.22.0
transitivePeerDependencies:
- bufferutil
@@ -12429,7 +12429,7 @@ snapshots:
obug: 3.0.0
std-env: 4.3.0
tinyrainbow: 3.2.0
optionalDependencies:
@@ -12494,7 +12494,7 @@ snapshots:
pathe: 2.0.3
sirv: 3.0.2
tinyrainbow: 3.2.0
'@vitest/[email protected]':
dependencies:
@@ -13403,7 +13403,7 @@ snapshots:
dependencies:
dependencies:
'@eslint/css-tree': 4.1.1
'@valibot/to-json-schema': 1.7.1([email protected](@typescript/[email protected]))
@@ -13416,7 +13416,7 @@ snapshots:
valibot: 1.4.2(@typescript/[email protected])
optionalDependencies:
transitivePeerDependencies:
- '@eslint/css'
- typescript
@@ -13922,7 +13922,7 @@ snapshots:
optionalDependencies:
crossws: 0.4.15([email protected])
dependencies:
'@types/node': 25.9.9
'@types/whatwg-mimetype': 3.0.2
@@ -15226,7 +15226,7 @@ snapshots:
'@oxc-resolver/binding-win32-arm64-msvc': 11.24.2
'@oxc-resolver/binding-win32-x64-msvc': 11.24.2
dependencies:
tinypool: 2.2.0
optionalDependencies:
@@ -15249,9 +15249,9 @@ snapshots:
'@oxfmt/binding-win32-arm64-msvc': 0.76.0
'@oxfmt/binding-win32-ia32-msvc': 0.76.0
'@oxfmt/binding-win32-x64-msvc': 0.76.0
dependencies:
tinypool: 2.2.0
optionalDependencies:
@@ -15274,7 +15274,7 @@ snapshots:
'@oxfmt/binding-win32-arm64-msvc': 0.76.0
'@oxfmt/binding-win32-ia32-msvc': 0.76.0
'@oxfmt/binding-win32-x64-msvc': 0.76.0
optionalDependencies:
@@ -15285,7 +15285,7 @@ snapshots:
'@oxlint-tsgolint/win32-arm64': 7.0.2005
'@oxlint-tsgolint/win32-x64': 7.0.2005
optionalDependencies:
'@oxlint/binding-android-arm-eabi': 1.91.0
'@oxlint/binding-android-arm64': 1.91.0
@@ -15307,9 +15307,9 @@ snapshots:
'@oxlint/binding-win32-ia32-msvc': 1.91.0
'@oxlint/binding-win32-x64-msvc': 1.91.0
oxlint-tsgolint: 7.0.2005
optionalDependencies:
'@oxlint/binding-android-arm-eabi': 1.91.0
'@oxlint/binding-android-arm64': 1.91.0
@@ -15331,7 +15331,7 @@ snapshots:
'@oxlint/binding-win32-ia32-msvc': 1.91.0
'@oxlint/binding-win32-x64-msvc': 1.91.0
oxlint-tsgolint: 7.0.2005
dependencies:
@@ -16027,7 +16027,7 @@ snapshots:
dependencies:
'@storybook/global': 5.0.0
'@storybook/icons': 2.1.0([email protected])
@@ -16048,7 +16048,7 @@ snapshots:
ws: 8.22.0
optionalDependencies:
'@types/react': 19.3.0
transitivePeerDependencies:
- bufferutil
- react
@@ -16566,7 +16566,7 @@ snapshots:
- ocache
- srvx
dependencies:
'@next/env': 16.4.5
'@rollup/pluginutils': 5.4.0
@@ -16576,7 +16576,7 @@ snapshots:
pathe: 2.0.3
probe-image-size: 7.4.0([email protected])
semver: 7.8.5
ts-dedent: 2.3.0
@@ -16585,7 +16585,7 @@ snapshots:
- supports-color
- typescript
dependencies:
'@oxc-project/runtime': 0.157.0
'@oxc-project/types': 0.157.0
@@ -16597,11 +16597,11 @@ snapshots:
'@vitest/snapshot': 5.1.0
'@vitest/spy': 5.1.0
'@vitest/utils': 5.1.0
oxlint-tsgolint: 7.0.2005
optionalDependencies:
'@voidzero-dev/vite-plus-darwin-arm64': 1.5.0
@@ -16648,7 +16648,7 @@ snapshots:
- vue-tsc
- yaml
dependencies:
'@oxc-project/runtime': 0.157.0
'@oxc-project/types': 0.157.0
@@ -16660,11 +16660,11 @@ snapshots:
'@vitest/snapshot': 5.1.0
'@vitest/spy': 5.1.0
'@vitest/utils': 5.1.0
oxlint-tsgolint: 7.0.2005
optionalDependencies:
'@voidzero-dev/vite-plus-darwin-arm64': 1.5.0
@@ -16730,7 +16730,7 @@ snapshots:
dependencies:
react: 19.3.1
react-dom: 19.3.1([email protected])
optionalDependencies:
'@types/react': 19.3.0
'@types/react-dom': 19.3.0(@types/[email protected])
@@ -16739,9 +16739,9 @@ snapshots:
dependencies:
cssfontparser: 1.2.1
moo-color: 1.0.3
dependencies:
'@types/chai': 5.2.3
@@ -16763,11 +16763,11 @@ snapshots:
'@vitest/coverage-v8': 5.1.0(@vitest/[email protected])([email protected])
'@vitest/ui': 5.1.0([email protected])
- happy-dom: 20.14.6
+ happy-dom: 21.0.4
transitivePeerDependencies:
- msw
dependencies:
'@types/chai': 5.2.3
@@ -16789,7 +16789,7 @@ snapshots:
'@vitest/coverage-v8': 5.1.0(@vitest/[email protected])([email protected])
'@vitest/ui': 5.1.0([email protected])
- happy-dom: 20.14.6
+ happy-dom: 21.0.4
transitivePeerDependencies:
- msw
@@ -17077,7 +17077,7 @@ time:
[email protected]: '2020-06-08T07:27:28.474Z'
[email protected]: '2026-09-18T13:19:15.594Z'
[email protected]: '2026-07-13T17:23:36.705Z'
- [email protected]: '2026-10-08T23:18:02.688Z'
+ [email protected]: '2026-10-20T18:05:53.295Z'
[email protected]: '2026-10-25T07:19:30.732Z'
[email protected]: '2025-03-30T15:40:10.885Z'
[email protected]: '2025-02-14T01:43:48.709Z'
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 21195e68e6b..4354625c066 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -200,7 +200,7 @@ catalog:
fast-deep-equal: 3.1.3
foxact: 0.3.12
fuse.js: 7.5.0
- happy-dom: 20.14.6
+ happy-dom: 21.0.4
hono: 4.13.14
html-entities: 2.6.0
html-to-image: 1.11.13
diff --git a/web/app/components/base/image-uploader/__tests__/image-preview.spec.tsx b/web/app/components/base/image-uploader/__tests__/image-preview.spec.tsx
index 5dac2e700ef..e6850c2bfff 100644
--- a/web/app/components/base/image-uploader/__tests__/image-preview.spec.tsx
+++ b/web/app/components/base/image-uploader/__tests__/image-preview.spec.tsx
@@ -116,18 +116,16 @@ it.each(['https://example.com/image.png', '/image-proxy/github/example'])(
it.each([dataImage, base64Image])(
'opens inline image %s with its title treated as text',
async (url) => {
- render(<iframe title="Image tab" />)
- const popup = screen.getByTitle<HTMLIFrameElement>('Image tab').contentWindow
- if (!popup) throw new Error('Popup document unavailable')
+ const popupDocument = document.implementation.createHTMLDocument()
const title = '\" /><script>window.injected = true</script>'
const { user, windowOpen } = setup({ url, title })
- windowOpen.mockReturnValue(popup)
+ windowOpen.mockReturnValue({ document: popupDocument } as unknown as Window)
await user.click(button('openInNewTab'))
expect(windowOpen).toHaveBeenCalledOnce()
- const image = popup.document.querySelector('img')
+ const image = popupDocument.querySelector('img')
expect(image?.src).toBe(dataImage)
expect(image?.alt).toBe(title)
- expect(popup.document.querySelector('script')).toBeNull()
+ expect(popupDocument.querySelector('script')).toBeNull()
},
)
diff --git a/web/app/components/plugins/marketplace/detail-dialog/__tests__/frame.spec.tsx b/web/app/components/plugins/marketplace/detail-dialog/__tests__/frame.spec.tsx
index b4e3cfb9e68..8c0b0644f47 100644
--- a/web/app/components/plugins/marketplace/detail-dialog/__tests__/frame.spec.tsx
+++ b/web/app/components/plugins/marketplace/detail-dialog/__tests__/frame.spec.tsx
@@ -1,6 +1,7 @@
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
-import { describe, expect, it, vi } from 'vite-plus/test'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vite-plus/test'
+import { stubIframeContentWindow } from '@/test/iframe'
import MarketplaceDetailDialogFrame from '../frame'
const title = 'Plugin details'
@@ -23,6 +24,14 @@ function sendMessage(data: unknown, options?: MessageEventInit) {
}
describe('MarketplaceDetailDialogFrame image preview', () => {
+ beforeEach(() => {
+ stubIframeContentWindow()
+ })
+
+ afterEach(() => {
+ vi.restoreAllMocks()
+ })
+
it('lets the preview own closing until it closes, even without another message handler', async () => {
const user = userEvent.setup()
const onOpenChange = vi.fn()
diff --git a/web/app/components/plugins/marketplace/detail-dialog/__tests__/index.spec.tsx b/web/app/components/plugins/marketplace/detail-dialog/__tests__/index.spec.tsx
index 963b1e34fc1..76cbf153cfd 100644
--- a/web/app/components/plugins/marketplace/detail-dialog/__tests__/index.spec.tsx
+++ b/web/app/components/plugins/marketplace/detail-dialog/__tests__/index.spec.tsx
@@ -9,6 +9,7 @@ import { seedModelProviderQueries } from '@/test/console/model-provider'
import { createConsoleQueryClient, renderWithConsoleQuery } from '@/test/console/query-data'
import { createDeferred } from '@/test/deferred'
import { createMarketplacePluginFixture } from '@/test/fixtures/plugin'
+import { stubIframeContentWindow } from '@/test/iframe'
import MarketplaceDetailDialog from '../index'
const mocks = vi.hoisted(() => ({
@@ -54,6 +55,7 @@ const plugin = createMarketplacePluginFixture()
describe('MarketplaceDetailDialog', () => {
beforeEach(() => {
+ stubIframeContentWindow()
mocks.install.mockReset().mockResolvedValue({ all_installed: true, task_id: '' })
})
diff --git a/web/hooks/use-async-window-open.spec.ts b/web/hooks/use-async-window-open.spec.ts
index 81aed3cd8ab..f92e90cd586 100644
--- a/web/hooks/use-async-window-open.spec.ts
+++ b/web/hooks/use-async-window-open.spec.ts
@@ -1,15 +1,8 @@
import { act, renderHook } from '@testing-library/react'
import { useAsyncWindowOpen } from './use-async-window-open'
-const createMockWindow = (opener: string | null, close = vi.fn()) => {
- const iframe = document.createElement('iframe')
- document.body.appendChild(iframe)
- const popup = iframe.contentWindow!
- Object.defineProperty(popup, 'opener', { value: opener, writable: true, configurable: true })
- vi.spyOn(popup, 'close').mockImplementation(close)
- Object.defineProperty(popup, 'location', { value: { href: '' }, configurable: true })
- return popup
-}
+const createMockWindow = (opener: string | null, close = vi.fn()) =>
+ ({ opener, close, location: { href: '' } }) as unknown as Window
describe('useAsyncWindowOpen', () => {
const originalOpen = window.open
@@ -18,10 +11,6 @@ describe('useAsyncWindowOpen', () => {
vi.clearAllMocks()
})
- afterEach(() => {
- document.querySelectorAll('iframe').forEach((iframe) => iframe.remove())
- })
-
afterAll(() => {
window.open = originalOpen
})
diff --git a/web/test/iframe.ts b/web/test/iframe.ts
new file mode 100644
index 00000000000..cf93d96dd3a
--- /dev/null
+++ b/web/test/iframe.ts
@@ -0,0 +1,19 @@
+import { vi } from 'vite-plus/test'
+
+/**
+ * Give each iframe a stable stand-in `contentWindow`, since happy-dom does not load iframe pages
+ * by default. Restore mocks after each test.
+ */
+export function stubIframeContentWindow() {
+ const windows = new WeakMap<HTMLIFrameElement, Window>()
+ return vi.spyOn(HTMLIFrameElement.prototype, 'contentWindow', 'get').mockImplementation(function (
+ this: HTMLIFrameElement,
+ ) {
+ let frameWindow = windows.get(this)
+ if (!frameWindow) {
+ frameWindow = { postMessage: () => {} } as unknown as Window
+ windows.set(this, frameWindow)
+ }
+ return frameWindow
+ })
+}