Releases: adams85/acornima
Releases · adams85/acornima
v1.1.0
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 enablingParserOptionsExtensions.RecordParentNodeInUserData
. - Add a virtual protected
Reset
method toAstVisitor
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 addFrom
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 theParserOptions.OnNode
callback (more precisely, to theOnNodeHandler
delegate). - Add a new property (
Node
) to theINode
interface, which can be used to access the underlyingNode
instance 3-4x faster than via type casting.
v1.0.0
New features:
- Support for parsing and generating JSX. (See the
JsxParser
class andToJsx
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
(themethod
parameter comes last). - Remove the
VisitProperty
method from the visitors and introduceVisitAssignmentProperty
andVisitObjectProperty
instead. - Introduce the
VisitFunctionBody
method to the visitors. Visitation of function bodies are no longer dispatched toVisitBlockStatement
. - Rename the
ToJavaScriptString
extension methods toToJavaScript
. - Rename the
ToJsonString
extension methods toToJson
. - Hide the constructors of
RegExpValue
andTemplateValue
and provide factory methods (From
) instead.
v0.9.3
Improvements:
- Add
RangeRef
andLocationRef
toINode
as well. - Expose input parameters and options as public properties in
Tokenizer
andParser
.
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
toIDestructuringPatternElement
v0.9.2
Improvements:
- Introduce
ParserOptions.ExperimentalESFeatures
to allow fine-tuning which experimental feature to enable. - Re-add
BindingPattern
to the AST under the nameDestructuringPattern
. - Prevent
Literal.Value
from re-boxing the return value on every call by caching it when necessary (i.e. in the case ofNumericLiteral
,BigIntLiteral
). - Allow accessing
Node.Range
andNode.Location
as readonly references (seeNode.RangeRef
andNode.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
toIHoistingScope
. - Rename
IDestructuringPattern
toIDestructuringElement
.
v0.9.1
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
andTryStatement.Finalizer
toNestedBlockStatement
(which is sealed).
v0.9.0
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.