-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Config support #25
Comments
Definitely think we should implement this! Assuming we want this in the extension's settings page, seems like we could:
|
As far as UI is concerned, I really like how Code Sandbox does it. There's a preference pane with a GUI for the Prettier fields and a link to edit the JSON directly for importing/exporting (similar vibe to VSCode's user/workspace settings). |
That seems pretty ideal to me. |
Would you be okay with pulling in React for this? It will require some build configuration which I can help with, but it's pretty small and will make managing the form a lot easier. Code Sandbox is also using React, but I'm not sure how reusable their components in the source would be. |
I'm not opposed to that at all! The current plugin code uses vanilla JS because there really isn't much UI to render. |
Yes, I also don't mind React.. as long as it's nice and tidy..! :) |
I just realized the playground is using React, would it be better to try to reuse those components instead of cloning Code Sandbox's UI? It has sections and I figure it might be more familiar to Prettier users, though I think Code Sandbox's looks nicer. Code reuse would be a little tricky at first with this being a separate repository from Prettier and the playground, but we could release a package for both in theory. |
Oh, that's interesting. It looks like there are a number of configuration options in the playground that we probably wouldn't use. I wonder if it's worth the overhead of extracting out a package that we have to make sure works for both cases? Given that there isn't a ton of complex behavior, I'm inclined to say we just write our out config UI. I'm happy to go with consensus on this though :) |
We could start by copying it if we like the playground UI, and extract a package if we end up using shared logic. Do you have any preference over this UI or the code sandbox one? Or do you have a different idea? |
I think that seems like a good plan! I didn't have any particular design choices in mind. I like the idea of making it an embedded option, because then you can just style the popup and not have to worry about how it looks in a full document. I think the Redux DevTools use this nicely: |
That's a good idea, I think it would make formatting easier. |
#23 (comment)
The text was updated successfully, but these errors were encountered: