Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial SSR refactor #9102

Merged
merged 24 commits into from
Aug 14, 2024
Merged

Initial SSR refactor #9102

merged 24 commits into from
Aug 14, 2024

Conversation

pngwn
Copy link
Member

@pngwn pngwn commented Aug 13, 2024

Description

This is the initial part of #8795.

Some light refactoring to make it easier to create both SSR and SPA versions of gradio.

We still need the SPA version so we can fallback to it when node isn't available and also so we can continue to support the embeds.

This PR does the following:

  • introduces @gradio/core. This contains mosrt of the inner workings of the gradio frontend, exactly as they were. But instead of being an entire app, these parts are now exported for consumption elsewhere.
  • introduces @gradio/spa. This consumes @gradio/core and is the current gradio frontend and what we use to build the actual app currently.
  • Refactors the gradio python and gradio lite packages and builds. Instead of @gradio/lite being a special build of @gradio/app (or @gradio/core now). It now has its own dedicated build step + config . All build commands and test commands are contained within the @gradio/lite packages. This has simplified the configs + build processes of both @gradio/spa and @gradio/lite.
  • @gradio/app is now empty (i'll add the boilerplate in this PR) but this will be the location of the SSR/ node version of the gradio 'app'. I wanted to use 'app' because this more accurately reflects the nature of its contents.

@pngwn pngwn changed the title Ssr initial Initial SSR refactor Aug 13, 2024
@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Aug 13, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
🦄 Changes detecting...

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/04a92141dbe233d2d7c650422035290a8cf6931a/gradio-4.41.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@04a92141dbe233d2d7c650422035290a8cf6931a#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/04a92141dbe233d2d7c650422035290a8cf6931a/gradio-client-1.5.0.tgz

@abidlabs
Copy link
Member

Demos look good to me @pngwn! You can ignore the failing Model3D demo, as that is also failing on main.

Should be good to merge once js tests pass

Copy link
Member

@whitphx whitphx left a comment

Choose a reason for hiding this comment

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

Thanks! I really like the split spa/lite packages and build configs.
I just reviewed code around lite and put nit comments but it overall LGTM.

.lite-perf.json Outdated Show resolved Hide resolved
js/wasm/src/worker-proxy.ts Outdated Show resolved Hide resolved
scripts/build_lite.sh Outdated Show resolved Hide resolved
=23.2 Outdated Show resolved Hide resolved
pngwn and others added 3 commits August 14, 2024 12:11
Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com>
@pngwn pngwn changed the base branch from 5.0-dev to main August 14, 2024 11:12
@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Aug 14, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/audio patch
@gradio/build patch
@gradio/button patch
@gradio/chatbot patch
@gradio/core patch
@gradio/dataframe patch
@gradio/lite patch
@gradio/plot patch
@gradio/spa patch
@gradio/storybook patch
@gradio/video patch
@gradio/wasm patch
app patch
gradio patch
website patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Initial SSR refactor

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@pngwn pngwn added the v: patch A change that requires a patch release label Aug 14, 2024
@pngwn pngwn merged commit efdc323 into main Aug 14, 2024
17 of 18 checks passed
@pngwn pngwn deleted the ssr-initial branch August 14, 2024 14:17
This was referenced Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v: patch A change that requires a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants