-
Notifications
You must be signed in to change notification settings - Fork 345
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
Change icons to vector #1013
Change icons to vector #1013
Conversation
67477c3
to
90c34c7
Compare
e13e6ad
to
2053725
Compare
Aargh! With the icons, the generated bundle is huge (2 MB). I tried subsetting the icons like import { fas } from '@fortawesome/free-solid-svg-icons';
library.add(fas.faCog); and then import { faCog } from '@fortawesome/free-solid-svg-icons';
library.add(faCog); but neither of these really made the bundle smaller. Finally I switched to deep imports import { faCog } from '@fortawesome/free-solid-svg-icons/faCog';
library.add(faCog); getting the size back down to 0.4 MB. It turns out Parcel still does not use tree shaking by default, you have to enable it with Well never mind, I have been meaning to get rid of the custom scrollbar for a long time. But, apparently, it also does not support source maps. Welp. |
Parcel’s tree shaking is shaky: #1013 (comment)
Parcel’s tree shaking is shaky: #1013 (comment)
Parcel’s tree shaking is shaky: #1013 (comment)
Vector icons will look much crisper on HiDPI devices. Using them will also allow us to colour them in a dark theme. We use FontAwesome DOM loading script for now. We will be able to use the `icon` helper directly in JSX when we complete the switch to client side rendering. For size reasons, we are subsetting the icons, so when we want to use an icon not already used, we will need to add it here. But this was true for image files as well. We need to use deep imports for plug-ins, though, since Parcel’s tree shaking is shaky: #1013 (comment) We also no longer depend on parcel-plugin-static-files-copy, since we only used it for icons referrence by <img> tag from PHP templates (not picked up by Parcel).
Vector icons will look much crisper on HiDPI devices. Using them will also allow us to colour them in a dark theme. We use FontAwesome DOM loading script for now. We will be able to use the `icon` helper directly in JSX when we complete the switch to client side rendering. For size reasons, we are subsetting the icons, so when we want to use an icon not already used, we will need to add it here. But this was true for image files as well. We need to use deep imports for plug-ins, though, since Parcel’s tree shaking is shaky: #1013 (comment) We also no longer depend on parcel-plugin-static-files-copy, since we only used it for icons referrence by <img> tag from PHP templates (not picked up by Parcel).
This will make selfoss look crisper on hi-res displays and also allow better
user.css
theming.