Skip to content
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

Merged
merged 9 commits into from
Aug 31, 2021
Merged

Wr/aura under object main #443

merged 9 commits into from
Aug 31, 2021

Conversation

WillieRuemmele
Copy link
Member

What does this PR do?

When an Aura's .cmp-meta.xml file was under a custom object it would throw a Cannot read property 'id' of undefined error. handle it by refactoring the ensureValidChildren method to the SourceComponent class and call in that scenario

What 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]

@WillieRuemmele WillieRuemmele requested review from a team as code owners August 26, 2021 17:33
* @param registry the metadata registry access
*/
public ensureValidChildren(
compSet?: ComponentSet,
Copy link
Contributor

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?

Copy link
Contributor

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.

* @param registry the metadata registry access
*/
public ensureValidChildren(
compSet?: ComponentSet,
Copy link
Contributor

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 Show resolved Hide resolved
src/resolve/sourceComponent.ts Outdated Show resolved Hide resolved
@shetzel
Copy link
Contributor

shetzel commented Aug 31, 2021

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.

@shetzel shetzel merged commit cc5e471 into main Aug 31, 2021
@shetzel shetzel deleted the wr/AuraUnderObject-Main branch August 31, 2021 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants