Fix @solidjs/signals resolution and add auto-import completions for Solid 2 - #197
Open
brenelz wants to merge 3 commits into
Open
Fix @solidjs/signals resolution and add auto-import completions for Solid 2#197brenelz wants to merge 3 commits into
brenelz wants to merge 3 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@solidjs/signalsin the import map (fixes a runtime crash). The Solid 2 babel preset injectsimport ... 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 withFailed to resolve module specifier "@solidjs/signals". Adding it toEXTERNALIZEDgives 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.createProjection) now suggests it and inserts theimportstatement on accept. Since@codemirror/lsp-clientnever sendscompletionItem/resolveand only appliesadditionalTextEditspresent 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), withisIncomplete: trueso the client re-queries as the word grows. Entries sourced from@solidjs/signalsre-exports andsolid-js/types/internals are skipped to avoid duplicates.Test plan
import_map.jsongains a pinned@solidjs/signalsentry after the first compile.createProjin an editor tab:createProjectionshould be suggested and accepting it should addimport { createProjection } from "solid-js"(merged into an existing solid-js import when present).🤖 Generated with Claude Code