forked from commontoolsinc/labs
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] main from commontoolsinc:main #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 : )