-
Notifications
You must be signed in to change notification settings - Fork 400
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
fix(engine): live bindings for value and checked properties 3nd attempt #340
fix(engine): live bindings for value and checked properties 3nd attempt #340
Conversation
assert.logError(`Invalid attempt to set property ${key} from ${vm} to ${newValue}. This property was decorated with @api, and can only be changed via the template.`); | ||
} | ||
vmBeingUpdated = null; // releasing the lock | ||
// not need to wrap or check the value since that is happening somewhere else |
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.
not need = no need
} | ||
} else if (process.env.NODE_ENV !== 'production') { |
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 condition was moved up to only run when vmBeingUpdated is not the current vm, which means it is not a controlled mutation. In which case we warn.
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.
This will address the issue in question, but I'm worried it'll open us up to more problems/footguns
Details
Follow up on #312.
As today, manual mutations in regular HTML element are allowed, while manual mutations on custom elements are not allowed, arguing that the element is controlled by the template, and mutations can only be carry on by it.
With this PR we are relaxing this, and only giving them a warning with more details. This facilitate authors to force pushing new values down to other elements that they own.
Does this PR introduce a breaking change?