Releases: adams85/acornima
Releases · adams85/acornima
v1.2.0
New features:
- Implement Explicit Resource Management as an experimental feature (see
ExperimentalESFeatures.ExplicitResourceManagement).
Improvements:
- Remove
net6.0from the target frameworks. - Mark the deprecated
Expressionproperty of function nodes as obsolete. - Remove the long deprecated
eachproperty ofForInStatementfrom the output of AST to JSON conversion. - Minor performance-related tweaks.
Bug fixes:
- Reject return statements in class static blocks, even if
AllowReturnOutsideFunctionis used (see also acornjs/acorn#1378).
v1.1.1
Bug fixes:
- Fix parsing bug related to handling await in class property initializers in non-module code (see also acornjs/acorn#1334, acornjs/acorn#1338, acornjs/acorn#1339).
- Correct error reporting of invalid destructuring patterns
- Correct
Parser.Reset/JsxParser.Resertto correctly reset the underlying tokenizer. - Minor corrections to README.md
v1.1.0
New features:
- Expose variable scope information tracked by the parser to consumers via the
ParserOptions.OnNodecallback.
Improvements:
- Allow consumers to provide an
OnNodecallback even when enablingParserOptionsExtensions.RecordParentNodeInUserData. - Add a virtual protected
Resetmethod toAstVisitorwhich 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.Createand addFrominstead 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
CatchClausenode to JS code.
Breaking changes:
- Add a new parameter (
context) to theParserOptions.OnNodecallback (more precisely, to theOnNodeHandlerdelegate). - Add a new property (
Node) to theINodeinterface, which can be used to access the underlyingNodeinstance 3-4x faster than via type casting.
v1.0.0
New features:
- Support for parsing and generating JSX. (See the
JsxParserclass andToJsxextension methods, respectively).
Improvements:
- Minor improvement to the AST and visitors.
- Minor performance improvements.
Breaking changes:
- Change the parameter order in the constructor of
ObjectProperty(themethodparameter comes last). - Remove the
VisitPropertymethod from the visitors and introduceVisitAssignmentPropertyandVisitObjectPropertyinstead. - Introduce the
VisitFunctionBodymethod to the visitors. Visitation of function bodies are no longer dispatched toVisitBlockStatement. - Rename the
ToJavaScriptStringextension methods toToJavaScript. - Rename the
ToJsonStringextension methods toToJson. - Hide the constructors of
RegExpValueandTemplateValueand provide factory methods (From) instead.
v0.9.3
Improvements:
- Add
RangeRefandLocationReftoINodeas well. - Expose input parameters and options as public properties in
TokenizerandParser.
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
IDestructuringElementtoIDestructuringPatternElement
v0.9.2
Improvements:
- Introduce
ParserOptions.ExperimentalESFeaturesto allow fine-tuning which experimental feature to enable. - Re-add
BindingPatternto the AST under the nameDestructuringPattern. - Prevent
Literal.Valuefrom re-boxing the return value on every call by caching it when necessary (i.e. in the case ofNumericLiteral,BigIntLiteral). - Allow accessing
Node.RangeandNode.Locationas readonly references (seeNode.RangeRefandNode.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
IVarScopetoIHoistingScope. - Rename
IDestructuringPatterntoIDestructuringElement.
v0.9.1
Improvements:
- Add option to allow
new.targetmeta-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.BlockandTryStatement.FinalizertoNestedBlockStatement(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.