Skip to content

Releases: adams85/acornima

v1.1.0

22 Jun 16:23
Compare
Choose a tag to compare

New features:

  • Expose variable scope information tracked by the parser to consumers via the ParserOptions.OnNode callback.

Improvements:

  • Allow consumers to provide an OnNode callback even when enabling ParserOptionsExtensions.RecordParentNodeInUserData.
  • Add a virtual protected Reset method to AstVisitor which can be used by inheritors to reset recursion depth tracking if they want to make the visitor instance reusable even if visitation is interrupted by an exception.
  • Deprecate NodeList.Create and add From instead for consistency.
  • Increase the max. possible recursion depth of expression parsing by about 10%.
  • Minor performance improvements.

FileParsingBenchmark, .NET 8, x64:

Diff Method FileName Mean Error Allocated
Old AcornimaParse bundle 332.005 ms 4.1200 ms 75.53 MB
New 330.062 ms (-1%) 4.6807 ms 75.52 MB (0%)
Old AcornimaParse jquery-1.9.1 8.189 ms 0.0827 ms 3.19 MB
New 8.112 ms (-1%) 0.0799 ms 3.19 MB (0%)
Old AcornimaParse yui-3.12.0 6.411 ms 0.0080 ms 2.55 MB
New 6.312 ms (-2%) 0.0152 ms 2.55 MB (0%)

Bug fixes:

  • Fix null reference issue occurring when converting a standalone CatchClause node to JS code.

Breaking changes:

  • Add a new parameter (context) to the ParserOptions.OnNode callback (more precisely, to the OnNodeHandler delegate).
  • Add a new property (Node) to the INode interface, which can be used to access the underlying Node instance 3-4x faster than via type casting.

v1.0.0

07 Apr 23:28
Compare
Choose a tag to compare

New features:

  • Support for parsing and generating JSX. (See the JsxParser class and ToJsx extension methods, respectively).

Improvements:

  • Minor improvement to the AST and visitors.
  • Minor performance improvements.

Breaking changes:

  • Change the parameter order in the constructor of ObjectProperty (the method parameter comes last).
  • Remove the VisitProperty method from the visitors and introduce VisitAssignmentProperty and VisitObjectProperty instead.
  • Introduce the VisitFunctionBody method to the visitors. Visitation of function bodies are no longer dispatched to VisitBlockStatement.
  • Rename the ToJavaScriptString extension methods to ToJavaScript.
  • Rename the ToJsonString extension methods to ToJson.
  • Hide the constructors of RegExpValue and TemplateValue and provide factory methods (From) instead.

v0.9.3

03 Apr 01:49
Compare
Choose a tag to compare

Improvements:

  • Add RangeRef and LocationRef to INode as well.
  • Expose input parameters and options as public properties in Tokenizer and Parser.

Bug fixes:

  • Compile adapted regex patterns on .NET 7+ only if they don't contain negative lookaround assertions (see also dotnet/runtime#97455).

Breaking changes:

  • Rename IDestructuringElement to IDestructuringPatternElement

v0.9.2

31 Mar 02:38
Compare
Choose a tag to compare

Improvements:

  • Introduce ParserOptions.ExperimentalESFeatures to allow fine-tuning which experimental feature to enable.
  • Re-add BindingPattern to the AST under the name DestructuringPattern.
  • Prevent Literal.Value from re-boxing the return value on every call by caching it when necessary (i.e. in the case of NumericLiteral, BigIntLiteral).
  • Allow accessing Node.Range and Node.Location as readonly references (see Node.RangeRef and Node.LocationRef, respectively).
  • Provide an error code in ParseError (as it's not reliable to check error messages because those are localizable).

Breaking changes:

  • Remove EcmaVersion.Experimental.
  • Rename IVarScope to IHoistingScope.
  • Rename IDestructuringPattern to IDestructuringElement.

v0.9.1

29 Mar 08:39
Compare
Choose a tag to compare

Improvements:

  • Add option to allow new.target meta-properties outside functions (ParserOptions.AllowNewTargetOutsideFunction).
  • Improve performance of for-await-of loop parsing.
  • Improve error reporting regarding for loops.

Breaking changes:

  • Change the type of CatchClause.Body, TryStatement.Block and TryStatement.Finalizer to NestedBlockStatement (which is sealed).

v0.9.0

26 Mar 22:20
Compare
Choose a tag to compare

Initial release with complete support for ES2023 parsing (including some experimental features like decorators and import attributes). 🎉

It's not v1.0.0 mostly because JSX is still missing. Also, even though the public API should be pretty stable now, there might be minor changes to it before v1.0.0.