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
Implement options page to persist Prettier config #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! Code mostly looks good to me, but I don't think this needs to be a completely separate app. Can we just update the webpack config to output a second bundle? We don't need to compile anything except JSX, I think, so adding and configuring Babel should be fairly straightforward.
I was originally hoping that CRA would make the build setup easier, but it's kind of a hassle to manually run two different build scripts depending on which files change. I'll give this a shot. |
Seems to be OK now.. or? |
I implemented a custom webpack config and moved the files around a bit. Do we like this setup? How would we feel about moving the contents of |
let's make it work.. then make it better :) |
I think this is a good foundation for the settings page, and once we change this we could merge this and follow up with styling and moving files around! |
Yea sorry, still working on that. I ran into some issues and set up devtools to make it easier to troubleshoot, but still need to finish tweaking its configuration. |
We should revert this after upgrading to Prettier 1.19.
Now that #59 is merged (which was an interactive rebase of this branch), should I merge or rebase this on top of master? |
No need to rebase.. we are squashing the PRs anyways. |
I figured out how to scope the |
I couldn't find a way to add more admins to the extension dashboard.. or how could I transfer it to another account so we can enable the automatic publishing. |
To be clear, I don't need publishing access for this PR specifically, as the storage is automatically set up with the user's Chrome storage and Google account (if any) due to the If you want to set up group publishing see Set up Group Publishing. Unfortunately this process is irreversible and charges each new publisher $5, but we could try auto publishing with a single account if you prefer (which I think I would too). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
@@ -482,4 +486,4 @@ function init() { | |||
} | |||
} | |||
|
|||
init(); | |||
chrome.storage.sync.get(init); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't necessarily a blocker (we can fix this later if need be), but this only runs when the page is loaded, correct? One use case this might not handle very gracefully is when a GitHub/StackOverflow tab is open and someone goes and changes the settings (they wouldn't go into effect until the page is reloaded).
We could probably fix this by reading from chrome storage each time Prettier formats (again, does not need to be a blocker to land this, just want to make sure it's commented here for posterity).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to implement this, but we should be able to use chrome.storage.onChanged.addListener
to subscribe to option updates in the content script.
Published in 0.0.4 |
Fixes #25
I still need to improve the UI, but feedback is welcome