-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
clean up component folder structure + move components out of the app
package
#3360
Comments
app
package
Nice @pngwn! I wonder if we should make |
Ah that's a good point, yeah maybe that makes more sense! |
Well they can be used as inputs but they don't do anything (just emit a |
Oh and this might be a minor point, but this is probably best time to bring it up -- can we rename the component modes "input", "output", and "example" instead of "interactive", "static", and "preview"? Naming doesn't matter if we're using these internally but since we're planning on letting users contribute custom components, this naming would be more intuitive (since they're already familiar with inputs/outputs) and be one less thing to remember |
Well, the only reason that might not make sense if you can use interactive as output and static as input if you want to. Since blocks, those distinctions aren't as clear any more. I wonder would a new user have those distinctions or is this an interface-centric interpretation? SO users who are familiar with gradio pre-3.0 might think that way but does it still translate. The real distinction between interactive/ static is interactive can accept user-input + responds to that input whereas static does not, but that doesn't dictate their relationship to input/output in gradio itself. |
Good point, okay let's leave it as is then! |
Chatted with @pngwn this morning about this refactor. Here is what we discussed. The work will be split between two PRs. The first PR will solely reorganize the component directories to match the structure mentioned in the original comment. The current The second PR will refactor Blocks.svelte so that components can be loaded dynamically based on props, e.g. the static, dyamic, or preview versions of each component. This will be the same infrastructure used for dynamically loading custom components. @pngwn Will take this opportunity to write some unit tests for Blocks.svelte. It might also be possible to do this work piecemeal (at least in batches). We may need a separate |
Thanks @freddyaboulton @pngwn, sounds like a plan! |
Get the components out of the
app
. This is the really disruptive part, so I want to keep it simple conceptually./interactive/
this will contain the interactive variant of a component - optional - static used when not present/static/
this will contain the static variant of a component - mandatory/example/
this will contain the preview variant of a component - optional - fallback used when not present@gradio/fallback
package which we defer to in certain cases.index.ts
that exports the correct component. The components can be called anything. We won't explicitly use these subfolder for now (we will have anindex.svelte
in the root) but will be cleaned up in a future refactor./preview/
will be empty for a short period of time.This will get closed when all of this work is done. tracking issue for the first part:
The text was updated successfully, but these errors were encountered: