gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
30.69k stars 2.28k forks source link

Be able to pass the component loader to each svelte component #8257

Open freddyaboulton opened 1 month ago

freddyaboulton commented 1 month ago

Is your feature request related to a problem? Please describe.
There are cases where a svelte component may need to load another component

Describe the solution you'd like
The gradio prop can have a loader attribute that can load any core or registered custom component.

Additional context
Add any other context or screenshots about the feature request here.

pngwn commented 1 month ago

We also need this to make the Examples dynamic I think.

pngwn commented 3 weeks ago

This is half implemented but it doesn't work for custom components.

The reason is that we request custom components via the component_class_id, this id is generated on the server and stored in the config, and is randomly generated at launch time. A user of an app has no way to access it.

The other issue is that the app doesn't know anything about a component until it is rendered.

We need to do one of two things:

pngwn commented 12 hours ago

I'll pad this out some more when @freddyaboulton has time to chat.

Okay, got a solution. Will take care of this next week with other component loader issues.