Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Oct 24, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

ellyxir and others added 5 commits October 24, 2025 18:07
* smoketest version of ralph, basic files

* temporarily use git branch

* ask ralph to use playwright

* telling it how to deploy locally

* how to use smoketest doc

* cleanup formatting for TASKS.md

* added script to run several ralph smoketests and stop them

* clean up to point back to main, ready for landing

* added note to self to clean up sleep infinity later
* Fix: Filter synthetic map params from outer scope derives

Fixes bug where element/index/array leaked into outer scope derives.
Adds special case handling for single non-synthetic dataflow with synthetic map params.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Refactor: Replace heuristics with explicit map callback tracking

Replaces fragile heuristic-based detection of map callbacks with explicit
marking using a shared WeakSet registry. This fixes bugs where synthetic
identifiers (element, index, array) leaked into outer scope derives.

**Problem:**
- ClosureTransformer creates synthetic identifiers without symbols for map params
- OpaqueRefJSXTransformer analyzes transformed AST and needs to distinguish:
  1. Synthetic params INSIDE map callbacks (keep)
  2. Synthetic params that leaked to outer scope (filter out)
- Previous heuristics based on counting dataflows were brittle and error-prone

**Solution:**
1. Add `mapCallbackRegistry: WeakSet<ts.Node>` to TransformationOptions
2. ClosureTransformer marks arrow functions when creating map callbacks
3. OpaqueRefJSXTransformer checks marking to detect map callback scopes
4. Filter logic:
   - Only synthetic dataflows → inside callback (keep all)
   - Mixed synthetic + non-synthetic → check if in marked callback
   - If not in marked callback → filter out synthetic params

**Benefits:**
- Direct knowledge instead of heuristics (no more magic thresholds)
- Clear contract between transformers via shared registry
- More maintainable - reduced from ~130 lines to ~100 lines
- Fixes "element is not defined" runtime errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
…1956)

spec(runner): added more details for OpaqueRef / RegularCell merge
…1958)

* @commontools/html is now a valid jsx-runtime implementation, like
  preact
* @commontools/html is set as the Deno workspace jsx runtime
  * The pattern runtime still uses a global `h` render function that can
    be aligned in the future.
* Removed react/react-dom/@types providing the React jsx runtime
* Hack to support serving `iframe-bootstrap.js`, which has runtime deps
  not in our workspace, by renaming the file extension to work around
  this upstream issue: denoland/deno#27505
  * Removes @babel/standalone, and enables the full removal of React
    deps
…sformed map parameters (#1960)

* Fix: Skip map transformation when map will be inside derive

When a map is nested in an expression with opaque refs (e.g.,
`list.length > 0 && list.map(...)`), the OpaqueRefJSXTransformer wraps
the entire expression in `derive(list, list => ...)`, which unwraps the
array to a plain array. If ClosureTransformer had already transformed
the map to `mapWithPattern`, this causes runtime errors since plain
arrays don't have `mapWithPattern`.

This fix adds `shouldTransformMap()` which uses dataflow analysis to
detect when a map will be inside a derive and skips the transformation,
keeping it as plain `.map()` which works correctly on unwrapped arrays.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Fix: Exclude untransformed map callback parameters from outer derive capture

When a plain .map() call is inside an expression that gets wrapped in derive(),
the map callback parameters should not be treated as opaque parameters for the
purposes of the outer derive. This is because:

1. The map is NOT being transformed to mapWithPattern (stays as plain .map)
2. The callback runs on unwrapped array elements inside the derive
3. The callback parameters are local to that scope, not outer scope variables

This fix modifies getOpaqueCallKindForParameter() to check if a callback was
actually transformed (using context.isMapCallback) before treating its parameters
as opaque. Untransformed callbacks have regular parameters that should not be
captured in outer derives.

Example that's now fixed:
```tsx
{items.map((item) => <div>{item.name && <span>{item.name}</span>}</div>)}
```
Before: derive({ items, item_name: item.name }, ...)  ❌
After: derive({ items }, ...)  ✅

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@pull pull bot locked and limited conversation to collaborators Oct 24, 2025
@pull pull bot added the ⤵️ pull label Oct 24, 2025
@pull pull bot merged commit 36d60c5 into ExaDev:main Oct 24, 2025
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants