Skip to content

Releases: ctrl-escp/flast

v3.0.0

23 Mar 10:54

Choose a tag to compare

flAST 3.0.0

This release expands the core analysis model in flAST, improves editor ergonomics, and makes tree transforms easier to read and reason about.

Added

  • Added bundled declaration files to improve IDE integrations, including autocomplete, inline hints, and easier API discovery.
  • Added ancestry metadata to parsed nodes, using node IDs to record the chain of parent nodes for structural traversal.
  • Expanded the typeMap API to include typeList, a record of all node types found in the parsed script.
  • Added Arborist.replaceNode() and Arborist.deleteNode() as syntactic sugar that wrap markNode() for better readability at the call site.
  • Added new examples covering quickstart usage, iterative transforms, structure detection, identifier discovery, tree transforms, and code statistics.

Improved

  • Improved node metadata by clearly separating ancestry and lineage:
    • ancestry tracks parent relationships by node ID.
    • lineage tracks scope relationships by scope ID.
  • Improved identifier-to-declaration mapping so references resolve more reliably in nested and shadowed scopes.
  • Improved traversal stability and parent/child relationship handling, including better behavior for sparse arrays and large flat scripts.
  • Improved Arborist comment handling so replacements and deletions preserve comments more consistently, including root replacements and sibling replacements in arrays.
  • Improved logger forwarding so custom log functions can receive multiple arguments.
  • Refined parsing and tree-editing internals for more predictable analysis and transform behavior.

Deprecated / Removed

  • Removed the deprecated treeModifier utility from the public exports.
  • Removed the runtime types.js export in favor of editor-facing declaration files.
  • Continued the move toward direct typeMap-based targeting and explicit Arborist edits instead of legacy full-tree modifier patterns.

Documentation

  • Expanded the documentation with a fuller README, API reference, quickstart guide, recipes, and a dedicated structure-detection guide.
  • Added more practical examples and usage guidance to make common analysis and transform workflows easier to pick up.

Upgrade Notes

  • If you still use treeModifier, migrate to direct node selection via arb.ast[0].typeMap and apply edits through Arborist.
  • If you imported runtime types from types.js, that export is no longer available in 3.0.0.