|
1 | | -## Upcoming changes |
2 | | - |
3 | | -### Added |
4 | | - |
5 | | -- **ReplaceOptions.direction** — replacement traversal can now be controlled |
6 | | - from left-to-right or right-to-left. |
7 | | - |
8 | | -### Fixed |
9 | | - |
10 | | -- **ReplaceOptions form handling** — `Expression.replace()` now accepts the new |
11 | | - `form` option, while keeping deprecated `canonical` as a backward- compatible |
12 | | - alias for one release. |
13 | | -- **Replacement form propagation** — recursive replacements preserve and |
14 | | - propagate the requested form upward when child operands already share it. |
15 | | - |
16 | | -### Changes |
17 | | - |
18 | | -- **ReplaceOptions.canonical is deprecated** — prefer `form`; specifying both |
19 | | - `form` and `canonical` now raises an error. |
20 | 1 | ### [Unreleased] |
21 | 2 |
|
| 3 | +- **`ReplaceOptions.form` replaces `canonical`** — `expr.replace()` and rule |
| 4 | + application now accept a `form` option (`'canonical'`, `'structural'`, |
| 5 | + `'raw'`, or specific canonical transforms) controlling the form of |
| 6 | + replacements, consistent with `ce.expr()` and `ce.function()`. The |
| 7 | + `canonical` option is deprecated but still accepted as an alias for one |
| 8 | + release; specifying both `form` and `canonical` throws an error. |
| 9 | + |
| 10 | +- **BREAKING: `replace()` no longer eagerly canonicalizes its result** — the |
| 11 | + requested `form` (or, by default, the form produced by the rule) applies to |
| 12 | + the replaced sub-expressions, not the entire input expression. A |
| 13 | + non-canonical replacement inside a canonical expression now yields a |
| 14 | + non-canonical result; a form propagates upward only when all sibling |
| 15 | + operands already share it. Previously, `replace()` on a canonical expression |
| 16 | + always re-canonicalized the result — which could undo structure a rule had |
| 17 | + deliberately constructed. Call `.canonical` on the result to restore the |
| 18 | + previous behavior. |
| 19 | + |
| 20 | +- **`ReplaceOptions.direction`** — rule application can now traverse operands |
| 21 | + left-to-right (the default, post-order) or right-to-left (reverse |
| 22 | + post-order). Only observable for order-sensitive rules, such as |
| 23 | + `RuleFunction` replacements with index-based logic. |
| 24 | + |
22 | 25 | - **Numeric correctness fixes** — several arithmetic operations produced |
23 | 26 | silently-wrong results: |
24 | 27 | - Complex `pow` (machine precision) used `arg ** n` instead of `arg · n` in |
@@ -1334,8 +1337,8 @@ GPU compile). |
1334 | 1337 | `oklab(L a b / alpha)` syntax, matching the existing `oklch()` support. |
1335 | 1338 | - **GPU compilation**: `ColorMix`, `ColorContrast`, `ContrastingColor`, |
1336 | 1339 | `ColorToColorspace`, and `ColorFromColorspace` now compile to GLSL and WGSL. |
1337 | | - Preamble functions provide sRGB ↔ OKLab ↔ OKLCh conversion, color mixing |
1338 | | - with shorter-arc hue interpolation, and APCA contrast on the GPU. |
| 1340 | + Preamble functions provide sRGB ↔ OKLab ↔ OKLCh conversion, color mixing with |
| 1341 | + shorter-arc hue interpolation, and APCA contrast on the GPU. |
1339 | 1342 | - Added `rgbToHsl()` conversion function. Exported `hslToRgb()` (previously |
1340 | 1343 | private). |
1341 | 1344 |
|
|
0 commit comments