-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Feature - optimise build size and performance with PrismLight syntax highlighter and add a new highlighter style selector #97
Conversation
✅ Deploy Preview for quicksnip ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@psychlone77 @saminjay This PR handles (and tests) the usage of A new highlighter style selector has been added, but this is only proof of concept for now and is therefore subject to change. I've also done some consolidation to remove duplicated code around theme selection ("dark" or "light"), and selector component logic. Finally, the selected highlighter theme is saved in localStorage, as well as the language (but the latter of these two changes may not be desirable), so that these selections persist for the user in the same manner as the theme. The feature discussion for these changes is here: #94, and everything is subject to change if these alterations are not welcome. Thanks. |
It doesn't seem to highlight certain language like C or CPP |
oneDark |
But i checked a couple more, and none color the text |
Didn't mean to close. Re-opened. |
I've tested it one brave, chrome, firefox, all with and without extension and it didn't work on a signe one of them... I think there is something wrong with this... |
@Mathys-Gasnier I think i've fixed it. It seems that |
Sad, but i think that size is for good, since it allows for snippets to be read easier. |
Unfortunately it seems that way. Although the original premise of this PR is now redundant, I am interested to see if you and the other maintainers (+ the community) would find the other changes here useful. |
The theme switch is cool, but i don't really think it's necessary, and for the Select, I think another PR was created that migrates that to Shadcn and tailwind |
The Select component code remains the same (apart from some minor changes that handle text overflow with ellipsis), but it was just extracted into its own component. In that case I can close this PR if you are happy for me to do so? |
@barrymun, regarding the theme switch, we might come back to it in the future. But right now, I also agree with @Mathys-Gasnier. It's better to keep things simple. |
Description
Optimise build size and performance withPrismLight
syntax highlighter.PrismLight
cannot be used as it does not support a lot of the languages that are selectable in the dropdown.theme
andtoggleTheme
so that duplicated logic is removed.Selector
component.localStorage
("languageName").localStorage
("highlighterStyleName").Type of Change
Performance optimisationsand adding a new selector.Checklist
Related Issues
Closes #94
Additional Context
Screenshots (Optional)
Click to view screenshots
new build size:
new
localStorage
keys: