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

fix space embeds using src attribute #3065

Merged
merged 6 commits into from
Jan 27, 2023
Merged

fix space embeds using src attribute #3065

merged 6 commits into from
Jan 27, 2023

Conversation

pngwn
Copy link
Member

@pngwn pngwn commented Jan 26, 2023

Description

Changed the ports in dev mode.

Currently if you try to embed a gradio app (via a space) and run your embedding app locally on port 3000 (which is pretty much a default), the gradio SDK will make requests to localhost:3000/x/x rather than the space because of some special handling we have for production testing. This PR changes the local port to something ridiculous which should make it so that these kinds of problems never occur (for most people).

Kind of closes #2880 although I can't actually reproduce that issue.

Edit: I finally figured out #2880. It was due to the src attribute on the web component (rather than host or space). I think we can combine those three attributes into one. Details are here: #2880 (comment)

Definitely fixes #2880 now.

Please include:

  • relevant motivation
  • a summary of the change
  • which issue is fixed.
  • any additional dependencies that are required for this change.

Closes: # (issue)

Checklist:

  • I have performed a self-review of my own code
  • I have added a short summary of my change to the CHANGELOG.md
  • My code follows the style guidelines of this project
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

A note about the CHANGELOG

Hello 👋 and thank you for contributing to Gradio!

All pull requests must update the change log located in CHANGELOG.md, unless the pull request is labeled with the "no-changelog-update" label.

Please add a brief summary of the change to the Upcoming Release > Full Changelog section of the CHANGELOG.md file and include
a link to the PR (formatted in markdown) and a link to your github profile (if you like). For example, "* Added a cool new feature by [@myusername](link-to-your-github-profile) in [PR 11111](https://github.com/gradio-app/gradio/pull/11111)".

If you would like to elaborate on your change further, feel free to include a longer explanation in the other sections.
If you would like an image/gif/video showcasing your feature, it may be best to edit the CHANGELOG file using the
GitHub web UI since that lets you upload files directly via drag-and-drop.

@gradio-pr-bot
Copy link
Collaborator

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-3065-all-demos

Copy link
Collaborator

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

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

Tested and works well @pngwn ! Thank you

@pngwn pngwn changed the title change ports in dev mode fix space embeds using src attribute Jan 27, 2023
@pngwn pngwn merged commit 669ee42 into main Jan 27, 2023
@pngwn pngwn deleted the 2880-port-fix branch January 27, 2023 14:39
@pngwn pngwn restored the 2880-port-fix branch January 27, 2023 14:43
tomchang25 pushed a commit to tomchang25/gradio that referenced this pull request Feb 2, 2023
* Fix bug

* CHANGELOG

demo

fix-tabs (gradio-app#3055)

* fix-tabs

* Reformat changelog

Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com>

video-bug-demo

Another bug

Fix video and file events bugs

demo.ipynb

fix space embeds using `src` attribute (gradio-app#3065)

* change ports in dev mode

* changelog

* correctly detect space embeds

* changelog

* formatting

fix css scoping (gradio-app#3059)

Fix auth on spaces (gradio-app#3049)

* Add route alias

* on button click

* Fix config

* Do not redirect

* Use login to check if other route necessary

* Add message about HF spaces

* CHANGELOG

* Add gif to changelog

Fix Sketch clearing bug (gradio-app#3047)

* bug fix

* changelog

* undo fix

Release version 3.17.0 (gradio-app#3074)

* version 3.17.0

* changelog

New Version Docs (gradio-app#3087)

Chatbot loader (gradio-app#3079)

* changes

* chagnes

* changes

* changes

* changes

* changes

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

Changelog and format front

changelog fix

Change demo video and image

Fix image rotation on iOS (gradio-app#3091)

* rotate image based on exif tag

* rotate on backend

* CHANGELOG

* Only rotate if needed

* Add image comparison to changelog

---------

Co-authored-by: Dawood Khan <dawoodkhan82@gmail.com>

Set minimum markdown-it-py version to 2.0.0 (gradio-app#3102)

* Bump requirements

* CHANGELOG

only mount fonts in prod mode (gradio-app#3100)

* only mount fonts in prod mode

* cleanup

---------

Co-authored-by: aliabid94 <aabid94@gmail.com>

Fix change event listener (gradio-app#3095)

* changes

* changes

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: pngwn <hello@pngwn.io>

[Minor] Correct link (gradio-app#3109)

* Correct link

* Update CHANGELOG.md

Enable gradio to work on kaggle (gradio-app#3101)

* enable share kaggle

* Add test

* CHANGELOG

* Add image to changelog

Fix example gallery mode (gradio-app#3090)

* Fix example gallery mode

* CHANGELOG

fix changelog

fix changelog
@pngwn pngwn deleted the 2880-port-fix branch October 9, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gradio app not working inside Next.js
3 participants