Skip to content

Fix regressions after rsbuild v2#6987

Open
jpggvilaca wants to merge 4 commits into
developfrom
jvilaca/chore-rsbuild-warnings
Open

Fix regressions after rsbuild v2#6987
jpggvilaca wants to merge 4 commits into
developfrom
jvilaca/chore-rsbuild-warnings

Conversation

@jpggvilaca

@jpggvilaca jpggvilaca commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • location.reload is not a function
  • opencv mocking warning

How to test

Checklist

  • The PR title and description are clear and descriptive
  • I have manually tested the changes
  • All changes are covered by automated tests
  • All related issues are linked to this PR (if applicable)
  • Documentation has been updated (if applicable)

Copilot AI review requested due to automatic review settings July 7, 2026 09:34
@jpggvilaca jpggvilaca added the Geti UI Issues related to Geti application frontend label Jul 7, 2026
@jpggvilaca jpggvilaca requested a review from a team as a code owner July 7, 2026 09:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the application/ui Rsbuild/Rspack configuration to address development-time regressions introduced after upgrading to rsbuild v2 (notably noisy OpenCV __dirname mock warnings, and async chunk naming issues that break web worker loading).

Changes:

  • Adjust Rspack node mocking for __dirname/__filename to avoid repeated build warnings while keeping equivalent browser runtime behavior.
  • Force deterministic chunk IDs in development to keep worker-related async chunk URLs consistent and prevent dev-server SPA fallback from serving index.html to importScripts.
  • Change dev-server Cache-Control header from immutable caching to no-cache to avoid stale chunk/HMR runtime URLs after rebuilds.

Comment thread application/ui/rsbuild.config.ts Outdated
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

⏱️ Backend import time — app.main

Accelerator Cumulative (s) Self (s)
cpu 4.717 0.003
cuda 4.596 0.003
xpu 4.461 0.003

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

📊 Test coverage report

Metric Coverage
Lines 59.8%
Functions 56.4%
Branches 51.1%
Statements 59.4%

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

🐳 Docker image sizes

Device Size
cpu 4002.9 MB (3.91 GB)
xpu 10791.5 MB (10.54 GB)
cuda 10198.1 MB (9.96 GB)

// browser opencv takes the non-Node code path, so the mock value
// is never used — switch to 'mock' to keep the (identical) runtime
// behavior without the noisy build warning.
node: { ...config.node, __dirname: 'mock', __filename: 'mock' },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we ignore the warnings from opencv? I think that might be safe because of:

// The vendored @geti/smart-tools OpenCV.js build (Emscripten-generated,
// cloned in by clone-geti-ui-packages and not ours to edit) contains
// __dirname/__filename in its Node-environment-detection boilerplate.
// It's dead code in a web build (guarded by an ENVIRONMENT_IS_NODE
// check) but Rspack still statically parses and warns on it. Scope
// the suppression to just this file so any future first-party/new
// dependency __dirname usage still surfaces a warning.
ignoreWarnings: [...(config.ignoreWarnings ?? []), { module: /smart-tools[\\/]src[\\/]opencv/ }]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Geti UI Issues related to Geti application frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants