Skip to content

Drop JSPM workarounds fixed by jspm/jspm#2745 - #157

Draft
DmitrySharabin wants to merge 1 commit into
mainfrom
drop-jspm-workarounds
Draft

DmitrySharabin wants to merge 1 commit into
mainfrom
drop-jspm-workarounds

Conversation

@DmitrySharabin

@DmitrySharabin DmitrySharabin commented Sep 8, 2026

Copy link
Copy Markdown
Member

Drops the workarounds fixed upstream by jspm/jspm#2745. Closes #156.

Warning

Do not merge yet. #2745 is merged but unreleased — latest @jspm/generator is 2.16.3 (2026-06-29); the fix landed 2026-08-17. Merge only together with a bump to 2.16.4+. On 2.16.3 this removal breaks colorjs.io, zod and idb.

Removed

.d.ts ignore filter (#122) — declarations now trace as dependency-free upstream.

Condition-shadowing logic in stripConditions (#126) — the generator now resolves strictly before speculating:

"./sub/*": { "deno": "./deno/*", "default": "./src/*" }

Before: enumerated deno/ filenames, resolved via defaultModule not found. Now: ./src/.

Still standing

types/typings stripping. #2745 still enumerates targets reachable only under unknown conditions — its own test asserts this — while resolvePackageTarget stays strict and refuses them.

Real packages with the shape: ts-pattern@5.9.0 and es-toolkit@1.52.0 — a ./types subpath with no runtime target:

"./types": { "import": { "types": "./dist/types/index.d.ts" } }

No './types' exports subpath defined. install() catches it and retries with subpaths: false, so we degrade rather than throw — on both packages the resulting map still came out complete, so the observable cost today is a wasted retry plus a spurious "Failed to trace subpaths" warning. Stripping keeps us off that fallback path entirely.

Reported upstream as jspm/jspm#2751 — fixing that retires stripConditions for good.

Verification

Built jspm main at 078ff06 from source; it passes the generator's own package.test.js. Against 17 packages plus fixtures: the .d.ts filter produces identical maps on/off, the shadowing logic is unnecessary, and the types stripping is what keeps subpaths: true working.

.map was dropped from the filter's regex deliberately — declaration maps trace as format=esm, deps=[] (JSON, no imports the lexer can see, including inside sourcesContent), and the only export shape that enumerates them condenses to a trailing-slash prefix.

Not verified: the demo import-map diff, which needs a @jspm/generator version that doesn't exist yet. Worth running before merge.

File +/− (substantive)
src/map.js +2 / −4
src/util/jspm-overrides.js +4 / −8
test/util/jspm-overrides.js +10 / −8

🤖 Generated with Claude Code

https://claude.ai/code/session_016oHRkng85emGDgo9x9Mxpm

Removes the .d.ts ignore filter (#122) and the condition-shadowing logic
in stripConditions (#126), both now handled by the generator itself.

types/typings stripping stays: #2745 enumerates targets reachable only
under unknown conditions, but the resolver still refuses them.

Requires @jspm/generator >= 2.16.4, which is not yet released. Ref #156.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016oHRkng85emGDgo9x9Mxpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorporate upstream JSPM fixes for #126

1 participant