Skip to content

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Sep 11, 2025

Given that this bundler is almost a drop-in replacement to webpack, it might be worth switching. So far it seems everything is working, but more testing is needed, so I'm setting draft.

  • Dev build time is reduced from 10s to 5s
  • Prod build time is reduced from 16s to 10s
  • JS output size is reduced from 21.3MB to 19.8MB
  • CSS output size is increased from 778kB to 818kB

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 11, 2025
@silverwind silverwind marked this pull request as draft September 11, 2025 06:36
@silverwind
Copy link
Member Author

One related update added here: https://github.com/sindresorhus/add-asset-webpack-plugin/releases/tag/v3.1.0 includes type definitions, so I removed the type stub for that package.

@silverwind
Copy link
Member Author

This is working very well in my testing, chunk loading and all works as expected. It supports the webpack comments and variables, so from my point of view, this is ready.

@silverwind silverwind marked this pull request as ready for review September 11, 2025 14:41
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 12, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 12, 2025
@techknowlogick techknowlogick enabled auto-merge (squash) September 12, 2025 18:58
@techknowlogick techknowlogick added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Sep 12, 2025
@techknowlogick techknowlogick merged commit 866c636 into go-gitea:main Sep 12, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Sep 12, 2025
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Sep 12, 2025
@lunny
Copy link
Member

lunny commented Sep 13, 2025

It seems rspack haven't support riscv yet.

Error: Cannot find module './rspack.linux-riscv64-musl.node'
#35 131.7     Require stack:
#35 131.7     - /go/src/code.gitea.io/gitea/node_modules/.pnpm/@rspack+binding@1.5.3/node_modules/@rspack/binding/binding.js
#35 131.7         at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15)
#35 131.7         at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
#35 131.7         at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
#35 131.7         at Function._load (node:internal/modules/cjs/loader:1211:37)
#35 131.7         at TracingChannel.traceSync (node:diagnostics_channel:322:14)
#35 131.7         at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
#35 131.7         at Module.require (node:internal/modules/cjs/loader:1487:12)
#35 131.7         at require (node:internal/modules/helpers:135:16)
#35 131.7         at requireNative (/go/src/code.gitea.io/gitea/node_modules/.pnpm/@rspack+binding@1.5.3/node_modules/@rspack/binding/binding.js:274:18)
#35 131.7         at Object.<anonymous> (/go/src/code.gitea.io/gitea/node_modules/.pnpm/@rspack+binding@1.5.3/node_modules/@rspack/binding/binding.js:362:17) {
#35 131.7       code: 'MODULE_NOT_FOUND',
#35 131.7       requireStack: [
#35 131.7         '/go/src/code.gitea.io/gitea/node_modules/.pnpm/@rspack+binding@1.5.3/node_modules/@rspack/binding/binding.js'
#35 131.7       ]
#35 131.7     },
#35 131.7     Error: Cannot find module '@rspack/binding-linux-riscv64-musl'
#35 131.7     Require stack:
#35 131.7     - /go/src/code.gitea.io/gitea/node_modules/.pnpm/@rspack+binding@1.5.3/node_modules/@rspack/binding/binding.js
#35 131.7         at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15)
#35 131.7         at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
#35 131.7         at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
#35 131.7         at Function._load (node:internal/modules/cjs/loader:1211:37)
#35 131.7         at TracingChannel.traceSync (node:diagnostics_channel:322:14)
#35 131.7         at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
#35 131.7         at Module.require (node:internal/modules/cjs/loader:1487:12)
#35 131.7         at require (node:internal/modules/helpers:135:16)
#35 131.7         at requireNative (/go/src/code.gitea.io/gitea/node_modules/.pnpm/@rspack+binding@1.5.3/node_modules/@rspack/binding/binding.js:279:18)
#35 131.7         at Object.<anonymous> (/go/src/code.gitea.io/gitea/node_modules/.pnpm/@rspack+binding@1.5.3/node_modules/@rspack/binding/binding.js:362:17) {
#35 131.7       code: 'MODULE_NOT_FOUND',
#35 131.7       requireStack: [
#35 131.7         '/go/src/code.gitea.io/gitea/node_modules/.pnpm/@rspack+binding@1.5.3/node_modules/@rspack/binding/binding.js'
#35 131.7       ]

@lunny lunny modified the milestones: 1.26.0, 1.25.0 Sep 13, 2025
@silverwind
Copy link
Member Author

Yep, and it seems we are the first to hit this, I opened web-infra-dev/rspack#11656.

We should also ensure our PR pipeline does this RISC build.

@techknowlogick do we have any download stats on our docker image on how many RISC-V Users there actually are? I wonder if it's really worth to support this platform.

@silverwind silverwind deleted the rspack branch September 13, 2025 01:05
@wxiaoguang
Copy link
Contributor

related:

feat: add riscv64 support (#34199)

fix go version #34299

zjjhot added a commit to zjjhot/gitea that referenced this pull request Sep 13, 2025
* giteaofficial/main:
  Fix different behavior in status check pattern matching with double stars (go-gitea#35474)
  Replace webpack with rspack (go-gitea#35460)
  Don't store repo archives on `gitea dump` (go-gitea#35467)
  Fix SSH signing key path will be displayed in the pull request UI (go-gitea#35381)
  [skip ci] Updated translations via Crowdin
  Update image name in integration README (go-gitea#35465)
@silverwind
Copy link
Member Author

silverwind commented Sep 13, 2025

I guess we could make it use webpack on that specific platform. But tbh I'm tired of RISC-V issues, it's just not well-supported by anything.

@silverwind
Copy link
Member Author

silverwind commented Sep 13, 2025

fix go version #34299

I'd rather go back to 2-part version syntax in go.mod. OP's issue sounds like a go bug.

@lunny
Copy link
Member

lunny commented Sep 13, 2025

Maybe we can revert the change at the moment and wait that issue fixed from rspack. We just encountered 2 issues of RISC-V.

@silverwind
Copy link
Member Author

Sure, revert it if its blocking the release. I do expect rspack to eventually fix it.

silverwind added a commit to silverwind/gitea that referenced this pull request Sep 14, 2025
@silverwind
Copy link
Member Author

#35482

silverwind added a commit that referenced this pull request Sep 14, 2025
Partially revert #35460 until
rspack supports RISC-V
(web-infra-dev/rspack#11656).
silverwind added a commit to ChristopherHX/gitea that referenced this pull request Sep 16, 2025
* origin/main:
  Clean up npm dependencies (go-gitea#35484)
  Update eslint to v9 (go-gitea#35485)
  Revert the rspack change (go-gitea#35482)
  Replace gobwas/glob package (go-gitea#35478)
  Fix various typos in codebase (go-gitea#35480)
  Fix different behavior in status check pattern matching with double stars (go-gitea#35474)
  Replace webpack with rspack (go-gitea#35460)
  Don't store repo archives on `gitea dump` (go-gitea#35467)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/dependencies modifies/frontend modifies/internal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants