Open
Conversation
161c965 to
58829e0
Compare
satyakigh
reviewed
Jan 29, 2026
…ests - Fix webpack.config.js: [name][ext] -> [name].[ext] - Replace shouldForceWasm() with const isLegacyLinux using BUILD_TARGET - Add native fallback when WASM initialization fails - Add test:wasm script and CI step for WASM e2e tests - Update unit tests for new env var
- Export parserFactoryReady promise and await it in server onInitialize - Fix GrammarManager to resolve WASM files from node_modules in unbundled env - Await parserFactoryReady in TestExtension for e2e tests - Confirmed via test: WASM path now returns ParserAdapter, not native Parser
web-tree-sitter creates new JS wrapper objects for each node access, so reference equality (===) fails even for the same underlying node. Use node.id comparison instead, which works for both native and WASM. Fixes 3 JSON e2e test failures when using WASM parser.
2170444 to
a1ae3ce
Compare
Standalone ParserType module avoids circular dependency with LoggerFactory. Every SyntaxTree @measure now emits parser.type=native|wasm so metrics can be filtered/grouped by parser implementation in CloudWatch.
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.
Issue #, if available:
Description of changes:
Changes:
ParserFactorydetects legacy Linux viaBUILD_TARGET=legacy(set at build time in webpack) and uses WASM tree-sitter instead of native bindingsWasmParserFactoryprovides WASM-based parsing with automatic fallback to native if WASM initialization failsNativeParserFactorytries native bindings first, falls back to WASM if they fail to loadGrammarManagerhandles WASM grammar loading with retry logic and caching; resolves grammar paths fromnode_modulesin unbundled environmentsparserFactoryReadypromise exported and awaited in serveronInitializeto ensure WASM is fully initialized before use.wasmfiles as assets===) to usenode.idcomparison for WASM compatibility (web-tree-sitter creates new JS wrapper objects per access)Performance (e2e/integration tests, cold cache, WASM confirmed via ParserAdapter):
No measurable performance difference between native and WASM parsers.
Testing:
test:wasmnpm script and CI step to run e2e tests withBUILD_TARGET=legacyParserAdapterconstructor confirmed in WASM pathBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.