From 669ee42c8f11dd68a3e0ad9f15fff5c006dc2e22 Mon Sep 17 00:00:00 2001 From: pngwn Date: Fri, 27 Jan 2023 14:39:36 +0000 Subject: [PATCH] fix space embeds using `src` attribute (#3065) * change ports in dev mode * changelog * correctly detect space embeds * changelog * formatting --- CHANGELOG.md | 1 + guides/06_other-tutorials/creating-a-new-component.md | 2 +- ui/packages/_cdn-test/index.html | 6 +++--- ui/packages/app/package.json | 2 +- ui/packages/app/snapshots/blocks_layout.spec.ts | 2 +- ui/packages/app/snapshots/blocks_xray.spec.ts | 2 +- ui/packages/app/snapshots/kitchen_sink.spec.ts | 2 +- ui/packages/app/src/api.ts | 2 +- ui/packages/app/src/main.ts | 10 +++++++--- ui/packages/app/test/blocks_inputs.spec.ts | 2 +- ui/packages/app/test/blocks_kinematics.spec.ts | 2 +- ui/packages/app/test/blocks_page_load.spec.ts | 2 +- ui/packages/app/test/blocks_xray.spec.ts | 4 ++-- ui/packages/app/test/input_output.spec.ts | 2 +- ui/packages/app/test/kitchen_sink.spec.ts | 4 ++-- ui/packages/app/test/outbreak_forecast.spec.ts | 4 ++-- ui/packages/app/vite.config.js | 2 +- ui/playwright-setup.js | 4 ++-- 18 files changed, 30 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd576d97d6726..28cbb589ed639 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ By [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3014](https://github. * Adding missing embedded components on docs by [@aliabd](https://github.com/aliabd) in [PR 3027](https://github.com/gradio-app/gradio/pull/3027) * Fixes bug where app would crash if the `file_types` parameter of `gr.File` or `gr.UploadButton` was not a list by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3048](https://github.com/gradio-app/gradio/pull/3048) * Fix bug where input component was not hidden in the frontend for `UploadButton` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3053](https://github.com/gradio-app/gradio/pull/3053) +* Ensure spaces embedded via the web component always use the correct URLs for server requests and change ports for testing to avoid strange collisions when users are working with embedded apps locally by [@pngwn](https://github.com/pngwn) in [PR 3065](https://github.com/gradio-app/gradio/pull/3065) * Preserve selected image of Gallery through updated by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3061](https://github.com/gradio-app/gradio/pull/3061) * Fixes bug where tabs selected attribute not working if manually change tab by [@tomhang25](https://github.com/tomchang25) in [3055](https://github.com/gradio-app/gradio/pull/3055) diff --git a/guides/06_other-tutorials/creating-a-new-component.md b/guides/06_other-tutorials/creating-a-new-component.md index 0bf0f855fe5af..6256cecdea5d6 100644 --- a/guides/06_other-tutorials/creating-a-new-component.md +++ b/guides/06_other-tutorials/creating-a-new-component.md @@ -385,7 +385,7 @@ You can take a look at the [demo](https://github.com/gradio-app/gradio/tree/main To test the application: - run on a terminal `python path/demo/run.py` which starts the backend at the address [http://localhost:7860](http://localhost:7860); -- in another terminal, from the ui folder, run `pnpm dev` to start the frontend at [http://localhost:3000](http://localhost:3000) with hot reload functionalities. +- in another terminal, from the ui folder, run `pnpm dev` to start the frontend at [http://localhost:9876](http://localhost:9876) with hot reload functionalities. ## Conclusion diff --git a/ui/packages/_cdn-test/index.html b/ui/packages/_cdn-test/index.html index 59f774ae07b9e..1ae881a29f849 100644 --- a/ui/packages/_cdn-test/index.html +++ b/ui/packages/_cdn-test/index.html @@ -39,7 +39,7 @@

hello subtitle

Hello text. Hello text.

hello subtitle

@@ -58,11 +58,11 @@

hello subtitle

Hello text. Hello text. Hello text. Hello text. Hello text. Hello text. Hello text. Hello text.

- + > -->