Comments (11)
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).
from prettier-browser-extension.
Definitely think we should implement this! Assuming we want this in the extension's settings page, seems like we could:
- Have a text input that accepts JSON
- Have individual inputs for each configurable option (I think VS Code's plugin does this?)
- Both of the above!
from prettier-browser-extension.
That seems pretty ideal to me.
from prettier-browser-extension.
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.
from prettier-browser-extension.
I'm not opposed to that at all! The current plugin code uses vanilla JS because there really isn't much UI to render.
from prettier-browser-extension.
Yes, I also don't mind React.. as long as it's nice and tidy..! :)
from prettier-browser-extension.
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.
from prettier-browser-extension.
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 :)
from prettier-browser-extension.
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?
from prettier-browser-extension.
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:
from prettier-browser-extension.
That's a good idea, I think it would make formatting easier.
from prettier-browser-extension.
Related Issues (20)
- Feature request: ability to format code files hosted on github HOT 9
- Add isRequired to prop types
- Support GitHub Wiki pages!
- Unable to load unpacked extension after development build HOT 3
- Fields should have labels including field titles and checkbox descriptions
- Options link in extension options has broken link HOT 3
- Add screenshot(s) to `README.md` showing usage HOT 5
- Add instructions for setting options to `README.md` HOT 2
- Safari support for macOS Big Sur
- Code formatting on working on GitHub HOT 1
- Change default branch to main HOT 6
- Rethink approach HOT 8
- Consider adding more web-ext scripts
- Stack Overflow code snippets are not formatted
- formatting errors for generics when `lang-tsx` is selected
- Publish to firefox addons AMO store
- How to use it? HOT 1
- Support Stack Exchange sites other than Stack Overflow
- Prettier button appears where it shouldn't on GitHub
- Upgrade to Prettier 1.19 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier-browser-extension.