-
Notifications
You must be signed in to change notification settings - Fork 401
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
refactor(engine): implementation of wired reform #1417
Conversation
cmpSlots: SlotSet; | ||
cmpTrack: any; | ||
cmpFields: Record<string, any>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a rename since the cmpTrack
was exclusively a hash table for tracked fields, but in general, since they do not overlap, we can just generalize that for all important fields.
@@ -32,7 +35,7 @@ function wireDecorator( | |||
); | |||
} | |||
} | |||
return createTrackedPropertyDescriptor( | |||
return createWiredPropertyDescriptor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using the tracked field for wired fields, we now have a different implementation.
); | ||
} | ||
// making the wired value as readonly | ||
newValue = reactiveMembrane.getReadOnlyProxy(newValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidturissini this is the meat of it. Track uses reactiveMembrane.getProxy
while this is now using reactiveMembrane.getReadOnlyProxy
Benchmark resultsBase commit: lwc-engine-benchmark
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the motivation of this breaking change, @caridy could you give more details?
@caridy it sounds like there's a doc impact. Can you please explain this change with before and after code samples? Thanks in advance. |
yes,. @jbleyleSF @pmdartus this is mostly experimental, to see where we land. |
Closed in favor of #1459 |
EXPERIMENTAL_REFACTOR
Details
First refactor to slowly iron out the way a wire adapter sets values into a wired fields. In this first step, we transform the behavior of the value set into a field from a reactive proxy to a readonly proxy.
Does this PR introduce breaking changes?
Yes, it does introduce breaking changes.
If yes, please describe the impact and migration path for existing applications.
The potential impact here is for someone wiring to a field, and making manual mutations to the value that was wired. The workaround is to split out that logic into a tracked value, while keeping the wired field as set by the adapter.
The PR fulfills these requirements: