gradio/js
pngwn 5bf00b7524
make all component SSR compatible (#9187)
* asd

* fixes

* make all components ssr compatible

* remove files

* add changeset

* add changeset

* review

* format

* clean

* address comments

* tweaks utils

* add changeset

* fix plot and audio

* format

* fix nativeplot

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-08-31 06:19:51 +00:00
..
_cdn-test Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
_spaces-test Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
_website Cloudflare migration (#9206) 2024-08-28 18:07:38 -07:00
accordion Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
annotatedimage make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
app Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
atoms Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
audio make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
box Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
build Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
button Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
chatbot make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
checkbox Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
checkboxgroup Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
code make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
colorpicker Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
column Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
component-test make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
core Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
dataframe make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
dataset make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
datetime Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
downloadbutton Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
dropdown make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
fallback Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
file make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
fileexplorer Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
form Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
gallery Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
group Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
highlightedtext Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
html Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
icons Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
image Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
imageeditor make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
json Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
label Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
lite Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
markdown make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
model3D make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
multimodaltextbox Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
nativeplot make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
number Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
paramviewer make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
plot Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
preview Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
radio Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
row Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
simpledropdown Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
simpleimage Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
simpletextbox Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
slider Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
spa Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
state Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
statustracker Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
storybook Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
tabitem Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
tabs Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
textbox Adding maxlength attribute handling of textarea and input HTML element for the gr.TextBox() component via a max_length parameter (#9185) 2024-08-27 23:42:05 +00:00
theme Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
timer Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
tooltip Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
tootils Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
upload Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
uploadbutton Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
utils make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
video Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
wasm make all component SSR compatible (#9187) 2024-08-31 06:19:51 +00:00
.npmrc
jsx.d.ts Fix published package exports (#9163) 2024-08-22 16:38:45 +00:00
README.md

gradio-ui

This folder contains all of the Gradio UI and component source code.

setup

This folder is managed as 'monorepo' a multi-package repository which make dependency management very simple. In order to do this we use pnpm as our package manager.

Make sure pnpm is installed by following the installation instructions for your system.

You will also need node which you probably already have

running the application

Install all dependencies:

pnpm i

This will install the dependencies for all packages and link any local packages

local development

To develop locally, open two terminal tabs from the root of the repository.

Run the python test server, from the root directory:

cd demo/kitchen_sink
python run.py

This will start a development server on port 7860 that the web app is expecting.

Run the web app:

pnpm dev

building for production

Run the build:

pnpm build

This will create the necessary files in js/app/public and also in gradio/templates/frontend.

quality checks

The repos currently has two quality checks that can be run locally and are run in CI.

formatting

Formatting is handled by prettier to ensure consistent formatting and prevent style-focused conversations. Formatting failures will fails CI and should be reoslve before merging.

To check formatting:

pnpm format:check

If you have formatting failures then you can run the following command to fix them:

pnpm format:write

type checking

We use TypeScript to provide static types to javascript code. These checks are also run in CI.

to typecheck the code:

pnpm ts:check

ci checks

Currently the following checks are run in CI:

static checks

  • Format check (pnpm format:check)
  • Build css (pnpm css)
  • Build client (pnpm build)
  • Type check (pnpm ts:check)
  • Unit tests (pnpm test:run)

functional test

pip install -r demo/outbreak_forecast/requirements.txt
pnpm exec playwright install chromium
pnpm exec playwright install-deps chromium
pnpm test:browser:full