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

Bind fetch and stream in JS client #8714

Merged
merged 16 commits into from
Jul 11, 2024
Merged

Bind fetch and stream in JS client #8714

merged 16 commits into from
Jul 11, 2024

Conversation

hannahblair
Copy link
Collaborator

@hannahblair hannahblair commented Jul 8, 2024

Description

Bind fetch and stream in the JS client as these methods have no this value when called outside the client.

Thanks to @pngwn for spotting the issue + solution!

Closes: #8707

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

@hannahblair hannahblair requested a review from pngwn July 8, 2024 11:29
@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jul 8, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/1a44bb554f7d4a8402640167fb1b950df6ebab82/gradio-4.37.2-py3-none-any.whl

Install Gradio Python Client from this PR

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

Install Gradio JS Client from this PR

npm install https://gradio-builds.s3.amazonaws.com/1a44bb554f7d4a8402640167fb1b950df6ebab82/gradio-client-1.2.1.tgz

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jul 8, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/client patch
@gradio/upload patch
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Bind fetch and stream in JS client

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.

Copy link
Member

@pngwn pngwn left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for taking care of this @hannahblair!

@pngwn
Copy link
Member

pngwn commented Jul 8, 2024

Hmm. The deployed demos work fine, not sure why those tests are failing.

@abidlabs
Copy link
Member

abidlabs commented Jul 8, 2024

Thanks @hannahblair! Can we add a test for this? I'm surprised that this wasn't already caught by our E2E tests

@pngwn
Copy link
Member

pngwn commented Jul 8, 2024

Yeah I don't really understand how this didn't cause our functional tests to fail.

@pngwn
Copy link
Member

pngwn commented Jul 8, 2024

Although now it is hilariously.

@@ -59,6 +60,7 @@
};
});
onDestroy(() => {
// the stream will close itself but is here for perspicuity; remove .close() in 5.0
Copy link
Member

Choose a reason for hiding this comment

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

the fuck kinda word is this

Copy link
Member

Choose a reason for hiding this comment

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

Screenshot 2024-07-11 at 12 45 56

are ppl just making words up or something

Copy link
Member

Choose a reason for hiding this comment

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

maybe i'm just stupider than i thought i was (and i already thought i was pretty stupid)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i did consult a thesaurus and it was exactly the word i needed 😤

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Screenshot 2024-07-11 at 12 48 22

see cambridge dictionarys definition

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i need a new word

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right fine clarity it is

Copy link
Member

@pngwn pngwn left a comment

Choose a reason for hiding this comment

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

Perfect, thanks! And thanks for figuring out that test failure @hannahblair!

@hannahblair hannahblair enabled auto-merge (squash) July 11, 2024 12:01
@hannahblair hannahblair merged commit 1b5b5b0 into main Jul 11, 2024
8 checks passed
@hannahblair hannahblair deleted the bind-fetch-stream branch July 11, 2024 14:35
@pngwn pngwn mentioned this pull request Jul 11, 2024
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 version upgrade to 4.37.2, image upload error
4 participants