Skip to content

Use WeakMap for curly component capturedArgs instead of symbol-keyed instance properties#21112

Merged
NullVoxPopuli merged 3 commits intonvp/remove-some-ie11-supportfrom
copilot/sub-pr-21079
Feb 21, 2026
Merged

Use WeakMap for curly component capturedArgs instead of symbol-keyed instance properties#21112
NullVoxPopuli merged 3 commits intonvp/remove-some-ie11-supportfrom
copilot/sub-pr-21079

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 21, 2026

Removes prototype-deopt-inducing symbol-keyed property assignments on curly component instances by moving capturedArgs storage into a WeakMap.

Changes

  • curly.ts

    • Removed unused ARGS and HAS_BLOCK symbol exports
    • Added module-private COMPONENT_ARGS_MAP: WeakMap<object, CapturedArguments['named']> to store args per component instance
    • Exported getComponentCapturedArgs(component) for consumers to look up args
    • After ComponentClass.create(props), registers the instance: COMPONENT_ARGS_MAP.set(component, capturedArgs)
  • component.ts

    • PROPERTY_DID_CHANGE now calls getComponentCapturedArgs(this) instead of reading (this as any)[ARGS]
    • Removed stale ARGS import

Before / After

// Before: symbol-keyed property set directly on component instance
props[ARGS] = capturedArgs;
let component = ComponentClass.create(props);
// …
let args = (this as any)[ARGS]; // in PROPERTY_DID_CHANGE

// After: WeakMap, no instance pollution
let component = ComponentClass.create(props);
COMPONENT_ARGS_MAP.set(component, capturedArgs);
// …
let args = getComponentCapturedArgs(this); // in PROPERTY_DID_CHANGE

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 21, 2026 19:35
…onent

Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
…manager

Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove some IE11 support Use WeakMap for curly component capturedArgs instead of symbol-keyed instance properties Feb 21, 2026
Copilot AI requested a review from NullVoxPopuli February 21, 2026 19:40
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review February 21, 2026 19:47
@NullVoxPopuli NullVoxPopuli merged commit 951600d into nvp/remove-some-ie11-support Feb 21, 2026
23 of 27 checks passed
@NullVoxPopuli NullVoxPopuli deleted the copilot/sub-pr-21079 branch February 21, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants