-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Directly render SVG paths #11618
Comments
For the client side, we can probably just pre-generate a JSON file to be included in the webpack build based on |
I think we can do it like this:
The client-side only uses like 5 octicons, I think we can just hardcode them there for now. Maybe later create a separate bindata chunk for SVG as it does not need to be in Instead of a spritesheet, it could also just output a easy to parse JSON structure, like https://github.com/kinoheld/webpack-svg-to-json-plugin/blob/master/svg-to-json.js. |
Introduce 'make svg' which calls a node script that compiles svg files to `public/img/svg`. These files are vendored to not create a dependency on Node for the backend build. On the frontend side, configure webpack using `raw-loader` so SVGs can be imported as string. Also moved our existing SVGs to web_src/svg for consistency. Fixes: go-gitea#11618
Introduce 'make svg' which calls a node script that compiles svg files to `public/img/svg`. These files are vendored to not create a dependency on Node for the backend build. On the frontend side, configure webpack using `raw-loader` so SVGs can be imported as string. Also moved our existing SVGs to web_src/svg for consistency. Fixes: #11618
When clicking through pages, I observe SVGs flashing because apparently the icon rendering needs to wait on the ajax request done in JS to succeed. To prevent this, we should directly render the
<path>
s without<use>
both on server and client which does require a bit of parsing of the generated spritemap but should otherwise be possible.The text was updated successfully, but these errors were encountered: