-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Generate SVG assets at build time #36430
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
base: main
Are you sure you want to change the base?
Conversation
|
Test failures indicate the backend may also have a dependency on the SVG assets, so likely we will need to alter make dependencies which will introduce the |
Actually I think it can be avoided. It's just that all tests have the dependency on the svg files and therefor node now, so I've added |
|
As an IDE users, before:
After: it needs one more step to build svg before starting the debugger? |
Should work like before, |
To further clarify: Backend does not have a dependency on pre-built SVGs, only tests have this dependency. In development they will be read from the file system and for the prod build it's guaranteed that the |
Backend does need the pre-built SVGs, backend directly loads SVGs from Since this: Direct SVG rendering (#12157), https://github.com/go-gitea/gitea/pull/12157/files#diff-315287eed590655a2b96b78db333e10c824282a6764d25f5e13642a8c4386e3c |
Yes but it's not a requirement for them to exist before the backend dev server starts, it's fine if they are generated with a delay as part of |
It is a requirement for them to exist before the backend dev server stars , see |
|
Hmm that complicates it. What exactly does |
Run the entry: BTW: I don't mean that it is a must that the assets must be ready before the server's first start. It can tell developers that the assets are missing and restart the server later. I only mean that backend server does need the assets to work. |
|
I'd say running Aside that, vscode seems to allow some customization for the debugger startup. Maybe via a But in any case, we need to fix |
Yep, SVG assets are different from JS/CSS assets. Backend can tolerate that JS/CSS assets are missing and load them later flawlessly (one flaw: theme list will be empty and use default theme). But if SVG assets are missing, the server need to restart to do reload. Or, need to make backend code also tolerate SVG assets missing and support dynamic reloading |
Goland debugger: |
I guess we could remove this Line 17 in 2a56c4e
|
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.
Pull request overview
This PR automates SVG asset generation by integrating it into the build process. Instead of requiring manual make svg commands and checking generated files into git, SVG assets are now generated automatically as build dependencies.
Changes:
- Modified Makefile to generate SVG assets as a prerequisite for webpack, tests, and linting tasks
- Updated GitHub Actions workflows to install Node.js and pnpm for backend test jobs
- Removed the separate
svg-checktarget that verified generated assets were committed
Reviewed changes
Copilot reviewed 2 out of 436 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Makefile | Added $(SVG_DEST) as a dependency to webpack, test targets, and linting tasks; removed svg-check target and converted svg to use make dependencies |
| .github/workflows/pull-db-tests.yml | Added pnpm and Node.js setup steps to all database test jobs to support SVG generation during builds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This generates the SVG asset directories before running webpack, eliminating the needs to have the output files checked into git and to run
make svgafter these dependency updates. The only downside is we can not see changes to the output files during review, but that's acceptable imho.