From 2d2c36b4cfe5ef9d96f6ce69cf4400cef8ebe5dc Mon Sep 17 00:00:00 2001 From: Aaron Weiker Date: Thu, 30 Apr 2026 07:05:00 -0700 Subject: [PATCH] changelog: 2026-04-30 digest (initial) --- .watermark.json | 4 ++-- changelog/2026-04-30.md | 53 +++++++++++++++++++++++++++-------------- 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/.watermark.json b/.watermark.json index c96e273..d1d10c1 100644 --- a/.watermark.json +++ b/.watermark.json @@ -1,6 +1,6 @@ { - "source_repo": "phoenixframework/phoenix", - "last_digest_sha": "7dc2de3049eb6c3582942040ceb5d53389207ae9", + "source_repo": "elixir-lang/elixir", + "last_digest_sha": "55a3899e75efd579723da1927500b82f206329e4", "last_digest_at": "2026-04-30T14:01:00Z", "last_refresh_sha": null, "last_refresh_at": null diff --git a/changelog/2026-04-30.md b/changelog/2026-04-30.md index 5f19eec..966d12a 100644 --- a/changelog/2026-04-30.md +++ b/changelog/2026-04-30.md @@ -1,27 +1,44 @@ -# Phoenix Digest — 2026-04-30 +# Elixir Digest — 2026-04-30 -## Bug Fixes +## Type System / Gradual Typing -### #6667 — Fix live_title having line breaks (lubien) +### #15324 — Fix invalid type inference on size compare in guards +- **Author:** lukaszsamson +- **Merged:** 2026-04-29 +- Mirror expressions like `tuple_size(x) >= 2` and `2 <= tuple_size(x)` were producing different type inferences. +- Fix introduces `mirror_order/1` helper that correctly flips comparison operators when operands are swapped. +- Impact: Guards with size on the right now correctly infer the same type as left-sided equivalents. -**Merged:** 2026-04-29T17:20:23Z +### #15322 — Fix map union optimization for open maps +- **Author:** gldubc (Guillaume Duboc) +- **Merged:** 2026-04-29 +- Optimizer subtype shortcut incorrectly concluded open map contained by closed map when field types matched. +- Open maps can have extra keys — fix rejects shortcut on tag (open/closed) mismatch. +- Impact: Fixes false type narrowing with unions of open and closed map types. -The `phx.new` generator template had `<.live_title>` content on separate lines. -The HEEx formatter injected literal newlines into the rendered `` tag, -which appeared in link previews on Discord, WhatsApp, and Telegram. +### #15319 — Fix map difference union optimization +- **Author:** gldubc (Guillaume Duboc) +- **Merged:** 2026-04-28 +- Disabled `:union` case of single-key open-map difference optimization. +- Could build invalid union literals causing double negation to leave phantom empty maps. -**Fix:** Collapse the template to a single line with `phx-no-format`, preventing -the formatter from re-introducing whitespace. +## Core / Runtime -**Impact:** Every new Phoenix 1.8 project shipped this cosmetic bug. Users had -to manually add `phx-no-format` as a workaround. +### #15306 — Fix reentrancy of Code.eval_* +- **Author:** lukaszsamson +- **Merged:** 2026-04-28 +- Nested `Code.eval_string` clobbered outer eval's `dbg_callback` and `?elixir_eval_env` in process dict. +- Fix: save/restore pattern (save before, restore in `after` block). +- Discussion: Jonatan Kłosko caught test wasn't testing nested eval; José simplified implementation. +- Lesson: Process dictionary as implicit state = reentrancy bugs. Deliberate trade-off for version decoupling. -**Discussion:** Issue reported and PR landed same day. SteffenDE (core team) -requested the PR, lubien delivered within the hour. +### #15316 — Consistently return path as binary in relative_to_cwd +- **Author:** lukaszsamson +- **Merged:** 2026-04-28 +- `Path.relative_to_cwd/1` could return chardata on `:file.get_cwd` failure. +- All code paths now normalize to binary. -- [PR #6667](https://github.com/phoenixframework/phoenix/pull/6667) -- [Issue #6666](https://github.com/phoenixframework/phoenix/issues/6666) +## Patterns to Extract ---- - -*Light day. One quick community fix.* +- **Process dict save/restore for reentrancy** (#15306): When using process dict as implicit state, always save/restore in try/after to handle reentrancy. The Elixir team chose this over closures to avoid coupling eval to specific Elixir versions. +- **Set-theoretic type system edge cases** (#15322, #15319): Open vs closed map distinction is subtle in BDD-based type representations. Subtype checks must respect structural tags, not just field types.