-
Notifications
You must be signed in to change notification settings - Fork 402
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): closes #515 by removing lazy init #517
fix(engine): closes #515 by removing lazy init #517
Conversation
@@ -1,5 +1,5 @@ | |||
import { LightningElement, getHostShadowRoot } from "../../framework/html-element"; |
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 one still exhibit the circular issue, but changing the order fixes it for me.
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 like to talk about this. If the import order mater then we still have a circular dependency issue.
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.
Just a suggestion: We should use a tool(for example: https://github.com/pahen/madge) to generate a dependency graph of the modules and remove any cyclic dependencies.
@@ -399,58 +395,54 @@ const globalElmDescriptors: PropertyDescriptorMap = create(null, { | |||
[PatchedFlag]: {} | |||
}); | |||
|
|||
let globalInitialization: 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.
removing the method to just run the code directly during evaluation instead of lazily.
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.
Can we also get rid of this import? https://github.com/salesforce/lwc/blob/master/packages/lwc-engine/src/framework/modules/__tests__/props.spec.ts#L1
@@ -1,5 +1,5 @@ | |||
import { LightningElement, getHostShadowRoot } from "../../framework/html-element"; |
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 like to talk about this. If the import order mater then we still have a circular dependency issue.
|
||
if (process.env.NODE_ENV !== 'production') { | ||
patchLightningElementPrototypeWithRestrictions(BaseElement.prototype); | ||
forEach.call(ElementAOMPropertyNames, (propName: string) => { |
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.
@caridy I assume there a reason for putting this in def.ts
instead of html-element.ts
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.
because this generates two sets, the set that goes into the component proto, and the set that goes into the element proto.
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.
LGTM me from the LightningElement perspective 👍
3d7767e
to
a6e3aa7
Compare
Benchmark resultsBase commit: lwc-engine-benchmark
|
Details
Removes the lazy initialization now that the circular dependencies are not longer an issue after the separation of framework from faux-shadow.
This fixes #515
Does this PR introduce a breaking change?