Custom libraries in head of gr.HTML#12990
Custom libraries in head of gr.HTML#12990aliabid94 wants to merge 4 commits intoadd_watch_to_custom_htmlfrom
Conversation
js/html/shared/HTML.svelte
Outdated
| }; | ||
| } | ||
|
|
||
| function plain_value(v: any): any { |
There was a problem hiding this comment.
Passing value to the chart.js example in super_html was causing some conflict with the proxying we do in gr.html to the props object, so now we do this deep copying to fix this bug.
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/8c0a6d239cd70a8dddc85da2a5166c63b59d0ca7/gradio-6.9.0-py3-none-any.whlInstall Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@8c0a6d239cd70a8dddc85da2a5166c63b59d0ca7#subdirectory=client/python"Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/8c0a6d239cd70a8dddc85da2a5166c63b59d0ca7/gradio-client-2.1.0.tgz |
freddyaboulton
left a comment
There was a problem hiding this comment.
LGTM but I think we should use $state.snapshot instead of plain_props/plain_value. It is the svelte 5 idiomatic way to turn the proxy object into a plain value and we shouldn't need to re-implement it ourselves.
Ty for updating the skills and the docs!
pngwn
left a comment
There was a problem hiding this comment.
Why don't we use <svelte:head > here? It will add / remove the elements correctly when the component is added/ removed, ensuring we don't have any memory leaks and is a bit easier to reason about in code.
Add head= support to gr.HTML to support third party libraries.