npm / yuku-parser
yuku-parser
What changed in yuku-parser 0.2 to 0.28, from its official release notes, upgrade guides and advisories. Also covers yuku-analyzer, yuku-codegen. Sources checked 2026-11-24.
125 breaking1 security31 new APIs and options22 performance11 behavior and defaults90 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inityuku-parser 0.2811 changes
Breaking changes 5
The
ast.outOfMemoryAPI is gone.Code nested too deeply now reports a parse error instead of crashing the process.
Running out of memory now throws an error instead of aborting the process.
The Zig parser returns
error.OutOfMemoryinstead of panicking, so callers must handle the error fromparser.parse.Throws on a hand-built tree containing a node where the parser never puts one; place nodes where the parser expects them.
Performance 3
Parsing is faster on code with many operators, strings, and block comments.
Printing a file whose program and comments have not been read prints directly from its source without building the JavaScript tree, making parsing and printing faster.
Parsing TypeScript such as
a<a<a<no longer takes quadratic time.
Fixes and other changes 3
A parenthesized arrow body that cannot be arrow parameters no longer takes the conditional's
:as its return type, so the expression parses as TypeScript reads it.Handles long chains and deep nesting without a
RangeError; trees too deep to print are reported indiagnostics.A failed WebAssembly call no longer breaks subsequent parses.
yuku-parser 0.2710 changes
Breaking changes 3
Bundling into one file and running without node_modules now fails on the first parse; pass --conditions=module or keep yuku external.
Names in a type member's computed key, such as [a + b], now resolve as values.
Index signature parameters in exported types are no longer classified as Exported.
New APIs and options 1
CoreOptions.wasm now also accepts a function, which runs only where no addon loads.
Performance 2
Parsing deeply nested conditionals, arrows, and generics no longer takes exponential time.
Importing yuku on Node no longer loads WebAssembly when the addon runs, saving about 5 ms and 7 MB.
Behavior and default changes 1
Exporting a nested namespace exports its outer namespace; renaming the outer namespace preserves its export, while renaming the member is refused.
Fixes and other changes 3
Imports, catch variables, type parameters, and index signature parameters in ambient code are classified as Ambient.
A default-exported interface keeps its binding and is read as a type, allowing a definition from another file to find it.
Valid typed arrows inside a conditional now parse.
yuku-parser 0.2614 changes
Breaking changes 10
An escaped word in a class body is treated as a member name, not a modifier.
Strict TypeScript reports legacy octal numbers and escapes in types, as TypeScript does.
No longer counts names in a decorator as uses inside the function it decorates.
A comment built without a position prints before its node instead of being dropped.
parse takes analyze: true in place of semantic: true.
print runs Yuku's Zig printer; replace custom node types with standard nodes before printing.
Throws a TypeError naming the field when a node does not fit the AST.
The Printer type is removed because print runs Yuku's Zig printer.
The printers option is removed because print runs Yuku's Zig printer.
The Printers type is removed because print runs Yuku's Zig printer.
Behavior and default changes 1
Diagnostics read more like TypeScript's, with clearer module errors from Project and shorter help text.
Fixes and other changes 3
JSX parses after
newandextends;.tsxfiles report that parentheses are needed there, matching TypeScript.A JSX element with a mismatched closing tag remains in the AST alongside its error.
Rebuilds the semantic model for an edited program on the same node objects, allowing nodes added without a position to resolve.
yuku-parser 0.2510 changes
New APIs and options 1
Adds a utility that decodes character references in JSX text and attribute strings.
Performance 2
Parsing does 2 to 5% less work.
Semantic analysis does 1 to 3% less work.
Behavior and default changes 1
The pretty format keeps a parameter's decorators on its line.
Fixes and other changes 6
In Zig, ast.JSXText has its decoded value again.
JSXText.raw is optional in the types because built nodes have no raw source text.
Diagnostics cover the whole character they point at, avoiding split emoji, and trailing numeric separators are reported at the underscore.
Printing
(value?.prop)!.xparsed with preserveParens: false keeps the parentheses that end the optional chain.Printing preserves source text only while it still spells the node's value; edited values are printed, and built JSX text without raw source prints valid JSX.
In sloppy JavaScript, a function declared in a block also binds where a var of its name would, so later uses resolve to it and are renamed with it.
yuku-parser 0.2415 changes
Breaking changes 12
The
bbuilders replace thejsandtstemplates for building nodes.The b builders are removed; build nodes with js and ts, and build nested nodes from a template of their container.
bindingIdentifiers is removed; read binding.declarations instead.
clone is removed; copy a node with structuredClone instead.
langFromPath is removed; read file.lang instead.
nameOf is removed; read node.name instead.
The pattern API is removed; test nodes in a walk visitor with is guards instead.
A regular expression after an expression ending in an arrow function or yield parses; an arrow-function expression followed by + 1 is an error.
sourceTypeFromPath is removed; read file.sourceType instead.
Cloudflare Workers and Vercel Edge users must also install @yuku-toolchain/wasm.
On Cloudflare Workers and Vercel Edge, import the wasm module from @yuku-toolchain/wasm/yuku.wasm instead of yuku/yuku.wasm.
Import is, unwrap, and the identifier checks from yuku/utils as plain exports.
Performance 2
Installing yuku fetches only the addon for its platform, reducing the install size from about 7.5 MB to 2.4 MB.
Templates with holes build 3 to 7 times faster.
Behavior and default changes 1
Templates accept a string or number inside quotes and improve handling of yield, JSX closing tags, name types, comments, and nodes used twice.
yuku-parser 0.233 changes
Breaking changes 1
The wasm option of parse and new Project is replaced by core; pass core: new Core({ wasm: module }) instead.
New APIs and options 1
Core can include addons, allowing a dialect to run natively in Node.js, Bun, and Deno when its package ships those addons in its core.
Behavior and default changes 1
addAddons in build.zig builds addons for every platform.
yuku-parser 0.2250 changes
Breaking changes 41
Enum member names follow TypeScript: string and template-literal names resolve, numeric names are errors, and computed members start at their opening bracket.
Removed.
Removed; test binding.flags instead.
Removed; read exports from parse(source, { semantic: true }).
Removed; read imports from parse(source, { semantic: true }).
Accepts "all" and "none" instead of true and false.
Scoped or semantic traversers read ctx.scope.current in place of currentScope().
Scoped or semantic traversers use ctx.scope.get(id) in place of the removed scope accessors.
Removed; read export.name instead.
Scopes, bindings, references, imports, exports, and definitions use file in place of module; imports and exports use resolvedFile in place of resolvedModule.
Use with walk in place of the removed module.walk and module.findAll APIs.
Removed; use walk with a typed handler.
Use flags.intersects(Symbol.value_space), and likewise for types and namespaces, in place of flags.inValueSpace().
Removed; read import.kind instead.
Removed; use nameOf(unwrap(node.callee)) on a CallExpression.
Removed; use is.Wrapper instead.
Replaces isStrictBindOnlyReservedWord.
Identifier checks are now under lexical.
Replaces isStrictBindReservedWord, alongside lexical.isEvalOrArguments.
Removed because queries relink as needed.
Removed; use node.value instead.
Now accepts only true or false and also selects compact format, shortest quotes, and "some" comments; format, quotes, and comments can override these choices.
Module is now SourceFile, and module.ast is now file.program.
Returns a SourceFile instead of ParseResult; reading tokens without tokens: true throws.
Zig semantic types now come from parser.semantic; traverser.semantic and traverser.scoped no longer re-export them.
Replaces generate, uses PrintOptions and PrintResult, and accepts a SourceFile as well as a node.
Throws when given an option it does not know.
Replaces the print option.
Replaces Analyzer; use set, delete, and files in place of setFile, deleteFile, modules, and module(path).
Replaces AnalyzerOptions; SetFileOptions is likewise replaced by FileOptions.
Replaces module.lookup.
Set semantic: true to put scopes, bindings, references, imports, and exports on the SourceFile; reading the semantic model without it throws.
Removed; iterate semantic.symbols instead.
Replaces semantic.scope(id).
Removed; check tree.diagnostics.items.len instead.
Use Tree.init(allocator, "") in place of Tree.initEmpty(allocator).
Removed; filter file.references by binding === null instead.
Takes no state argument, returns nothing, and its context has no node or state; keep state in handler scope. It also accepts a list of visitors in one pass and is 43 to 48% faster.
Removed; collect nodes in one walk, await the work, then edit in a second walk.
Import everything from yuku; the yuku/analyzer, yuku/ast, yuku/codegen, and yuku/types entry points are removed.
Replaces tree.setIdentifierName.
New APIs and options 6
Renames a binding at its declaration and uses, preserves file exports, and returns reasons without changing code when a rename would change meaning.
Makes a deep copy of a node.
Returns the line and column for an offset.
Builds nodes from code with values in its holes.
Matches nodes against code patterns with holes and returns what each hole captured.
Set sourceMap: true to add a source map with the default print options.
Performance 1
Node.js, Bun, and Deno with --allow-ffi run Yuku natively on macOS, Linux, and Windows for x64 and arm64, parsing a whole project 27 to 34% faster with up to 35% less peak memory; everything else keeps running WebAssembly.
Fixes and other changes 2
Regular expressions with unknown, repeated, or conflicting flags keep their node and the code after it, and the error points at the flag.
Now preserves exact values for hexadecimal, octal, and binary literals above 2^64 and reads decimal literals of any length.
yuku-parser 0.2120 changes
Breaking changes 10
Early errors that need scopes, such as redeclarations, are reported only when semanticErrors is true, matching parse.
Zig removes ast.JSXText.value; decode raw with lexical.decodeJSXEntities instead.
The Zig parse option now takes .none, .collect, or .attach instead of .flat, .attached, or .both.
In a custom Zig traverser context, enter takes the node tag first.
In a custom Zig traverser context, exit takes the node tag first.
Zig semantic.analyze takes options and reports early errors only when .check is true.
Custom traverser contexts no longer use traverser.Layer; pass the visitor directly to traverser.walk with .whole_tree.
A custom traverser context passes its visitor directly to traverser.walk with a .whole_tree option, replacing traverser.Layer.
In Zig, tree.commentsOf returns an iterator of Comment.
AttachedComment is no longer exported; use Comment, which also has start and end, for the same comment objects held in a node's comments.
New APIs and options 4
Zig parser.lexical provides the lexer's rules for identifiers, keywords, line breaks, and escapes, including isEvalOrArguments.
Finds a member of a namespace or enum across its merged bodies in Zig.
Adds a node's comments in Zig.
Moves a node's comments in Zig.
Performance 2
analyze is 17 to 21% faster on large files, or 12 to 16% faster with semanticErrors.
Zig semantic analysis is 14 to 20% faster.
Behavior and default changes 1
Identifier checks in yuku/ast follow the parser's Unicode version on every runtime instead of the runtime's own version.
Fixes and other changes 3
A decorator with type arguments now parses before export, as in @dec<T> export class A {}.
(): (void) => {} reads (void) as the return type, and type F = (this) => void parses as a function type.
Identifiers that escape $ or _, such as $a, now parse.
yuku-parser 0.2029 changes
Breaking changes 11
yuku/types no longer exports Core.
The semantic traverser's Ctx.init now takes a mode.
Ctx.parentOf is removed.
The Zig build option -Dparser-extension is replaced by -Ddialect.
Node.js 16.4 or newer is required.
SymbolTracker.init now takes a mode.
Browsers need WebAssembly SIMD, such as Safari 16.4 or newer.
Yuku now ships as one package; install yuku and import from yuku, yuku/analyzer, yuku/ast, yuku/codegen, and yuku/types.
The yuku-core package is removed because everything runs on the WebAssembly module inside yuku.
The @yuku-core/binding-* native packages are removed because everything runs on the WebAssembly module inside yuku.
The @yuku-core/wasm package is removed because everything runs on the WebAssembly module inside yuku.
New APIs and options 2
Dialects let you add custom syntax to the parser in Zig, match it to files by extension, and pass it to parse and analyze through the wasm option.
The wasm option lets parse and analyze receive dialects.
Performance 4
generate is 12 to 17% faster with a source map, and 7 to 13% faster without one.
Parsing is 13 to 22% faster.
Repeated calls reuse memory, making batches that mix large and small files much faster.
semanticErrors is 29 to 49% cheaper because it skips the full semantic model.
Behavior and default changes 2
unwrap from yuku/ast accepts any node, null, or undefined, and returns anything it does not unwrap as it is.
Yuku runs unchanged in Node.js, Bun, Deno, browsers, and Workers, with no setup before the first parse.
Fixes and other changes 10
Parsing works on big-endian hosts such as s390x.
Yuku runs in Vercel's Edge Runtime, which loads it through the edge-light condition.
A for (init;;) head parses in correctly inside parentheses, literals, templates, functions, and classes.
generate keeps the braces in import type {} from "m", which previously printed as invalid import type "m".
generate keeps parentheses around a ++ or -- operand followed by a comment that breaks the line.
JSX text after a closing fragment parses, so
<p><>a</> — b</p>works.module.imports lists export {} from "m" as a side-effect import, and import() or require() of a parenthesized string or a template literal without substitutions.
Source maps map a JSX attribute's string value, and a string key that minifying prints as a name, to its own column.
super() in a computed key of a class inside a derived constructor no longer reports an error.
TypeScript overloads of a private method no longer report a duplicate private name.
yuku-parser 0.193 changes
Breaking changes 1
Using Yuku as a Zig package now requires Zig 0.17.0 or later, so upgrade Zig before updating.
Security 1
Parsing an empty source now works correctly in runtimes like WebContainers, where leftover bytes could be read as input.
Behavior and default changes 1
generate prints any single node, such as an object property, rather than only a whole Program.
yuku-parser 0.1819 changes
Breaking changes 5
Core.analyze now takes a string; decode UTF-8 bytes before passing them.
Core.parse now takes a string; decode UTF-8 bytes before passing them. parse still accepts bytes.
The parser rejects decorators on both sides of export.
The parser reports duplicate exports and redeclarations as TypeScript does.
The parser rejects import and export in scripts and below the top level.
New APIs and options 1
Trees of any depth can now be decoded and walked.
Behavior and default changes 1
The parser now attaches comments at any depth.
Fixes and other changes 12
Code generation prints every attached comment.
Code generation strips an uninitialized const as ambient.
Code generation reprints a hashbang verbatim.
The parser joins a surrogate pair in a string regardless of how it is written.
The parser spans a type predicate's type without including its stripped parentheses.
The analyzer marks members of a declare enum as ambient.
The analyzer merges declare module augmentations into the augmented module.
Code generation keeps decorators before export.
The findAll parameter type is corrected.
The analyzer resolves ns in the namespace space for import x = ns.T.
The parser decodes entities in JSX text and attribute values.
Pattern unions have corrected types.
yuku-parser 0.176 changes
Breaking changes 5
Load the WebAssembly core and pass it as core to parse, analyze, or new Analyzer.
The init() API is removed; load() or loadSync() from @yuku-core/wasm can load the WebAssembly core.
Installing @yuku-core/wasm no longer switches the packages to it, and platforms without a native build no longer fall back to it; pass it in as core instead.
The WebAssembly package is renamed from @yuku-engine/wasm to @yuku-core/wasm.
The engine package is renamed from yuku-engine to yuku-core.
Performance 1
The WebAssembly core is built for speed.
yuku-parser 0.1522 changes
Breaking changes 15
Replaces Symbol in the analyzer API.
Replaces analyzer.definitionOf.
Replaces analyzer.referencesOf.
Replaces the .symbol property in the analyzer API.
Replaces SymbolFlags in the analyzer API.
Replaces symbolOf in the analyzer API.
Replaces symbols in the analyzer API.
Replaces removeFile in the analyzer API.
Kind predicates are removed except imp.isNamespace; compare kind instead.
An unknown lang now throws a TypeError.
Replaces module.resolve(name, scope, space) with module.lookup(name, { from, space }).
Link diagnostics use the shared diagnostic shape, with path in place of module.
A resolver returns false for a module outside the project; null means unresolved.
Replaces addFile in the analyzer API.
An unknown sourceType now throws a TypeError.
New APIs and options 5
Adds module.ancestors.
Adds module.isCurrent.
Adds module.nodeAt.
Adds module.resolveExport.
Adds a path option to parse.
Fixes and other changes 2
Names, merges, and exports resolve as tsc does.
The analyzer probes module paths in TypeScript's order.
yuku-parser 0.145 changes
Breaking changes 1
Codegen now prints code in JavaScript.
Fixes and other changes 4
The parser accepts async function expressions after new and extends.
The parser allows duplicate simple parameters in sloppy async and generator functions.
Each switch case statement starts on its own line in generated code.
The parser accepts legal line breaks in TypeScript declarations.
yuku-parser 0.133 changes
Performance 1
Speeds up the lexer and code generator.
Fixes and other changes 2
Closes code generation, source map, and semantic gaps.
Closes cover grammar gaps in patterns and async arrow heads.
yuku-parser 0.125 changes
Fixes and other changes 5
Annotation comments with leading whitespace are kept.
JSX closing tags are matched across whitespace and comments.
JSX components named with _, $, or non-ASCII characters are referenced.
Lists longer than 65535 items are no longer truncated.
Uint8Array sources are decoded before text is read from them.
yuku-parser 0.112 changes
Breaking changes 1
Deprecated walking and codegen entry points were removed.
Fixes and other changes 1
Codegen now keeps the trailing comma on an arrow's lone type parameter.
yuku-parser 0.103 changes
New APIs and options 1
Adds token support to the parser.
Performance 1
Comment and string scanning is vectorized.
Fixes and other changes 1
The parser no longer repeats a rejected TypeScript speculation.
yuku-parser 0.911 changes
Breaking changes 1
Rejects initialized for-in and for-of heads at parse time.
New APIs and options 1
Adds minimal compile-time extension points for authors extending the parser.
Behavior and default changes 1
The playground now shows comments.
Fixes and other changes 8
The playground now allows typing over auto-closed brackets and quotes.
Lexical error spans now point at the byte at the cursor.
Declared the import predicates in the types, so developers can use their type information.
Declared kind in the types, so developers can use its type information.
Declared moduleFlags in the types, so developers can use its type information.
Keeps decorators on rest parameters during parsing.
The analyzer now binds lowercase JSX member roots.
The parser now reports TypeScript grammar errors.
yuku-parser 0.89 changes
Breaking changes 1
The parser option allowReturnOutsideFunction is removed.
New APIs and options 3
Exposes isWrapper for developers to use.
Adds bindings for Android arm64, enabling developers to use yuku-parser on that platform.
The parser accepts sourceType: "commonjs".
Fixes and other changes 5
The parser now matches TypeScript in function and constructor type positions.
The parser now parses function types in infer constraints and parenthesized positions.
A JSX tag's > is scanned as a single token.
Reports a lexical error hit during lookahead.
The parser now accepts escape sequences in a TypeScript template literal type head.
yuku-parser 0.76 changes
Breaking changes 1
The codegen API is redesigned around a single composable generate API.
New APIs and options 3
The playground semantics view adds bidirectional symbol navigation.
Adds a semantics view to the playground.
Adds the @yuku-analyzer/wasm package.
Performance 1
The parse pipeline is faster across the FFI boundary.
Fixes and other changes 1
Passes pre-encoded source bytes through to the wasm bindings.
yuku-parser 0.614 changes
Breaking changes 1
Reference resolution is now space-aware, changing how semantic references are resolved.
New APIs and options 1
Adds async walk support to the parser.
Performance 1
npm binaries are smaller by up to 91%.
Fixes and other changes 11
Fixes parsing in let-as-identifier contexts.
Allows the options argument in phased dynamic imports.
Fixes parsing involving reserved type names.
Fixes parsing involving U+0085 whitespace.
The parser handles a line terminator between a class and its key.
A dts file is treated as an ambient context throughout.
The parser allows a line terminator before an enum declaration name.
Module declaration spans now include import attributes.
A non-null assertion is bound into the new-expression callee chain.
Ambient contexts now allow a trailing comma after a rest parameter.
Type-predicate references are recorded only for declared parameters.
yuku-parser 0.59 changes
New APIs and options 1
The parser supports parsing TypeScript.
Performance 1
Punctuation and identifier scanning is faster, which may improve parsing performance.
Fixes and other changes 7
The parser traverses AST children in source order.
NumericLiteral value is now Infinity rather than null when the numeric value is Infinity.
The parser keeps arrow return types in ternary consequents.
Allows assert with a newline.
Allows decorators before an abstract class.
Aligns the linebreak after export default async with ESTree.
Fixes multiline indentation in generated JSDoc.
yuku-parser 0.21 changes
Fixes and other changes 1
Fixes directives parsing.