Skip to content

Fix @solidjs/signals resolution and add auto-import completions for Solid 2 - #197

Open
brenelz wants to merge 3 commits into
solidjs:mainfrom
brenelz:fix/v2-signals-and-auto-imports
Open

Fix @solidjs/signals resolution and add auto-import completions for Solid 2#197
brenelz wants to merge 3 commits into
solidjs:mainfrom
brenelz:fix/v2-signals-and-auto-imports

Conversation

@brenelz

@brenelz brenelz commented Aug 12, 2026

Copy link
Copy Markdown

Summary

  • Externalize @solidjs/signals in the import map (fixes a runtime crash). The Solid 2 babel preset injects import ... from '@solidjs/signals' into compiled output after the compiler worker has collected externals, so the preview import map never gained an entry for it and the iframe failed with Failed to resolve module specifier "@solidjs/signals". Adding it to EXTERNALIZED gives it a pinned import-map entry, marks it external in the solid-js/@solidjs/web esm.sh URLs (one shared signals runtime instance), and pins its types to the solid-js version so type acquisition no longer relies on jsdelivr's flaky prerelease range resolution.
  • Auto-import completions in the TypeScript worker. Typing an unimported symbol (e.g. createProjection) now suggests it and inserts the import statement on accept. Since @codemirror/lsp-client never sends completionItem/resolve and only applies additionalTextEdits present in the initial list, import edits are computed inline for a bounded, prefix-matched set of module-export entries (2+ chars typed, capped at 20), with isIncomplete: true so the client re-queries as the word grows. Entries sourced from @solidjs/signals re-exports and solid-js/types/ internals are skipped to avoid duplicates.
  • Prevent the mobile header title from wrapping.

Test plan

  • Load a Solid 2 playground, confirm the preview renders without the module-specifier error and that import_map.json gains a pinned @solidjs/signals entry after the first compile.
  • Type createProj in an editor tab: createProjection should be suggested and accepting it should add import { createProjection } from "solid-js" (merged into an existing solid-js import when present).
  • Confirm Solid 1 playgrounds are unaffected (v1 paths are untouched).

🤖 Generated with Claude Code

brenelz and others added 3 commits August 12, 2026 08:20
The v2 preset injects @solidjs/signals imports into compiled output
after externals are collected, so the preview import map never gained
an entry for it and bare imports failed to resolve. Externalizing it
also pins its types to the solid-js version for type acquisition.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The codemirror lsp client never sends completionItem/resolve, so
import edits are attached inline for a bounded, prefix-matched set of
module-export entries, and the list is marked incomplete so the client
re-queries as the word grows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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