7ac583a38a
* changes * fix tests * format * clean * add changeset * fix * add changeset * fix more * add changeset * fix more more * add changeset * ci: bound js-test step + add browser-mode debug logs The js-test step has been hanging 6h+ in CI on this branch. Investigation confirms the runner is *stuck*, not slowly executing tests: vitest's default per-test timeout (5s) and per-hook timeout (10s) only apply inside test execution, but the orchestrator's prepareIframe awaits iframe.onload/onerror with no timeout — so a stuck Vite transform or unresponsive chromium iframe blocks forever. Cap the step at 10 min (locally completes in ~25s) so failures surface fast instead of consuming a runner for 6 hours, and enable DEBUG=vitest:browser:* + --reporter=verbose so the next failed run shows where the orchestrator was waiting. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * gitignore * fix(ci): prevent vite optimizer reload from hanging js-test Root cause of the 6h js-test hang: vitest browser mode can't tolerate a full-page reload mid-suite. Vite's dep optimizer fires "optimized dependencies changed. reloading" when it discovers a dep that wasn't in its initial bundle — this disrupts the iframe orchestrator, whose iframe.onload listener has no timeout (orchestrator-DM4mHHP0.js:164), so iframes silently lose their socket and the orchestrator awaits forever. Two complementary fixes: 1. Pre-declare runtime dynamic-import deps (katex, mermaid, vega-embed, babylonjs viewer, extendable-media-recorder) in `optimizeDeps.include`. Vite's static scanner doesn't follow `await import(...)` calls, so without the include list these were discovered mid-test and forced the reload. With them included, all known deps end up in the same first optimize batch. 2. Cache `node_modules/.vite` between CI runs and pre-warm the optimizer with `vitest list` before the real test step. The cold-start reload (which fires once even with `include`, when the cache is empty) then happens during the throwaway prewarm — the real test step always sees a warm cache and never reloads. Local verification: cleared cache + run = 3-5 file failures from the reload. With these changes: 1685/1685 pass, no reload. The `timeout-minutes: 10` on the test step ensures any future regression fails visibly in 10min instead of consuming a runner for 6 hours. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(e2e): wait on stronger chain-drain signals in flaky specs Two functional specs flaked in CI on this branch — at the failure moment, the Gradio queue still had inflight events. Both already use deterministic final-state assertions, the failure was just that 10s isn't enough on a CI runner where 60+ chained events serialize through one queue. rapid_generation: switch the chatbot wait from message 11 (halfway) to message 22 (last in the 22-event chain). Once that message renders the chatbot chain is fully drained, leaving only a handful of pending number-chain events. Bump the chatbot wait to 30s so the slow run gets the headroom. theme_builder: bump the font-family and background-color assertions to 30s. Loading a theme round-trips through the queue + ships CSS vars + waits for the browser to apply them — that pipeline can exceed the 10s default on slow CI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * remove Slider playwright-ct spec The Slider component test failed under the upgraded svelte 5.55 + vite-plugin-svelte 7 stack: playwright-ct passes plain objects for component props, but the Gradio class direct-aliases `_props.props` without an internal $state copy, so two-way `bind:value` doesn't propagate in the CT environment. The failing assertions were on range→number sync. The same flows are covered (more comprehensively) by the existing vitest unit tests in `Slider.test.ts`: number/range sync, value clamping, change/input/release events, reset button behavior, and accessibility — all of which run under the test infra's reactive proxy wrapper in `tootils/render.ts`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * unblock SSR functional tests on the upgraded svelte stack - skip custom_css `.dark styles` test in SSR mode. Under svelte 5.55 + vite-plugin-svelte 7 the user CSS `.dark .darktest h3` selector ties on specificity with gradio's prefixed `.prose h3` rule and loses on load-order in the SSR build. The companion `applies the custom CSS styles` test in this file is already skipped in SSR for similar reasons; tracking the load-order regression as a follow-up. - give render_tests its own 60s timeout. The demo is render-heavy (multiple `@gr.render` blocks, sliders, chatbots) and its SSR hydration occasionally pushes past the 30s default while the setup fixture is waiting for `#svelte-announcer`, manifesting as flaky setup timeouts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix e2e? * fix story * format * fix story again * fix(reload): push new server props into reused component instances Reload mode (`gradio <demo>` with watchdog) was failing to update the UI when components changed shape across a source-file edit. Tests hitting this: allowed_paths.reload, hello_blocks.reload (label changes, component swaps). Root cause: the Gradio<T,U> class in `js/utils/src/utils.svelte.ts` direct-aliases `_props.shared_props`/`_props.props` at construction (load-bearing for @gr.render user-edit preservation — see comments there). On reload, AppTree.reload() builds a new node tree with new ids and new prop objects. MountComponents matches children by position (unkeyed each), so the same component instances get reused — but the Gradio class inside each one keeps aliasing the OLD node's props. The new label/value/etc. never lands. `AppTree.rerender()` already handles the analogous case for @gr.render via #sync_reused_components_after_rerender — walks the new subtree and pushes only-defined keys via set_data, skipping undefined values so locally-edited fields survive. The id-change effect in the Gradio class re-registers the set_data callback under the new id, and #pending_updates queues anything that arrives before re-registration. Fix: call the same sync routine at the end of `reload()`. Same trade- offs apply as @gr.render — server-defined props propagate, locally- edited values (server omits them) are preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * clean up * fix * fix * fix * add changeset * fix * chore(tabs): remove debug logging and stale comments Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * format * add changeset * fix? * fix site * format * fix * format * fix error * add changeset * fix * format * Fix frontend profiling base gradio install * fix(ci): run frontend benchmark against installed gradio --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: hannahblair <hannahblair@hotmail.co.uk> Co-authored-by: Dawood <dawoodkhan82@gmail.com>
185 lines
7.1 KiB
JSON
185 lines
7.1 KiB
JSON
{
|
|
"name": "gradio-ui",
|
|
"version": "0.0.1",
|
|
"description": "Gradio UI packages",
|
|
"scripts": {
|
|
"dev": "pnpm css && pnpm --filter @gradio/preview build && pnpm --filter @self/app dev",
|
|
"css": "pnpm --filter @gradio/theme generate",
|
|
"build": "pnpm css && cross-env NODE_OPTIONS='--max-old-space-size=8192' pnpm --filter @self/app build --emptyOutDir && pnpm --filter @self/spa build --emptyOutDir && pnpm --filter @gradio/preview build",
|
|
"format:check": "prettier --ignore-path .config/.prettierignore --check --config .config/.prettierrc.json --plugin prettier-plugin-svelte .",
|
|
"format:write": "prettier --ignore-path .config/.prettierignore --write --config .config/.prettierrc.json --plugin prettier-plugin-svelte .",
|
|
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint -c .config/eslint.config.js js client/js",
|
|
"ts:check": "svelte-check --tsconfig tsconfig.json --threshold error",
|
|
"test": "pnpm --filter @gradio/client build && vitest dev --config .config/vitest.config.ts",
|
|
"test:run": "pnpm --filter @gradio/client build && vitest run --config .config/vitest.config.ts && node --test js/app/proxy_routes.test.js",
|
|
"test:client": "pnpm --filter=@gradio/client test",
|
|
"test:browser": "pnpm --filter @self/spa test:browser",
|
|
"test:browser:reload": "CUSTOM_TEST=1 pnpm --filter @self/spa test:browser:reload",
|
|
"test:browser:full": "run-s build test:browser",
|
|
"test:browser:verbose": "pnpm test:browser",
|
|
"test:browser:dev": "pnpm --filter @self/spa test:browser:dev",
|
|
"storybook": "storybook dev -p 6006",
|
|
"build-storybook": "storybook build",
|
|
"ci:version": "changeset version && pnpm i --lockfile-only && node ./.changeset/fix_changelogs.cjs",
|
|
"ci:publish": "pnpm changeset tag && TAG=gradio_client@$(node -p \"require('./client/python/gradio_client/package.json').version\") && (git rev-parse --verify --quiet \"refs/tags/$TAG\" >/dev/null || git tag -a \"$TAG\" -m \"$TAG\") && git push origin --tags && pnpm publish --no-git-checks --access public -r --filter=@gradio/*",
|
|
"website": "pnpm --filter @gradio/website build",
|
|
"package": "pnpm --filter @gradio/* --filter=!@gradio/client --filter=!@gradio/preview exec svelte-package --input=. --tsconfig=../../tsconfig.json",
|
|
"spaces:dev": "pnpm css && pnpm --filter @gradio/preview build && pnpm --filter @self/spaces-test dev"
|
|
},
|
|
"type": "module",
|
|
"author": "",
|
|
"license": "ISC",
|
|
"private": true,
|
|
"dependencies": {
|
|
"@changesets/changelog-github": "^0.5.1",
|
|
"@changesets/cli": "^2.29.7",
|
|
"@changesets/get-github-info": "^0.6.0",
|
|
"@csstools/postcss-global-data": "^3.1.0",
|
|
"@gradio/client": "workspace:^",
|
|
"@manypkg/get-packages": "^3.1.0",
|
|
"@playwright/test": "^1.60.0",
|
|
"@self/build": "workspace:^",
|
|
"@self/tootils": "workspace:^",
|
|
"@sveltejs/package": "^2.5.7",
|
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
"@tailwindcss/forms": "^0.5.10",
|
|
"@testing-library/dom": "^10.4.1",
|
|
"@testing-library/jest-dom": "^6.9.1",
|
|
"@types/node": "^24.7.0",
|
|
"@types/testing-library__jest-dom": "^6.0.0",
|
|
"@typescript-eslint/eslint-plugin": "^8.46.0",
|
|
"@typescript-eslint/parser": "^8.46.0",
|
|
"@vitest/browser-playwright": "^4.1.5",
|
|
"autoprefixer": "^10.4.21",
|
|
"cross-env": "^10.1.0",
|
|
"esbuild": "^0.25.10",
|
|
"eslint": "^9.37.0",
|
|
"eslint-plugin-svelte": "^3.12.4",
|
|
"globals": "^16.4.0",
|
|
"handlebars": "4.7.9",
|
|
"happy-dom": "^19.0.2",
|
|
"jsdom": "^27.0.0",
|
|
"kleur": "^4.1.5",
|
|
"msw": "^2.11.3",
|
|
"node-html-parser": "^7.0.1",
|
|
"npm-run-all2": "^8.0.4",
|
|
"playwright": "^1.60.0",
|
|
"plotly.js-dist-min": "^3.1.1",
|
|
"polka": "1.0.0-next.25",
|
|
"pollen-css": "^5.0.2",
|
|
"postcss": "8.5.6",
|
|
"postcss-custom-media": "^11.0.6",
|
|
"postcss-nested": "^7.0.2",
|
|
"postcss-prefix-selector": "^2.1.1",
|
|
"prettier": "^3.6.2",
|
|
"prettier-plugin-css-order": "^2.1.2",
|
|
"prettier-plugin-svelte": "^3.4.0",
|
|
"sirv": "^3.0.2",
|
|
"sirv-cli": "^3.0.1",
|
|
"svelte": "^5.55.4",
|
|
"svelte-check": "^4.4.6",
|
|
"svelte-eslint-parser": "^1.3.3",
|
|
"svelte-i18n": "^4.0.1",
|
|
"svelte-preprocess": "^6.0.3",
|
|
"tailwindcss": "^4.1.14",
|
|
"tinyspy": "^4.0.4",
|
|
"typescript": "^5.9.3",
|
|
"typescript-svelte-plugin": "^0.3.50",
|
|
"vite": "^8.0.9",
|
|
"vite-plugin-turbosnap": "1.0.3",
|
|
"vitefu": "^1.1.3",
|
|
"vitest": "^4.1.5"
|
|
},
|
|
"devDependencies": {
|
|
"@chromatic-com/storybook": "^4.1.3",
|
|
"@eslint/js": "^9.39.2",
|
|
"@gradio/accordion": "workspace:^",
|
|
"@gradio/annotatedimage": "workspace:^",
|
|
"@gradio/audio": "workspace:^",
|
|
"@gradio/box": "workspace:^",
|
|
"@gradio/browserstate": "workspace:^",
|
|
"@gradio/button": "workspace:^",
|
|
"@gradio/chatbot": "workspace:^",
|
|
"@gradio/checkbox": "workspace:^",
|
|
"@gradio/checkboxgroup": "workspace:^",
|
|
"@gradio/code": "workspace:^",
|
|
"@gradio/colorpicker": "workspace:^",
|
|
"@gradio/column": "workspace:^",
|
|
"@gradio/core": "workspace:^",
|
|
"@gradio/dataframe": "workspace:^",
|
|
"@gradio/dataset": "workspace:^",
|
|
"@gradio/datetime": "workspace:^",
|
|
"@gradio/dialogue": "workspace:^",
|
|
"@gradio/downloadbutton": "workspace:^",
|
|
"@gradio/draggable": "workspace:^",
|
|
"@gradio/dropdown": "workspace:^",
|
|
"@gradio/fallback": "workspace:^",
|
|
"@gradio/file": "workspace:^",
|
|
"@gradio/fileexplorer": "workspace:^",
|
|
"@gradio/form": "workspace:^",
|
|
"@gradio/gallery": "workspace:^",
|
|
"@gradio/group": "workspace:^",
|
|
"@gradio/highlightedtext": "workspace:^",
|
|
"@gradio/html": "workspace:^",
|
|
"@gradio/image": "workspace:^",
|
|
"@gradio/imageeditor": "workspace:^",
|
|
"@gradio/imageslider": "workspace:^",
|
|
"@gradio/json": "workspace:^",
|
|
"@gradio/label": "workspace:^",
|
|
"@gradio/markdown": "workspace:^",
|
|
"@gradio/model3d": "workspace:^",
|
|
"@gradio/multimodaltextbox": "workspace:^",
|
|
"@gradio/nativeplot": "workspace:^",
|
|
"@gradio/navbar": "workspace:^",
|
|
"@gradio/number": "workspace:^",
|
|
"@gradio/paramviewer": "workspace:^",
|
|
"@gradio/plot": "workspace:^",
|
|
"@gradio/radio": "workspace:^",
|
|
"@gradio/row": "workspace:^",
|
|
"@gradio/sidebar": "workspace:^",
|
|
"@gradio/simpledropdown": "workspace:^",
|
|
"@gradio/simpleimage": "workspace:^",
|
|
"@gradio/simpletextbox": "workspace:^",
|
|
"@gradio/slider": "workspace:^",
|
|
"@gradio/state": "workspace:^",
|
|
"@gradio/statustracker": "workspace:^",
|
|
"@gradio/tabitem": "workspace:^",
|
|
"@gradio/tabs": "workspace:^",
|
|
"@gradio/textbox": "workspace:^",
|
|
"@gradio/timer": "workspace:^",
|
|
"@gradio/upload": "workspace:^",
|
|
"@gradio/uploadbutton": "workspace:^",
|
|
"@gradio/vibeeditor": "workspace:^",
|
|
"@gradio/video": "workspace:^",
|
|
"@gradio/workflowcanvas": "workspace:^",
|
|
"@storybook/addon-a11y": "^10.1.11",
|
|
"@storybook/addon-docs": "^10.1.11",
|
|
"@storybook/addon-svelte-csf": "^5.0.10",
|
|
"@storybook/addon-vitest": "^10.1.11",
|
|
"@storybook/svelte-vite": "^10.1.11",
|
|
"@testing-library/user-event": "^14.6.1",
|
|
"@vitest/browser": "^4.1.5",
|
|
"@vitest/coverage-v8": "^3.2.4",
|
|
"eslint-plugin-jsdoc": "^61.0.0",
|
|
"eslint-plugin-storybook": "^10.1.11",
|
|
"storybook": "^10.1.11",
|
|
"vitest-browser-svelte": "^2.1.1",
|
|
"wikidata-lang": "5.0.1"
|
|
},
|
|
"engines": {
|
|
"node": ">=24.0.0",
|
|
"pnpm": "^10"
|
|
},
|
|
"packageManager": "pnpm@10.17.0",
|
|
"eslintConfig": {
|
|
"extends": [
|
|
"plugin:storybook/recommended"
|
|
]
|
|
},
|
|
"pnpm": {
|
|
"overrides": {
|
|
"svelte": "5.48.0"
|
|
}
|
|
}
|
|
}
|