-
Notifications
You must be signed in to change notification settings - Fork 396
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
feat(versioning): use native custom element lifecycle #3352
Conversation
Edit: added the test, and good thing I did! There was a bug when you had mixed API versions between parent and child components. 😅 |
type: boolean | ||
default: false | ||
default: true |
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 would love to use the integer
type here, but I could not get it to work, and I figured there's little point in debugging Circle CI oddities since we may move away from Circle CI anyway.
|
||
// Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead | ||
// See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174 |
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.
What I'm doing here is a known perf regression (adding the connectedCallback
/ disconnectedCallback
to the prototype). But there is no other way to solve this, so this is just a hit we have to take.
We may be able to solve the perf regression if we do #3202 someday.
068688e
to
375f23e
Compare
5e368d1
to
41407fd
Compare
41407fd
to
670593f
Compare
Details
This is a 4-part PR.
Part 1: basic scaffolding for versioning (#3350)
Part 2: using it in the template compiler (#3351)
Part 3: using it in the runtime (this PR)
Part 4: using it in the Babel plugin (#3354)
I decided to fix #3198 as an example of using API versioning in the client side. Here we have a version number associated with a compiled component, and then individual components may run with native custom element lifecycle or not.
I also went ahead and modified the Karma tests to run with different API versions:
API_VERSION=59 yarn test
. I think this is simpler than using individual feature flags anyway.Fixes #3198
Does this pull request introduce a breaking change?
Does this pull request introduce an observable change?
GUS work item
W-12566318