-
Notifications
You must be signed in to change notification settings - Fork 104
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
Wr/aura under object main #443
Conversation
src/resolve/sourceComponent.ts
Outdated
* @param registry the metadata registry access | ||
*/ | ||
public ensureValidChildren( | ||
compSet?: ComponentSet, |
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.
all methods using this are passing in a CS. Why not make it required and not have to construct one (and thus avoid importing the registry again?). I'm imagining perf for someone deploying 800+ objects where we have to check the children.
Or do you have some other uses in mind?
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 think we should make this method only about validating the children and remove everything about a ComponentSet. I know that will cause an increase in iteration in some cases but it doesn't make sense for SourceComponents to know about ComponentSets. In fact, I'm questioning the approach we took with fixing this class of bugs. The SourceComponent should never have been created with invalid children in the first place.
src/resolve/sourceComponent.ts
Outdated
* @param registry the metadata registry access | ||
*/ | ||
public ensureValidChildren( | ||
compSet?: ComponentSet, |
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 think we should make this method only about validating the children and remove everything about a ComponentSet. I know that will cause an increase in iteration in some cases but it doesn't make sense for SourceComponents to know about ComponentSets. In fact, I'm questioning the approach we took with fixing this class of bugs. The SourceComponent should never have been created with invalid children in the first place.
I tested a few deploys, retrieves and converts with an aura meta file in a custom object dir and see the error message. Removing the file I could deploy, retrieve, and convert successfully. |
What does this PR do?
When an Aura's
.cmp-meta.xml
file was under a custom object it would throw aCannot read property 'id' of undefined
error. handle it by refactoring theensureValidChildren
method to theSourceComponent
class and call in that scenarioWhat issues does this PR fix or reference?
#forcedotcom/cli#1148, @W-9800691@
Functionality Before
Cannot read property 'id' of undefined
Functionality After
Unexpected child metadata [/Users/william.ruemmele/projects/scratches/dreamhouse-lwc/force-app/main/default/objects/Broker__c/pageTemplate_2_7_3.cmp-meta.xml] found for parent type [CustomObject]