@zvenigora/ng-eval-core 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +594 -0
- package/LICENSE +21 -0
- package/README.md +14 -7
- package/fesm2022/zvenigora-ng-eval-core.mjs +271 -314
- package/fesm2022/zvenigora-ng-eval-core.mjs.map +1 -1
- package/package.json +2 -2
- package/types/zvenigora-ng-eval-core.d.ts +30 -11
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
# Changelog — `@zvenigora/ng-eval-core`
|
|
2
|
+
|
|
3
|
+
All notable changes to `@zvenigora/ng-eval-core` are documented in this file. The other two packages in this repository keep their own, listed in the [root changelog](../../CHANGELOG.md).
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
A heading marked "(not published to npm)" is a version that was recorded here and never published.
|
|
8
|
+
|
|
9
|
+
Versions 0.1.104–0.1.107 are on npm without entries here.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## [Unreleased]
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## [0.7.0] - 2026-10-01
|
|
18
|
+
|
|
19
|
+
**Errors keep their identity, `thisArg` is applied, and three silent outcomes now throw —
|
|
20
|
+
[A1](../../docs/backlog-retired.md#a1), [A2](../../docs/backlog-retired.md#a2),
|
|
21
|
+
[A5](../../docs/backlog-retired.md#a5), [A6](../../docs/backlog-retired.md#a6) and
|
|
22
|
+
[A7](../../docs/backlog-retired.md#a7).** A breaking minor. No exported symbol changes shape — the
|
|
23
|
+
`.d.ts` differs from 0.6.1 in documentation comments only — but what several methods throw, and
|
|
24
|
+
the `this` some calls receive, change. `eval-signals` 0.1.4 and `eval-forms` 0.2.5 widen their
|
|
25
|
+
peer ranges to admit it.
|
|
26
|
+
|
|
27
|
+
### Breaking
|
|
28
|
+
- **Errors are no longer rewrapped.** The twelve service entry points — `EvalService`,
|
|
29
|
+
`CompilerService`, `DiscoveryService` and `ParserService` — and the evaluator's call and `new`
|
|
30
|
+
wrappers rethrow what they caught, where each raised a new `Error` carrying only the message. A
|
|
31
|
+
custom error keeps its class, `stack`, `cause` and properties, so `instanceof` works; a syntax
|
|
32
|
+
error is acorn's `SyntaxError`, with `pos` and `loc`. Messages lose the prefixes a throw used to
|
|
33
|
+
get: `Function call error: ` from inside a called function, and `Constructor error: ` from
|
|
34
|
+
inside a constructor. A thrown non-`Error` value propagates as thrown, where `CompilerService`
|
|
35
|
+
replaced it with a fixed message (`'call'`, `'error in compile'`, `'error in callAsync'`). Code
|
|
36
|
+
that matched a prefix or the message should select on the error itself.
|
|
37
|
+
[A5](../../docs/backlog-retired.md#a5), [A6](../../docs/backlog-retired.md#a6).
|
|
38
|
+
- **A synchronous throw under `await` throws synchronously.** `await obj.__proto__` became a
|
|
39
|
+
rejected promise: `simpleEval` and `eval` returned it instead of throwing, and the walk went on
|
|
40
|
+
with the operand still open. It now throws from the sync entry points, and `evalAsync` rejects
|
|
41
|
+
with the original error. An asynchronous rejection still carries ` at position <start>-<end>`.
|
|
42
|
+
Hooks see a failed walk: the operand and the `await` close with `completed: false` and an
|
|
43
|
+
`error`, where the operand used to close with no `error`.
|
|
44
|
+
[A1](../../docs/backlog-retired.md#a1).
|
|
45
|
+
- **Destructuring assignment throws instead of silently doing nothing.** `[a, b] = arr` and
|
|
46
|
+
`({ m } = o)` returned `undefined` and left the context unchanged. They now throw
|
|
47
|
+
`Unsupported assignment target: ArrayPattern` / `ObjectPattern`, before either side is
|
|
48
|
+
evaluated. [A2](../../docs/backlog-retired.md#a2).
|
|
49
|
+
- **`(a)++` works under `preserveParens`**, and so do `(a) = 1` and `(o.x)++`: a parenthesised
|
|
50
|
+
write target is unwrapped. Each used to push no value, so the nodes around it read the wrong
|
|
51
|
+
operands. Any other unsupported update target throws `Unsupported update target: <type>`.
|
|
52
|
+
[A2](../../docs/backlog-retired.md#a2).
|
|
53
|
+
- **`EvalScopeOptions.thisArg` is applied.** A method called on a scope's own object —
|
|
54
|
+
`cat.action()` through the namespace `cat` — receives the scope's `thisArg` as `this`, and
|
|
55
|
+
`this.fn()` receives the `thisArg` of the prior scope that supplies `fn`. With no `thisArg`,
|
|
56
|
+
`cat.action()` still receives the scope's object. `cat` itself still evaluates to the scope's
|
|
57
|
+
object, and `cat.x` reads and writes it, not `thisArg`. `EvalContext.getThis` answers with
|
|
58
|
+
that `thisArg`, and answers `undefined` for a key only a lookup resolves, where it returned the
|
|
59
|
+
lookup function: `this.fn()` for such a key now receives the context. The README's Scopes
|
|
60
|
+
example now uses a `thisArg` other than the scope's object.
|
|
61
|
+
[A7](../../docs/backlog-retired.md#a7).
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
- **The README says options-first calls cannot read collected hook errors, by design.**
|
|
65
|
+
`simpleEval(expr, context, { hooks })` never hands back its state: read `state.hookErrors`
|
|
66
|
+
after `createState` and `eval`, or set `onHookError: 'throw'` on the `EvalHooks` you pass.
|
|
67
|
+
Decided rather than built: [E5](../../docs/backlog-retired.md#e5).
|
|
68
|
+
- **`LICENSE` ships in the package**, which declared `"license": "MIT"` and shipped no file.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## [0.6.1] - 2026-09-30
|
|
73
|
+
|
|
74
|
+
**A patch: two manifest-and-hygiene fixes, [F5](../../docs/backlog-retired.md#f5) and
|
|
75
|
+
[B3](../../docs/backlog-retired.md#b3), a dead line removed, and a README correction.** No
|
|
76
|
+
published symbol is added and none changes shape. `eval-signals` 0.1.3 and `eval-forms` admit it
|
|
77
|
+
unchanged: both declare `>=0.3.0 <0.7.0`.
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
- **The `js-sha256` peer range is widened** from `^0.10.1` to
|
|
81
|
+
`^0.10.1 || ^0.11.0 || ^0.12.0 || ^1.0.0`. On `0.x` a caret range admits only its own minor, so
|
|
82
|
+
a project already on `js-sha256` 1.0.0, the current `latest`, got an npm peer warning naming this
|
|
83
|
+
package. No code changed; tested against 0.10.1 and 1.0.0. [F5](../../docs/backlog-retired.md#f5).
|
|
84
|
+
- **`ParserService` no longer logs when its periodic cleanup clears the parse cache.** The
|
|
85
|
+
`console.debug('Parser cache cleared to prevent memory leaks')` is gone; the cache is still
|
|
86
|
+
cleared on the same condition. The published bundle now makes no `console.*` call.
|
|
87
|
+
[B3](../../docs/backlog-retired.md#b3).
|
|
88
|
+
- **Built with Angular 22.1.** The published `.d.ts` declares each service's `ɵprov` as
|
|
89
|
+
`ɵɵInjectableDeclaration<any>`, where 0.6.0, built with Angular 22.0, declared it with the
|
|
90
|
+
service's own type (`ɵɵInjectableDeclaration<ParserService>`, and so on for `EvalService`,
|
|
91
|
+
`CompilerService` and `DiscoveryService`). This is Angular's generated injection metadata, not
|
|
92
|
+
this package's API, and those four lines are the whole `.d.ts` difference from 0.6.0.
|
|
93
|
+
- **`CHANGELOG.md` now ships in the package**, beside `README.md`. Its links into the repository's
|
|
94
|
+
`docs/` resolve on GitHub, not on npm.
|
|
95
|
+
|
|
96
|
+
### Fixed
|
|
97
|
+
- **The `import()` visitor's dead `afterVisitor` call is removed.** It followed an unconditional
|
|
98
|
+
throw, so it never ran. Behaviour is unchanged; the bundle loses that one line.
|
|
99
|
+
[A3](../../docs/backlog-retired.md#a3).
|
|
100
|
+
- **The README no longer presents `EvalScopeOptions.thisArg` as applied.** `thisArg` is accepted
|
|
101
|
+
and is not currently applied: a method reached through a scope's namespace, such as
|
|
102
|
+
`cat.action()`, is called with the scope's own object as `this`, whatever `thisArg` holds.
|
|
103
|
+
Nothing changes at runtime; the README's Scopes section now says this. What `thisArg` should
|
|
104
|
+
mean is open, as [A7](../../docs/backlog-retired.md#a7), and answering it changes a call's receiver.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## [0.6.0] - 2026-09-26
|
|
109
|
+
|
|
110
|
+
**The trace bound, [A12](../../docs/backlog-retired.md#a12), and `EvalService`'s lifecycle,
|
|
111
|
+
[A8](../../docs/backlog-retired.md#a8) with [A20](../../docs/backlog-retired.md#a20), [A21](../../docs/backlog-retired.md#a21) and
|
|
112
|
+
[B3](../../docs/backlog-retired.md#b3).** A **minor** rather than a patch: it adds four published symbols and
|
|
113
|
+
changes the shape of none, and this repository has never shipped API in a patch. It does withdraw
|
|
114
|
+
one documented behaviour, `EvalService.ngOnDestroy` clearing your hook registries, and
|
|
115
|
+
*Upgrading* says what to do instead. `eval-signals 0.1.3` and `eval-forms 0.2.3` below widen
|
|
116
|
+
their peer ranges to admit it.
|
|
117
|
+
|
|
118
|
+
### Added
|
|
119
|
+
|
|
120
|
+
- **`maxTraceItems`**, an evaluation option bounding how many entries `EvalResult.trace` keeps.
|
|
121
|
+
Defaults to **10,000** — roughly 0.5 MB. The **head** is kept in order, so `trace[0]` is still
|
|
122
|
+
the first value the walk pushed.
|
|
123
|
+
- **`EvalResult.traceTruncated`** — `true` once a push has actually been **dropped**, and it
|
|
124
|
+
stays true until `clearTrace()`. A walk of exactly `maxTraceItems` pushes leaves it `false`,
|
|
125
|
+
because nothing was lost. No entry is appended to the trace to mark truncation: every row in it
|
|
126
|
+
describes a real node. Under `maxTraceItems: 0` it also stays `false` — that is tracing turned
|
|
127
|
+
off, not a trace that lost something.
|
|
128
|
+
- **`EvalResult.tracePushCount`** — every push the state made since it was built or last
|
|
129
|
+
cleared, which is the number the trace no longer tells you once it is truncated. Accurate even
|
|
130
|
+
when tracing is off.
|
|
131
|
+
- **`EvalResult.clearTrace()`** — the only reset for the trace and both counters. It empties the
|
|
132
|
+
array **in place**, so a consumer holding `state.result.trace` keeps a live reference rather
|
|
133
|
+
than a stale snapshot.
|
|
134
|
+
- `EvalResult.addTraceBounded` and `EvalState.maxTraceItems`. These are `@internal`-tagged:
|
|
135
|
+
supported for this library's own use, not part of the contract, and not counted in the four
|
|
136
|
+
above. They are nonetheless reachable on published classes, so they are listed rather than
|
|
137
|
+
hidden.
|
|
138
|
+
|
|
139
|
+
### Changed
|
|
140
|
+
|
|
141
|
+
- **`EvalResult.trace` stops growing past 10,000 entries by default**. It gained an
|
|
142
|
+
entry per pushed value and was reset by nothing, so a loop's trace grew as iterations × nodes:
|
|
143
|
+
700,007 entries and ~34 MB for a 100,000-iteration loop — which the default `maxIterations`
|
|
144
|
+
does not stop, since it charges exactly its budget and completes. Where the budget *does* stop
|
|
145
|
+
a loop, the whole allocation was paid *before* the throw. The budget bounded time; nothing
|
|
146
|
+
bounded the memory.
|
|
147
|
+
- **`EvalTraceItem.start` and `end` are documented as reserved**
|
|
148
|
+
([A16](../../docs/backlog-retired.md#a16)). Nothing has ever set either field. Their JSDoc now says so, and
|
|
149
|
+
points at `expression` and `EvalState.nodeTimings` for the source text and timing they appear
|
|
150
|
+
to offer. Documentation only — both fields keep their optional `number` type — but the JSDoc
|
|
151
|
+
ships in the `.d.ts`.
|
|
152
|
+
- **⚠️ `EvalService.ngOnDestroy` no longer clears any hook registry, and drains nothing**
|
|
153
|
+
([A8](../../docs/backlog-retired.md#a8)). **This withdraws documented behaviour.** From 0.3.0
|
|
154
|
+
to 0.5.0, destroy cleared the value stack, the hook registrations and the hook bookkeeping of
|
|
155
|
+
every state the service had built, and that included an `EvalHooks` registry you passed through
|
|
156
|
+
`options.hooks`. It follows from the fix below: the service now keeps no state, so at destroy
|
|
157
|
+
there is none for it to reach. It marks the service destroyed, so later calls throw, and does
|
|
158
|
+
nothing else. This is a trade. Keeping the clear would mean the service keeping those states,
|
|
159
|
+
or their registries, until destroy, and that is the leak being fixed. The cost falls only on
|
|
160
|
+
what you keep past the root injector. That means a registry with a hook on it that keeps a
|
|
161
|
+
state, or a `createState` state whose hook bookkeeping you relied on destroy to reset.
|
|
162
|
+
*Upgrading* says what to do instead. The `hooks` JSDoc, which ships in the `.d.ts`, and the
|
|
163
|
+
README no longer make the promise.
|
|
164
|
+
- **`EvalService.ngOnDestroy` no longer logs to `console.warn`**
|
|
165
|
+
([B3](../../docs/backlog-retired.md#b3)). The warn reported a drain that threw, and there is no drain.
|
|
166
|
+
|
|
167
|
+
### Upgrading
|
|
168
|
+
|
|
169
|
+
**No expression result changes.** `eval`, `simpleEval` and their async forms return
|
|
170
|
+
byte-identical values. What changes is two surfaces around the result:
|
|
171
|
+
|
|
172
|
+
- **Diagnostics.** `EvalResult.trace` is bounded where it was not ([A12](../../docs/backlog-retired.md#a12)).
|
|
173
|
+
- **`EvalService`'s lifecycle: what it keeps, and what `ngOnDestroy` touches.** The service no
|
|
174
|
+
longer keeps anything you pass it or anything it hands back. That means no state, whether from
|
|
175
|
+
`simpleEval`, `simpleEvalAsync` or `createState`, and no context ([A8](../../docs/backlog-retired.md#a8),
|
|
176
|
+
[A20](../../docs/backlog-retired.md#a20)). Each is collectable once you drop it. `ngOnDestroy` marks the
|
|
177
|
+
service destroyed and does nothing else. It drains no state, empties none of your registries
|
|
178
|
+
or contexts ([A21](../../docs/backlog-retired.md#a21)), and no longer logs ([B3](../../docs/backlog-retired.md#b3)).
|
|
179
|
+
|
|
180
|
+
The first is covered by the trace paragraphs below. For the second, two changes can ask
|
|
181
|
+
something of you, and the next two paragraphs say what: the hook registries destroy no longer
|
|
182
|
+
clears, and the hook bookkeeping it no longer resets.
|
|
183
|
+
|
|
184
|
+
**If you relied on `EvalService.ngOnDestroy()` to clear an `EvalHooks` registry you passed
|
|
185
|
+
through `options.hooks`**, it no longer does, whichever method you passed it to
|
|
186
|
+
([A8](../../docs/backlog-retired.md#a8)). From 0.3.0 to 0.5.0, the `hooks` JSDoc said:
|
|
187
|
+
|
|
188
|
+
> `EvalService.ngOnDestroy` empties the registries of the states it created, this one included,
|
|
189
|
+
> so that a registry outliving the service cannot keep those states and their AST nodes
|
|
190
|
+
> reachable.
|
|
191
|
+
|
|
192
|
+
The README said the same. You are affected only if the registry outlives the root injector
|
|
193
|
+
**and** a hook on it keeps a state. That covers a hook that captures one
|
|
194
|
+
(`hooks.on('after', '*', () => state)`), one that stores the events it receives or
|
|
195
|
+
`event.state`, and a `createDependencyTracker` installed on it, which stores them in `reads`. In
|
|
196
|
+
that case, those states and their contexts now live as long as the registry does. **Release it
|
|
197
|
+
yourself** when you are done with it, in the teardown that owns the registry, such as your
|
|
198
|
+
component's `ngOnDestroy` or a `DestroyRef.onDestroy` callback. Call the unsubscribe that `on` /
|
|
199
|
+
`onRead` returned, or `hooks.clear()`.
|
|
200
|
+
|
|
201
|
+
**If you keep a state from `createState` past the root injector**, destroy no longer resets its
|
|
202
|
+
hook bookkeeping: the errors in `hookErrors`, and any frame a walk left open. 0.5.0 reset both,
|
|
203
|
+
and cleared the state's value stack. If you relied on that, call `state.resetHookBookkeeping()`
|
|
204
|
+
yourself. The trace was never part of it. 0.5.0's destroy did not clear the trace, and
|
|
205
|
+
`clearTrace()` is new in this release.
|
|
206
|
+
|
|
207
|
+
**If you read `EvalResult.trace` programmatically**, two things to check. Above 10,000 pushes on
|
|
208
|
+
one state it now stops, and `traceTruncated` is how you detect that — a truncated trace is
|
|
209
|
+
otherwise indistinguishable from a complete one. And the trace spans every evaluation run on a
|
|
210
|
+
state, so the bound is on their **total**; `clearTrace()` is how the `createState` + repeated
|
|
211
|
+
`eval` style gets a trace describing one walk.
|
|
212
|
+
|
|
213
|
+
**Two values are honoured rather than treated as falsy**: `maxTraceItems: 0` disables tracing
|
|
214
|
+
while keeping `tracePushCount` accurate, and `Infinity` restores the previous behaviour exactly.
|
|
215
|
+
|
|
216
|
+
### Fixed
|
|
217
|
+
|
|
218
|
+
- **`EvalService.ngOnDestroy` no longer empties your registries**
|
|
219
|
+
([A21](../../docs/backlog-retired.md#a21)). It called `clear()` on every context with a `type` passed to
|
|
220
|
+
`createState`, `simpleEval` or `simpleEvalAsync`, including one nested under a `context`
|
|
221
|
+
key. So when the root injector was destroyed, in a test, per SSR request or at a
|
|
222
|
+
micro-frontend's teardown, every `Registry` the application had evaluated against was emptied,
|
|
223
|
+
even though the application still held it. It also called a `clear` method on any other object
|
|
224
|
+
passed in that had a `type` key and declared one, a caller's `EvalContext` subclass included. It
|
|
225
|
+
now changes nothing inside them, and since the two entries below it holds no reference to them
|
|
226
|
+
either. No exported symbol changes.
|
|
227
|
+
- **Under `caseInsensitive`, a context object with a `type` field is no longer kept alive by
|
|
228
|
+
`EvalService`** ([A20](../../docs/backlog-retired.md#a20)). `createState`, `simpleEval` and
|
|
229
|
+
`simpleEvalAsync` added every context with a `type`, including every `Registry` and
|
|
230
|
+
`EvalContext`, to a set that nothing read and that emptied only when the service was destroyed.
|
|
231
|
+
The set is gone. On its own that changed only one case. Under `caseInsensitive`, a plain object
|
|
232
|
+
or class instance is copied into a new `Registry` rather than adopted, so the set was the only
|
|
233
|
+
thing holding the original. It can now be garbage-collected once you drop it. Every other
|
|
234
|
+
context is released by the next entry, which removes the evaluation states that held them.
|
|
235
|
+
No exported symbol changes.
|
|
236
|
+
- **`EvalService` no longer keeps any evaluation state until the application ends**
|
|
237
|
+
([A8](../../docs/backlog-retired.md#a8)). It added every state it built, through `simpleEval`,
|
|
238
|
+
`simpleEvalAsync` or `createState`, to a set that emptied only in `ngOnDestroy`. So each
|
|
239
|
+
state was kept for the life of the root injector, including one you had finished with and
|
|
240
|
+
dropped. That meant the parsed expression, the trace (up to `maxTraceItems`), and the context
|
|
241
|
+
you passed, with everything reachable from it. The pattern `eval-signals` documents,
|
|
242
|
+
`simpleEval(expr, createSignalContext(...))`, kept each signal context and the signal sources it
|
|
243
|
+
reads. The set is gone. A state from `simpleEval` or `simpleEvalAsync` is collectable when the
|
|
244
|
+
call returns, including a call that throws or a promise that rejects. One from `createState` is
|
|
245
|
+
collectable once you drop it. Either way your context goes with it, once nothing else holds it.
|
|
246
|
+
No exported symbol changes. The one documented behaviour this withdraws, destroy clearing your
|
|
247
|
+
hook registries, is under *Changed* and *Upgrading*.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## [0.5.0] - 2026-09-17
|
|
252
|
+
|
|
253
|
+
### Fixed
|
|
254
|
+
|
|
255
|
+
- **Object destructuring now binds the names JavaScript binds.** `evaluateObjectPattern` took
|
|
256
|
+
the binding name from the pattern's **key** and then resolved the pattern's **value** as an
|
|
257
|
+
*expression* against the source object. For `{ a: b }` that resolved the identifier `b`
|
|
258
|
+
against the source and bound the name `a` to whatever came back — both halves wrong at once,
|
|
259
|
+
where JavaScript binds `b` to `src.a`. Shorthand `{ a }` hid it, because `key` and `value`
|
|
260
|
+
both name `a`, so resolving the wrong one landed on the right answer.
|
|
261
|
+
|
|
262
|
+
Affected, through **both** arrow parameters and `let`/`const` declarations:
|
|
263
|
+
|
|
264
|
+
| Pattern | before | now |
|
|
265
|
+
| ------- | ------ | --- |
|
|
266
|
+
| `{ a: b }` — read `b` | `undefined` | the source's `a` |
|
|
267
|
+
| `{ a: b }` — read `a` | the source's `b`, when it had one | not bound |
|
|
268
|
+
| `{ a: x, b: y }` | neither bound | both bound |
|
|
269
|
+
| `{ a: { b } }` | nothing bound | the inner `b` |
|
|
270
|
+
| `{ a: { b: z } }` | nothing bound | the inner `b` |
|
|
271
|
+
| `{ "a": q }` | `undefined` | the source's `a` |
|
|
272
|
+
| `{ ["a"]: q }` | `undefined` | the source's `a` |
|
|
273
|
+
|
|
274
|
+
**Most consumers saw `undefined` rather than a wrong value.** The wrong-value case needs the
|
|
275
|
+
renamed-*to* name to exist on the source as well — `{ a: b }` over a source carrying both
|
|
276
|
+
`a` and `b` — and otherwise the value name resolves to nothing. If you inverted a rename to
|
|
277
|
+
work around this, remove the inversion.
|
|
278
|
+
|
|
279
|
+
Shorthand `{ a }` and array patterns were correct and are unchanged. Defaults (`{ a = 1 }`)
|
|
280
|
+
continue to throw `AssignmentPattern is not supported as a binding target.`
|
|
281
|
+
|
|
282
|
+
- **A computed key is now evaluated.** `{ [keyName]: q }` parses with `key` an `Identifier`,
|
|
283
|
+
and the branch order tested `Identifier` before `computed` — so the key was taken to be the
|
|
284
|
+
*name it is spelled with* and the source was read at `src.keyName` instead of at
|
|
285
|
+
`src[keyName]`. The literal form `{ ["a"]: q }` hid it, a `Literal`'s value being its own
|
|
286
|
+
key. Computed keys are evaluated in the enclosing scope, as in JavaScript.
|
|
287
|
+
|
|
288
|
+
- **An object rest element now binds the remainder.** `{ a, ...r }` bound the **whole** source
|
|
289
|
+
to `r`, leaving a key a sibling property had already taken: `(({a, ...r}) => r.a)(src)` was
|
|
290
|
+
the source's `a` and is now `undefined`. Keys are excluded by their **source** name, so
|
|
291
|
+
`{ a: x, ...r }` removes `a`. Array rest was already correct. This is the one item here
|
|
292
|
+
whose old answer was a real value rather than `undefined`, so it is the one a consumer may
|
|
293
|
+
have been reading without knowing.
|
|
294
|
+
|
|
295
|
+
### Changed
|
|
296
|
+
|
|
297
|
+
- **`evaluateObjectPattern` no longer pushes a scope.** It pushed the source so the value
|
|
298
|
+
could be resolved against it, which was the defect above; the value is now bound as a
|
|
299
|
+
pattern and nothing reads a scope. No consumer-visible behaviour depends on this, but it
|
|
300
|
+
means `pattern.ts` is no longer one of the visitors the `BL-A9` push/pop idiom applies to.
|
|
301
|
+
|
|
302
|
+
- **The prototype-pollution blocklist now applies to the source key on the way in.**
|
|
303
|
+
`{ __proto__: p }` and `{ constructor: { x } }` are rejected before the source property is
|
|
304
|
+
read, rather than at the binding write — which is what keeps the guard in front of a nested
|
|
305
|
+
pattern, where a plain read would have handed `Function` to the recursion. The rejection and
|
|
306
|
+
its message are unchanged for every form that already threw.
|
|
307
|
+
|
|
308
|
+
### Upgrading
|
|
309
|
+
|
|
310
|
+
`0.5.0` is a minor rather than a patch because expression **results change** on the paths
|
|
311
|
+
above: a consumer on `^0.4.0` does not receive it unattended, and should re-run their own
|
|
312
|
+
expression tests when they take it. The two downstream packages widen their peer range to
|
|
313
|
+
admit it in the same change — `eval-signals 0.1.2` and `eval-forms 0.2.2` below — which is
|
|
314
|
+
what `@nx/dependency-checks` requires of a workspace release, and neither carries any other
|
|
315
|
+
change.
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## [0.4.0] - 2026-09-15
|
|
320
|
+
|
|
321
|
+
Phase 2 of the [roadmap](../../ROADMAP.md): **statement support**. `let` and `const` declarations,
|
|
322
|
+
blocks, `if`/`else` and the classic three-part `for` now evaluate as statements, with JavaScript's
|
|
323
|
+
completion-value semantics. Design, measurements and the questions it settles are in
|
|
324
|
+
`docs/statements/phase-2-plan.md`; the retrospect is in `docs/statements/summary.md`.
|
|
325
|
+
|
|
326
|
+
**Read the Changed section before upgrading.** Statements were never *unsupported* — they were
|
|
327
|
+
walked as expressions and silently mis-evaluated, so this release changes what a dozen already-working
|
|
328
|
+
expressions return, and rejects a dozen more that used to return a value. If your expressions are
|
|
329
|
+
single expressions (`a + b * c`, `user.name`, `items.filter(…)`), nothing here reaches you.
|
|
330
|
+
|
|
331
|
+
### Added
|
|
332
|
+
|
|
333
|
+
- **Seven statement node types**: `Program`, `ExpressionStatement`, `EmptyStatement`,
|
|
334
|
+
`BlockStatement`, `VariableDeclaration` (`let` / `const`), `IfStatement` and `ForStatement`.
|
|
335
|
+
Blocks introduce a scope; declarations bind into it and do not write the caller's context object.
|
|
336
|
+
- **`EMPTY_COMPLETION`**, exported. A statement that produces no value — a declaration, an `if`
|
|
337
|
+
that takes no branch, a `for` that runs zero iterations — pushes this sentinel rather than
|
|
338
|
+
`undefined`, because JavaScript's completion-value semantics keep the last *non-empty* value and
|
|
339
|
+
empty is not `undefined`. It never leaves an evaluation's return value, but an `after` hook on a
|
|
340
|
+
statement node fires before the conversion and **will** see it, so it is exported for identity
|
|
341
|
+
comparison on the precedent of `ASYNC_HOOK_MESSAGE`. See the
|
|
342
|
+
[package README](README.md#statements-and-the-empty-completion-sentinel).
|
|
343
|
+
- **`maxIterations`** on `EvalOptions`, defaulting to **100,000** iterations per evaluation.
|
|
344
|
+
Exceeding it raises `Iteration budget exhausted after <n> iterations`. The budget is per
|
|
345
|
+
outermost `eval` call and shared by every loop in the expression. It bounds **time, not memory**:
|
|
346
|
+
`result.trace` grows per pushed value and that allocation is paid before the throw.
|
|
347
|
+
- **`EvalContext.setInScope`**, and `EvalContext.scopeHolding` promoted from private — a write
|
|
348
|
+
needs the scope, not a yes/no, because `const` kinds are keyed by scope.
|
|
349
|
+
- `EvalHooks.pushWalkBase` / `popWalkBase` / `walkBase`, and `EvalState.walkDepth` / `enterWalk` /
|
|
350
|
+
`exitWalk` / `iterationsRemaining` / `chargeIteration` / `declareConst` / `isConstBinding`. These
|
|
351
|
+
are `@internal`-tagged: supported for this library's own use, not part of the contract. They are
|
|
352
|
+
nonetheless reachable on published classes, so they are listed rather than hidden.
|
|
353
|
+
|
|
354
|
+
### Changed
|
|
355
|
+
|
|
356
|
+
**Every row below was transcribed from `statement-semantics.spec.ts` and the step-6 audit, both
|
|
357
|
+
run against 0.3.0 and 0.4.0 — not from the design document.**
|
|
358
|
+
|
|
359
|
+
Expressions that returned a value and now return a **different** value:
|
|
360
|
+
|
|
361
|
+
| Expression | 0.3.0 | 0.4.0 |
|
|
362
|
+
| ---------- | ----- | ----- |
|
|
363
|
+
| `let x = 1` | `1` | `undefined` |
|
|
364
|
+
| `let x = 1; x + 1` | `NaN` | `2` |
|
|
365
|
+
| `const y = 2; y` | `undefined` | `2` |
|
|
366
|
+
| `if (a) { 1 } else { 2 }`, `a` truthy | `2` | `1` |
|
|
367
|
+
| `if (a) { 1 }`, `a` falsy | `1` | `undefined` |
|
|
368
|
+
| `for (let i = 0; i < 3; i++) { i }` | `NaN` | `2` |
|
|
369
|
+
| `let [p, q] = arr` | the array | `undefined`, and `p` / `q` are now bound |
|
|
370
|
+
|
|
371
|
+
Expressions that returned a value and now **throw**:
|
|
372
|
+
|
|
373
|
+
| Expression | 0.3.0 | 0.4.0 |
|
|
374
|
+
| ---------- | ----- | ----- |
|
|
375
|
+
| `while (false) { 1 }` | `1` | `Unsupported statement type: WhileStatement` |
|
|
376
|
+
| `do { 1 } while (false)` | `1` | `Unsupported statement type: DoWhileStatement` |
|
|
377
|
+
| `for (const k in o) { k }` | `undefined` | `Unsupported statement type: ForInStatement` |
|
|
378
|
+
| `for (const v of arr) { v }` | `undefined` | `Unsupported statement type: ForOfStatement` |
|
|
379
|
+
| `switch (1) { case 1: 2 }` | `2` | `Unsupported statement type: SwitchStatement` |
|
|
380
|
+
| `try { 1 } catch (e) { 2 }` | `2` | `Unsupported statement type: TryStatement` |
|
|
381
|
+
| `throw 1` | `1`, throwing nothing | `Unsupported statement type: ThrowStatement` |
|
|
382
|
+
| `x: 1` | `1` | `Unsupported statement type: LabeledStatement` |
|
|
383
|
+
| `break` / `continue` in a loop body | `undefined` | `Unsupported statement type: …` |
|
|
384
|
+
| `function f() { return 1 }` | `1` | `Unsupported statement type: FunctionDeclaration` |
|
|
385
|
+
| `class C {}` | `undefined` | `Unsupported statement type: ClassDeclaration` |
|
|
386
|
+
| `var x = 1` | `1` | `Unsupported variable declaration kind: var` |
|
|
387
|
+
| `const y = 1; y = 2; y` | `2` | `Assignment to constant variable "y".` |
|
|
388
|
+
| `let { a = 1 } = o; a` | `undefined` | `AssignmentPattern is not supported as a binding target.` |
|
|
389
|
+
| `(toString => toString)(1)` | `1` | `Access to dangerous property "toString" is blocked…` |
|
|
390
|
+
|
|
391
|
+
**The messages above are the ones raised at the top level.** A throw from inside a called arrow
|
|
392
|
+
function is re-wrapped, so `(toString => toString)(1)` is caught as
|
|
393
|
+
`Function call error: Access to dangerous property "toString" is blocked for security reasons`, and
|
|
394
|
+
an unsupported statement inside a block-bodied arrow as
|
|
395
|
+
`Function call error: Unsupported statement type: …`. Match on a substring rather than on the start
|
|
396
|
+
of the message.
|
|
397
|
+
|
|
398
|
+
The last row is the widest of them: binding writes now share the prototype-pollution blocklist with
|
|
399
|
+
every other write site, so all thirteen blocked names are rejected as **arrow function parameters**
|
|
400
|
+
too — a form that has nothing to do with declarations. Only `__proto__` is an actual write vector;
|
|
401
|
+
the rest is kept wide so that "is this name blocked?" does not depend on which visitor reached it.
|
|
402
|
+
|
|
403
|
+
**This is a change of kind, not only of coverage.** Before 0.4.0 an unsupported statement was handed
|
|
404
|
+
to `acorn-walk`'s base walker, which walked the subtree as an expression and left whatever it pushed
|
|
405
|
+
on the value stack — which is why `throw 1` evaluated to `1` and threw nothing. There is now an
|
|
406
|
+
explicit dispatcher whose `default` raises.
|
|
407
|
+
|
|
408
|
+
Expressions whose **value is unchanged** and whose stranded-value count is not — listed because the
|
|
409
|
+
values above make it reasonable to assume otherwise:
|
|
410
|
+
|
|
411
|
+
| Expression | 0.3.0 | 0.4.0 |
|
|
412
|
+
| ---------- | ----- | ----- |
|
|
413
|
+
| `1 + 2` | `3`, 0 stranded | unchanged |
|
|
414
|
+
| `1; 2; 3` | `3`, **2 stranded** | `3`, 0 stranded |
|
|
415
|
+
| `a; b` | `'B'`, **1 stranded** | `'B'`, 0 stranded |
|
|
416
|
+
| `{ 1; 2 }` | `2`, **1 stranded** | `2`, 0 stranded |
|
|
417
|
+
| `(x => { 1 })(0)`, `(x => { 1; 2 })(0)`, `(x => { })(0)` | `1` / `2` / `undefined` | unchanged |
|
|
418
|
+
| `(x => { if (true) { 1 } })(0)` | `1` | `1` |
|
|
419
|
+
|
|
420
|
+
A "stranded" value is one the walk pushed that nothing popped, visible as `result.stack.length` after
|
|
421
|
+
an evaluation returns. It was never read, so the value was right by accident; it is now right by rule.
|
|
422
|
+
|
|
423
|
+
Other behavioural changes on already-shipped paths:
|
|
424
|
+
|
|
425
|
+
- **A write to a bare identifier consults the scope stack before the caller's context object.**
|
|
426
|
+
`(x => (x = 99))(1)` used to write `99` into the caller's own context and leave the arrow's
|
|
427
|
+
parameter untouched; it now writes the parameter. This is what makes `for`'s `i++` work.
|
|
428
|
+
- **A block-bodied arrow's body goes through the statement dispatcher.** Completion values are
|
|
429
|
+
unchanged for every supported form (the table above), but an unsupported statement inside a block
|
|
430
|
+
body now throws where the base walker previously evaluated it:
|
|
431
|
+
`(x => { while (false) { 1 } })(0)` was `1`. In the other direction,
|
|
432
|
+
`(x => { let y = 1; y })(0)` was `undefined` and is now `1`.
|
|
433
|
+
- **`EvalHooks.exit` bounds its scan to the current walk**, so a nested walk can no longer flush
|
|
434
|
+
frames belonging to the walk that contains it.
|
|
435
|
+
- **A throwing arrow body no longer strands a scope on a reused `EvalContext`.** Both scope-push
|
|
436
|
+
sites now pop in a `finally`. Before this, one throwing evaluation left a scope that shadowed a
|
|
437
|
+
source key for the life of the context — and a context is reused by design in
|
|
438
|
+
`@zvenigora/ng-eval-signals`. `docs/backlog.md` A9.
|
|
439
|
+
- **`result.trace` and the `after`-hook stream gain `Program` and `ExpressionStatement` entries on
|
|
440
|
+
every evaluation**, including single-expression ones. Code that counts hook events or trace
|
|
441
|
+
entries sees two more per walk.
|
|
442
|
+
- The visitor table is built once and frozen at first use rather than merged per `evaluate` call.
|
|
443
|
+
Every evaluation is faster; the table is process-wide shared state.
|
|
444
|
+
|
|
445
|
+
### Fixed
|
|
446
|
+
|
|
447
|
+
- `pattern.ts` no longer writes the whole `EvalState` to the console on a destructuring path
|
|
448
|
+
(`docs/backlog.md` B2). Three `console.*` calls remain in the published bundle, tracked as B3.
|
|
449
|
+
|
|
450
|
+
### Upgrading alongside `eval-signals` and `eval-forms`
|
|
451
|
+
|
|
452
|
+
**Upgrade both downstream packages with it**: `eval-signals` **0.1.1** and `eval-forms` **0.2.1**,
|
|
453
|
+
released alongside this one and documented above. `eval-signals` 0.1.0 and `eval-forms` 0.2.0
|
|
454
|
+
declare `"@zvenigora/ng-eval-core": "^0.3.0"`, which resolves to `>=0.3.0 <0.4.0` and therefore
|
|
455
|
+
**excludes** this release; installing 0.4.0 beside either of them raises a peer-dependency
|
|
456
|
+
conflict. The two patch releases widen the range and change nothing else.
|
|
457
|
+
|
|
458
|
+
Neither package was ever *incompatible* with 0.4.0 — both suites run against this evaluator on
|
|
459
|
+
every build and are green — so what the conflict reported was a declared range that had not caught
|
|
460
|
+
up. Both continue to support `eval-core` 0.3.0.
|
|
461
|
+
|
|
462
|
+
### `@zvenigora/ng-eval-signals` — one relaxation, no release
|
|
463
|
+
|
|
464
|
+
`eval-signals` is **not** re-released and its version is unchanged at 0.1.0; this is what its
|
|
465
|
+
existing code does once it resolves `eval-core` 0.4.0.
|
|
466
|
+
|
|
467
|
+
A signal context rejects writes to its keys with `SignalContextWriteError`. Because writes now
|
|
468
|
+
consult the scope stack first, **a write to a binding the expression itself created no longer
|
|
469
|
+
throws** — it mutates nothing the consumer owns. Measured, with `count` a signal in the source:
|
|
470
|
+
|
|
471
|
+
| Expression | with `eval-core` 0.3.0 | with `eval-core` 0.4.0 |
|
|
472
|
+
| ---------- | ---------------------- | ---------------------- |
|
|
473
|
+
| `count = 5` | throws `SignalContextWriteError` | **unchanged** — still throws |
|
|
474
|
+
| `(x => (x = 5))(1)` | throws `SignalContextWriteError` | `5` |
|
|
475
|
+
| `let count = 5; count` | n/a — statements did not evaluate | `5`, and the source's `count` is still `1` |
|
|
476
|
+
|
|
477
|
+
The read-only guarantee is intact: it covers the keys of the signal context, and an expression's own
|
|
478
|
+
bindings were never among them. This is a prerequisite for `for`'s `i++` to work inside a signal.
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## [0.3.0] - 2026-08-10
|
|
483
|
+
|
|
484
|
+
Phase 1 of the [roadmap](../../ROADMAP.md): a generic evaluation hook API, the prerequisite for the planned `eval-signals` and `eval-forms` libraries. Design and rationale in `docs/side-effects/phase-1-plan.md`; consumer documentation in the [package README](README.md#evaluation-hooks).
|
|
485
|
+
|
|
486
|
+
### Added
|
|
487
|
+
- **Evaluation Hooks (`EvalHooks`)**: A node-type-keyed hook registry with wildcard (`'*'`) support, reached through `EvalState.hooks`. `on('before' | 'after', type, hook)` fires around each visitor body and returns an unsubscribe; every one of the 19 visitors dispatches through it. Registration is per-`EvalState`, so hooks never leak between evaluations even though `EvalService` is `providedIn: 'root'`.
|
|
488
|
+
- **Read Hooks (`onRead`)**: Fire once per resolved context read, reporting the key **as the context resolved it** — case-corrected under `caseInsensitive`, and exact for computed members — which the AST node alone cannot provide. Events carry `kind`, `key`, `target`, `value`, a best-effort dotted `path`, and `scoped`, which flags a read that resolved to a scope pushed *during* the evaluation (an arrow-function parameter) rather than a real dependency.
|
|
489
|
+
- **Built-in hooks**: `createDependencyTracker()` yields a resettable dependency set per evaluation, filtering scoped reads and any path rooted at one; `createTimingHook()` accumulates per-node-type timings.
|
|
490
|
+
- **`trackTime` option**: Accumulates per-node-type timings on the state, read back as `EvalState.nodeTimings`. Note this registers a hook, so it makes the walk dispatch per node; `EvalResult.duration` remains the free walk-level total.
|
|
491
|
+
- **Hook error policy**: `onHookError` selects `'collect'` (default — a faulty hook cannot break the evaluation it observes), `'throw'`, or `'ignore'`. Collected errors are read from `EvalState.hookErrors`. `ASYNC_HOOK_MESSAGE` is exported so a hook that returned an un-awaited promise can be told apart from an error the hook itself threw.
|
|
492
|
+
- **`EvalState` members**: `hooks`, `hasHooks`, `hookErrors`, `nodeTimings`, and `resetHookBookkeeping()`.
|
|
493
|
+
- **`EvalContext` queries**: `getFromScopes()` and `hasInScopes()`.
|
|
494
|
+
|
|
495
|
+
### Changed
|
|
496
|
+
- **⚠️ `EvalHookError.phase` widened to `EvalHookPhase | 'read'`**: **The one non-additive change in this release.** Read hooks report errors through the same channel as node hooks, so the phase is no longer just `'before' | 'after'`. Nothing shipped before this version, so no released shape is broken — but a `switch (e.phase)` written against the two-value type will not be exhaustive, and this note is here so that is discovered by reading rather than at runtime. Everything else in this release is purely additive.
|
|
497
|
+
- **Hook dispatch is balanced across throws**: `before`/`after` stay paired on every exit path, including the ones an exception takes. A synthesised `after` carries `completed: false` and no `value`, from two distinct sources — the unwinder, which supplies the `error`, and an enclosing visitor closing without its child, which supplies **no** error on an evaluation that may still succeed. **Presence of `error` is the discriminator**, not `completed === false`.
|
|
498
|
+
- **`ngOnDestroy` releases hook state**: `EvalService` now clears each tracked state's hook registrations and resets its hook bookkeeping, so a long-lived caller-owned registry cannot pin destroyed states or their AST nodes. This covers the states `EvalService.createState` produced — the ones the service tracks. States built elsewhere (`CompilerService.createState`, or `EvalState.fromContext` directly) are not tracked and are not cleared, so this is not a general guarantee about every state in an application.
|
|
499
|
+
|
|
500
|
+
### Deprecated
|
|
501
|
+
- **`RecursiveVisitorState` and `RecursiveVisitorResult`**: Superseded by `EvalHooks` / `EvalState` / `EvalResult`. Nothing in the library implements them, and shipping them beside the new API would publish two contradictory hook vocabularies: their `beforeVisitors` / `afterVisitors` entries are typed to return `number | undefined` — the last trace of a timing stub the library no longer has — while `EvalNodeHook` mandates `void`. Both remain exported so this release stays additive; removal is a follow-up for the next breaking version.
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
## [0.2.5] - 2026-08-03 (not published to npm)
|
|
506
|
+
|
|
507
|
+
### Changed
|
|
508
|
+
- **Nx Monorepo Upgrade**: Migrated Nx tooling from **v22.1.3** to **v23.1.1**, bringing Angular to **v22.0.8**, TypeScript to **v6.0.3**, and Jest to **v30.3.0**. Ran the full `nx migrate` flow (47 automatic codemods) plus the migrations Nx deferred to manual review.
|
|
509
|
+
- **ESLint v9 Flat Config**: Converted `.eslintrc.json`/`.eslintignore` to `eslint.config.mjs` at the root and in `eval-core`, replacing the generator's `FlatCompat` shims with flat-native config (the Angular inline-template shim was fully redundant with `@nx/eslint-plugin`'s `flat/angular` preset).
|
|
510
|
+
- **Inferred Nx Targets**: Converted the `eval-core` project's `lint` and `test` targets from the deprecated `@nx/eslint:lint` / `@nx/jest:jest` executors to Nx's inferred targets (`@nx/eslint/plugin`, `@nx/jest/plugin` registered in `nx.json`), removing the executor deprecation warnings scheduled for Nx v24.
|
|
511
|
+
- **Angular Change Detection**: Applied Angular v22's `change-detection-eager` migration, adding an explicit `ChangeDetectionStrategy.Eager` to `EvalCoreComponent` to preserve its pre-v22 default behavior.
|
|
512
|
+
|
|
513
|
+
### Fixed
|
|
514
|
+
- **Jest `isolatedModules`**: Removed from `eval-core`'s `tsconfig.spec.json` after confirming it broke typecheck (TS1205 on re-exported types) and isn't needed for this single-project workspace.
|
|
515
|
+
|
|
516
|
+
---
|
|
517
|
+
|
|
518
|
+
## [0.2.4] - 2026-08-02 (not published to npm)
|
|
519
|
+
|
|
520
|
+
### Note
|
|
521
|
+
- Version bump with no recorded changelog entry at the time; folded into the [0.2.5] migration work above.
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
## [0.2.3] - 2026-08-01 (not published to npm)
|
|
526
|
+
|
|
527
|
+
### Added
|
|
528
|
+
- **Repository Audit & Remediation Plan**: Comprehensive documentation detailing codebase audit (`docs/repository-audit.md`) and remediation execution steps (`docs/remediation-plan.md`).
|
|
529
|
+
- **Archive Script**: Command script (`ng-eval-archive.cmd`) for project archiving (`2026-01-02`).
|
|
530
|
+
|
|
531
|
+
### Fixed
|
|
532
|
+
- **Dependency Security**: Added package overrides for `qs` dependency resolving security vulnerabilities in `package-lock.json` (`2026-01-02`).
|
|
533
|
+
- **Angular Peer Dependencies**: Cleaned up `peerDependencies` in `@zvenigora/ng-eval-core` by removing unused `@angular/common` dependency (`2026-08-01`).
|
|
534
|
+
- **Angular Dependency Injection**: Refactored `CompilerService`, `DiscoveryService`, and `EvalService` to use Angular's modern `inject()` functional dependency injection paradigm (`@angular-eslint/prefer-inject`).
|
|
535
|
+
- **Repository Hygiene**: Removed loose root debug scripts (`debug-ast.js`, `debug-proto.js`, `debug-prototype.js`) and cleaned up stale notes.
|
|
536
|
+
|
|
537
|
+
---
|
|
538
|
+
|
|
539
|
+
## [0.2.2] - 2025-11-30
|
|
540
|
+
|
|
541
|
+
### Changed
|
|
542
|
+
- **Angular Framework Upgrade**: Upgraded Angular framework and dependencies to **v20.x** (v20.1.2 / Angular 20).
|
|
543
|
+
- **Nx Monorepo Upgrade**: Updated Nx tooling to **v22.x** (`22.0.0-beta.6`).
|
|
544
|
+
- **ESLint & Guidelines**: Updated ESLint rules and guidelines for Nx workspace compatibility (`AGENTS.md`).
|
|
545
|
+
|
|
546
|
+
### Fixed
|
|
547
|
+
- **Repository URL**: Standardized repository URL format across `package.json`.
|
|
548
|
+
|
|
549
|
+
---
|
|
550
|
+
|
|
551
|
+
## [0.2.1] - 2025-11-30
|
|
552
|
+
|
|
553
|
+
### Added
|
|
554
|
+
- **Angular 19 Support**: Updated peer dependencies across packages to officially support Angular 19+ (`>=19.0.0`).
|
|
555
|
+
- **Nx Tooling**: Upgraded build tooling to **Nx 21.4.0** and **Angular 19.2.14** (`2025-08-20`).
|
|
556
|
+
|
|
557
|
+
### Fixed
|
|
558
|
+
- **ESLint Compliance**: Resolved ESLint errors following the Angular 19 migration.
|
|
559
|
+
- **Documentation**: Enhanced README descriptions and added automated attribution notes.
|
|
560
|
+
|
|
561
|
+
---
|
|
562
|
+
|
|
563
|
+
## [0.2.0] - 2025-08-20 (not published to npm)
|
|
564
|
+
|
|
565
|
+
### Added
|
|
566
|
+
- **LRU Property Lookup Caching**: Implemented LRU cache for property lookups, optimizing lookup performance from $O(n)$ to $O(1)$.
|
|
567
|
+
- **Enhanced Visitors**: Refactored `MemberExpressionVisitor` with cached property lookups and case-insensitive resolution.
|
|
568
|
+
- **Security Hardening**:
|
|
569
|
+
- Comprehensive prototype pollution prevention (`__proto__`, `constructor`, `prototype` protections).
|
|
570
|
+
- Call expression execution security and strict scope boundary enforcement.
|
|
571
|
+
- Enhanced binary expression type safety and arithmetic error handling.
|
|
572
|
+
- Safe, guarded asynchronous expression evaluation and stack error tracking.
|
|
573
|
+
- **Memory Management**: Cross-platform memory manager compatibility and leak fixes.
|
|
574
|
+
- **Performance Test Suite**: Added benchmark validation test suite ensuring 100% regression-free performance across all 511 unit tests.
|
|
575
|
+
|
|
576
|
+
---
|
|
577
|
+
|
|
578
|
+
## [0.1.102] - 2024-01-03
|
|
579
|
+
|
|
580
|
+
### Added
|
|
581
|
+
- **Expression Support**: Added support for arrow function expressions, update expressions, assignment expressions, object expressions, template literals, tagged templates, `new` expressions, `this` binding, logic expressions, arrays, and unary operations (`2023-12`).
|
|
582
|
+
- **AST Parsing & Caching**: Added caching mechanisms to `ParserService` utilizing `js-sha256` hashing and Acorn parser integration (`2023-12-02`).
|
|
583
|
+
- **Evaluation State & Trace**: Introduced `EvalState`, `EvalContext`, `EvalOptions`, `EvalResult`, and evaluation trace logging.
|
|
584
|
+
- **Case-Insensitive Evaluation**: Added optional case-insensitive property lookup support across scope registries.
|
|
585
|
+
- **Documentation**: Documented visitor pattern, evaluation functions, core services, and common AST model classes (`docs/`).
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
## [0.1.0] - 2023-11-26 (not published to npm)
|
|
590
|
+
|
|
591
|
+
### Added
|
|
592
|
+
- **Initial Commit**: Core `@zvenigora/ng-eval-core` library initialization and basic AST evaluation engine (`2023-11-26`).
|
|
593
|
+
- **Angular Integration**: Basic Angular services and Angular plugin integration setup.
|
|
594
|
+
- **Public API**: Initial release of scope, parser, and visitor architecture.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Mikhail Klygin (Zvenigora)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|