Skip to content

feat: Add lazy default package resolution.#13

Merged
dylan-sutton-chavez merged 2 commits into
mainfrom
feat/lazy-default-packages
May 26, 2026
Merged

feat: Add lazy default package resolution.#13
dylan-sutton-chavez merged 2 commits into
mainfrom
feat/lazy-default-packages

Conversation

@dylan-sutton-chavez
Copy link
Copy Markdown
Owner

No description provided.

@dylan-sutton-chavez
Copy link
Copy Markdown
Owner Author

dylan-sutton-chavez commented May 26, 2026

  • Re-point the test at the CDN once the new wasm ships. The route currently serves a local compiler_lib.wasm because the published one is missing extract_imports. Temporary scaffold, delete the branch when the CDN catches up.

I reverted to the main branch in the last commit before this pull request; I'm still using a CDN for all pushes. I'm going to temporarily decouple the necessary tests.

  • Version-gate the ABI bump. New runtime + old CDN wasm throws extract_imports missing on every run. Either expose an abi_version export and check it at load, or fall back to the old quoted-only scanner so old wasm degrades instead of breaking.

Doesn't matter, just std and host packages.

  • pendingBare drops importers. It's Map<name, dir>, so a second importer of the same unresolved name overwrites
    the first and relative targets resolve against the wrong dir. Make it Map<name, dir[]>.

Fixed using Map<name, dir[]>

  • No test for defaults: false. We prove defaults work and are lazy, but nothing proves the opt-out actually opts out. Add a run with defaults: false that imports json and expects a resolution error.

n/A

  • engine.js imports DEFAULT_IMPORTS directly. The doc says defaults are a browser-runtime convenience, not a worker concern, but the worker reaches into defaults.js. Pass them in via load opts so the engine stays embedder-neutral.

Merging DEFAULT_IMPORTS in the index.js side to decouple the compiler from the runtime

@dylan-sutton-chavez dylan-sutton-chavez merged commit 398a687 into main May 26, 2026
5 of 7 checks passed
@dylan-sutton-chavez dylan-sutton-chavez deleted the feat/lazy-default-packages branch May 26, 2026 12:24
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.

1 participant