chore(build): ship only the DTLN files that can load (-9 MB) (#210) #470

Merged
jared merged 1 commits from chore/build-hygiene into lotus 2026-10-25 22:48:05 -04:00
Owner

Part of #210 (build hygiene). Closes #210 together with #468.

Problem: the DTLN noise-suppression package (@workadventure/noise-suppression) was copied whole into every build, 57 MB. Two kinds of file in it are never used:

  • The threaded LiteRT build (8.5 MB wasm plus loaders). The library only picks it on a cross-origin-isolated page, and our fork passes no threads option. Neither the web call page nor the desktop one sends COOP/COEP (checked on chat.lotusguild.org and in cinny-desktop), so it can never load.
  • Source maps and .d.ts files, which aren't needed at runtime.

Change: the build copy leaves those out, saving 57 → 48 MB per web deploy and per desktop installer. A comment says to drop the exclusion if the call page ever turns on COOP/COEP.

Verified on the built output, in a page that isn't cross-origin isolated (as in production):

  • the DTLN worklet loads from denoise/workadventure/ and reaches ready;
  • the library's benchmark runs 300 frames (10.7 ms mean per 32 ms block);
  • no 404s.

The rest of #210, checked

  • The lotusDenoise copy cost: about 0.5 s against a multi-minute build. Not worth restructuring.
  • The viteStaticCopy renames: not redundant. vite-plugin-static-copy v4 keeps source paths under dest, so each stripBase is needed (the config comments explain why).
  • The as any casts: handled in #468. The ones left are documented boundary casts.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Part of #210 (build hygiene). Closes #210 together with #468. **Problem:** the DTLN noise-suppression package (`@workadventure/noise-suppression`) was copied whole into every build, 57 MB. Two kinds of file in it are never used: - **The threaded LiteRT build** (8.5 MB wasm plus loaders). The library only picks it on a cross-origin-isolated page, and our fork passes no `threads` option. Neither the web call page nor the desktop one sends COOP/COEP (checked on chat.lotusguild.org and in cinny-desktop), so it can never load. - **Source maps and `.d.ts` files**, which aren't needed at runtime. **Change:** the build copy leaves those out, saving **57 → 48 MB** per web deploy and per desktop installer. A comment says to drop the exclusion if the call page ever turns on COOP/COEP. **Verified** on the built output, in a page that isn't cross-origin isolated (as in production): - the DTLN worklet loads from `denoise/workadventure/` and reaches `ready`; - the library's benchmark runs 300 frames (10.7 ms mean per 32 ms block); - no 404s. **The rest of #210, checked** - **The `lotusDenoise` copy cost:** about 0.5 s against a multi-minute build. Not worth restructuring. - **The `viteStaticCopy` renames:** not redundant. vite-plugin-static-copy v4 keeps source paths under `dest`, so each `stripBase` is needed (the config comments explain why). - **The `as any` casts:** handled in #468. The ones left are documented boundary casts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-25 20:17:42 -04:00
chore(build): ship only the DTLN files that can load (-9 MB) (#210)
CI / Build & Quality Checks (push) Skipped
CI / Secret scan (gitleaks) (push) Skipped
CI / Playwright smoke (e2e) (push) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 24s
CI / Build & Quality Checks (pull_request) Successful in 3m2s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Playwright smoke (e2e) (pull_request) Successful in 30m35s
d5b0b40b17
The DTLN noise-suppression package was copied whole into every build
(57 MB). Its threaded LiteRT build is only used on a cross-origin-isolated
page, and neither the web nor the desktop call page is (no COOP/COEP), so
its ~9 MB could never load; source maps and .d.ts files aren't needed at
runtime either. Leave those out: 57 -> 48 MB per web deploy and desktop
installer. Verified on the built output, not isolated: the DTLN worklet
reaches ready and runs a 300-frame benchmark, no 404s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared scheduled this pull request to auto merge when all checks succeed 2026-10-25 20:17:55 -04:00
jared merged commit 71b7619082 into lotus 2026-10-25 22:48:05 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#470