Remove JS fallback shim package#135
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Previous Issues Resolved
Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit 5d67465)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 5d67465)Status: No Issues Found | Recommendation: Merge Previous Issues Resolved
Files Reviewed (2 files)
Previous review (commit cefa0c7)Status: No Issues Found | Recommendation: Merge Files Reviewed (49 files)
Reviewed by kimi-k2.6-20260420 · Input: 36K · Output: 5.5K · Cached: 141.8K |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (49 files)
|
There was a problem hiding this comment.
Pull request overview
Removes the standalone @lzehrung/codegraph-js-fallback workspace/publish path and renames internal “fallback shim” concepts to a native-first “parser backend unavailable” contract, aligning release tooling and docs with root+native-only publishing.
Changes:
- Deletes the
packages/codegraph-js-fallbackworkspace package and removes it from release planning/publishing (scripts, workflow, tests). - Replaces the internal JS fallback shim module with a
parserBackendunavailable-stub, updating language/indexer types and native-only/reduced-mode tests accordingly. - Reworks reduced-mode import recovery to use a JS/TS text-based extractor (
jsTextImports) instead of “jsFallback” terminology.
Reviewed changes
Copilot reviewed 46 out of 49 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/release-script.test.ts | Updates release helper expectations for root+native-only publishing and selector validation. |
| tests/patch-tree-sitter-node24.test.ts | Removes tests for the Node 24 tree-sitter patcher. |
| tests/parser-backend-unavailable.test.ts | Adds contract test asserting the non-native parser backend always reports unavailable. |
| tests/package-metadata.test.ts | Removes shim-package metadata assertions and adds “package is absent” checks; updates workflow assertions. |
| tests/native-tree-sitter.test.ts | Renames JS fallback integration gating to non-native parser backend gating. |
| tests/native-runtime-mode.test.ts | Updates reduced-mode gating checks from isJsFallbackAvailable to isNonNativeParserAvailable. |
| tests/native-query-scope.test.ts | Updates mocks/spies and test wording from JS fallback to non-native parser backend. |
| tests/native-parser-ownership.test.ts | Updates mocks/spies/helpers to validate native ownership without any non-native parser backend. |
| tests/native-parse-tree.test.ts | Renames JS fallback tree-walker references to non-native parser backend equivalents. |
| tests/languages/sql.test.ts | Updates reduced-mode SQL expectations/mocks to remove js-fallback wording and package install guidance. |
| tests/js-fallback-loader.test.ts | Removes the old JS fallback shim loader contract test. |
| tests/helpers/native.ts | Renames helper spies/assertions to parserBackend terminology and updates messages. |
| tests/esm-language-loading.test.ts | Updates ESM contract test to use parserBackend unavailable exports. |
| tests/detailed-symbol-native-only.test.ts | Updates native-only tests to mock/validate behavior without non-native parser backend. |
| src/parserBackend.ts | Introduces the new “non-native parser backend unavailable” stub module and structural types. |
| src/languages/types.ts | Replaces JsLanguage/JsSyntaxNode aliases with ParserLanguage/ParserSyntaxNode. |
| src/languages/filePrep.ts | Updates parser input typing to use ParserLanguage. |
| src/languages/definitions/loadLanguage.ts | Switches language loader re-exports from jsFallback to parserBackend. |
| src/languages.ts | Updates language typing and languageForFile() return type to ParserLanguage. |
| src/jsFallback.ts | Removes the old internal JS fallback shim module. |
| src/indexer/types.ts | Removes js-fallback from ResolutionProvenance.backend union. |
| src/indexer/scope.ts | Updates scope builder typing to use ParserLanguage. |
| src/indexer/parse-context.ts | Updates parse context typing to use ParserLanguage. |
| src/indexer/navigation-references.ts | Updates navigation typing to use ParserLanguage. |
| src/indexer/navigation-provenance.ts | Maps nativeMode: off provenance backend to graph-only (previously js-fallback). |
| src/indexer/navigation-local.ts | Updates navigation local typing to use ParserLanguage. |
| src/indexer/locals-and-exports.ts | Updates locals/exports typing to use ParserLanguage. |
| src/indexer/imports/nativeCaptures.ts | Updates tree type references to ParserSyntaxTree. |
| src/indexer/imports/jsTextImports.ts | Adds the new JS/TS text-based import extraction implementation for reduced mode. |
| src/indexer/imports.ts | Wires reduced-mode import fallback to jsTextImports instead of the old js-fallback module. |
| src/indexer/build-index.ts | Updates unavailable-parser error handling and parser-tree type checks to parserBackend. |
| src/indexer.ts | Updates exported API typing from JsLanguage/JsSyntaxTree to parser-backend equivalents. |
| src/graph-edge-collector.ts | Updates parser language typing to ParserLanguage. |
| scripts/release.mjs | Removes js-fallback manifest normalization, tagging, staging, and publish steps. |
| scripts/release-lib.mjs | Removes js-fallback from releasePackages and publish execution step planning. |
| scripts/patch-tree-sitter-node24.mjs | Removes the Node 24 tree-sitter patch script. |
| scripts/patch-tree-sitter-node24-lib.mjs | Removes the Node 24 tree-sitter patch library. |
| README.md | Removes references to the js-fallback shim package; clarifies reduced-mode behavior. |
| PUBLISHING.md | Updates publishing model to only root+native and removes js-fallback steps/notes. |
| packages/codegraph-js-fallback/package.json | Deletes the workspace/package manifest for the removed shim package. |
| packages/codegraph-js-fallback/js-fallback.d.ts | Deletes the shim package type declarations. |
| packages/codegraph-js-fallback/js-fallback.cjs | Deletes the shim package CommonJS entrypoint. |
| package-lock.json | Removes workspace links for the deleted package and updates dependency lock state. |
| docs/scenario-catalog.md | Updates scenario catalog entry to reflect removal of the js-fallback package. |
| docs/plans/2026-06-06-performance-and-cache-opportunities.md | Updates plan language from JS fallback parity to reduced-mode parity. |
| docs/plans/2026-05-12-graph-first-language-expansion.md | Updates plan language to native-first + reduced-mode behavior; removes js-fallback workspace references. |
| docs/installation.md | Removes js-fallback package mention; clarifies reduced-mode behavior. |
| codegraph-skill/codegraph/SKILL.md | Removes js-fallback shim guidance from the skill definition. |
| .github/workflows/release.yml | Removes js-fallback publishing and release-notes lines; updates descriptions accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const NON_NATIVE_PARSER_UNAVAILABLE_MESSAGE = | ||
| "Non-native Tree-sitter parser is unavailable; native parser is the only grammar backend"; | ||
|
|
||
| function createUnavailableError(feature: string): Error { | ||
| return new Error(`${NON_NATIVE_PARSER_UNAVAILABLE_MESSAGE} for ${feature}`); | ||
| } | ||
|
|
||
| export function __resetParserBackendModuleForTests(): void { | ||
| // Kept for tests that reset parser backends between cases. | ||
| } | ||
|
|
||
| export function isNonNativeParserAvailable(): boolean { | ||
| return false; | ||
| } | ||
|
|
||
| export function isNonNativeParserUnavailableError(error: unknown): boolean { | ||
| return error instanceof Error && error.message.includes(NON_NATIVE_PARSER_UNAVAILABLE_MESSAGE); | ||
| } |
| async function pushTreeObjectPatternBindings( | ||
| context: ImportCaptureExtractionContext, | ||
| tree: JsSyntaxTree, | ||
| tree: ParserSyntaxTree, | ||
| patterns: NativeCapture[], |
|
Addressed review comments in 5d67465:
Verification:
|
| async function parseWithJsTreeSitter(file: string) { | ||
| const parsed = await parseFile(file); | ||
| const lang = languageForFile(file); | ||
| const tree = parseWithJsLanguage(parsed.source, lang); | ||
| const tree = parseWithLanguage(parsed.source, lang); | ||
| return { |
| const file = "scope.ts"; | ||
| const lang = languageForFile(file); | ||
| const jsTree = parseWithJsLanguage(source, lang); | ||
| const jsTree = parseWithLanguage(source, lang); |
|
Addressed the latest naming feedback in b43b6df:
Verification:
|
|
Updated coverage reports in d80b9c9. Verification:
Updated summaries:
|
Summary
Verification