Repository navigation
fix(sourcemaps): split web into eager chunks under the map cap, skip maps with no sources - #3031
Confidence 8/10 · 1 issue to address
🟢 Confidence 8/10 · likely safe to merge. The uploader skip is pinned by a test and matches the server's rule; the bundle-layout change and the CLI copy of the rule are only covered by hand.
1 warning −1 · tests partial −1 · risk medium
Eager chunk splitting keeps every apps/web source map under the 10 MiB cap, and the deploy uploader now skips maps with no sources instead of failing on the server's 400. The uploader change is tested; the new bundle layout is verified by hand only.
- Web build splits into eager
vendor/kit/appchunks capped at 2.5 MB strictExecutionOrderkeeps module init order across the new chunksSourceMapsskips a map with nomappingsstring or no sourcesmapsNoSourcesexported from@maple/sourcemapsfor callers to share
Before merge
- Manual · Watch the next prd deploy log for
Uploaded N source map(s)andmaple.stack.statusonStackSymbolicator.symbolicatespans
Findings
🟠 Warning · F1 · New no-sources skip missing from maple sourcemaps upload
maintainability · packages/sourcemaps/src/inject.ts:170-178
The upload rule now exists in two copies and only this PR's copy learned it. apps/cli/src/core/sourcemaps-upload.ts:174 still checks just isIndexMap, so the CLI keeps posting the elk worker's source-less map, the server's 400 becomes SourceMapUploadError, and the command exits ${n} source map upload(s) failed (apps/cli/src/commands/sourcemaps.ts:129).
Import `mapsNoSources` in `apps/cli/src/core/sourcemaps-upload.ts` and return a `skipped` outcome with the same reason beside its `isIndexMap` check, with a test case for a `sources: []` map.
What was checked
mapsNoSourcesmirrors the server'sisRegularMap(source-map-files.ts:100): mappings string, non-empty sources- The added fixture at
source-maps.test.ts:189pins the skip:uploadedwould be 2 without it - Vite group regexes match module ids by path; nothing in the repo pins chunk names (
/assets/hits are fixtures)
352d7ca · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Annotations
Check warning on line 178 in packages/sourcemaps/src/inject.ts
maple-review-bot / Maple / review
maintainability: New no-sources skip missing from `maple sourcemaps upload`
The upload rule now exists in two copies and only this PR's copy learned it. `apps/cli/src/core/sourcemaps-upload.ts:174` still checks just `isIndexMap`, so the CLI keeps posting the elk worker's source-less map, the server's 400 becomes `SourceMapUploadError`, and the command exits `${n} source map upload(s) failed` (`apps/cli/src/commands/sourcemaps.ts:129`).