Skip to content

Commit 0918fc5

Browse files
committed
cleanup
1 parent 4413824 commit 0918fc5

1 file changed

Lines changed: 24 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
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.
201
### [Unreleased]
212

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+
2225
- **Numeric correctness fixes** — several arithmetic operations produced
2326
silently-wrong results:
2427
- Complex `pow` (machine precision) used `arg ** n` instead of `arg · n` in
@@ -1334,8 +1337,8 @@ GPU compile).
13341337
`oklab(L a b / alpha)` syntax, matching the existing `oklch()` support.
13351338
- **GPU compilation**: `ColorMix`, `ColorContrast`, `ContrastingColor`,
13361339
`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.
13391342
- Added `rgbToHsl()` conversion function. Exported `hslToRgb()` (previously
13401343
private).
13411344

0 commit comments

Comments
 (0)