Skip to content

Commit

Permalink
chore: refactor, comments
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Oct 18, 2023
1 parent c04f43a commit 852d8a4
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/resolve/adapters/decomposedSourceAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export class DecomposedSourceAdapter extends MixedContentSourceAdapter {
const childTypeId = this.type.children?.suffixes?.[metaXml.suffix];
const triggerIsAChild = !!childTypeId;
const strategy = this.type.strategies?.decomposition;
// look at changing this
if (triggerIsAChild && this.type.children && !this.type.children.types[childTypeId].unaddressableWithoutParent) {
if (strategy === DecompositionStrategy.FolderPerType || isResolvingSource) {
let parent = component;
Expand Down Expand Up @@ -118,21 +117,21 @@ export class DecomposedSourceAdapter extends MixedContentSourceAdapter {
} else if (
triggerIsAChild &&
this.type.children &&
!component &&
this.type.children.types[childTypeId].unaddressableWithoutParent
) {
let parent = component;
if (!parent) {
parent = new SourceComponent(
{
name: baseName(pathToContent),
type: this.type.children.types[childTypeId],
},
this.tree,
this.forceIgnore
);
}
parent.content = pathToContent;
return parent;
// if we're parsing an unaddressableWithoutParent type, and there's no component for it
// it's likely that the parent resides outside of the current package we're building
// e.g. a COT in a managed package, with the COFT in a different package
return new SourceComponent(
{
name: baseName(pathToContent),
type: this.type.children.types[childTypeId],
content: pathToContent,
},
this.tree,
this.forceIgnore
);
} else if (!component) {
// This is most likely metadata found within a CustomObject folder that is not a
// child type of CustomObject. E.g., Layout, SharingRules, ApexClass.
Expand Down

2 comments on commit 852d8a4

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 852d8a4 Previous: c04f43a Ratio
eda-componentSetCreate-linux 329 ms 296 ms 1.11
eda-sourceToMdapi-linux 8266 ms 7823 ms 1.06
eda-sourceToZip-linux 7068 ms 5825 ms 1.21
eda-mdapiToSource-linux 4932 ms 4255 ms 1.16
lotsOfClasses-componentSetCreate-linux 737 ms 572 ms 1.29
lotsOfClasses-sourceToMdapi-linux 11084 ms 9604 ms 1.15
lotsOfClasses-sourceToZip-linux 10341 ms 7745 ms 1.34
lotsOfClasses-mdapiToSource-linux 5643 ms 4041 ms 1.40
lotsOfClassesOneDir-componentSetCreate-linux 1114 ms 924 ms 1.21
lotsOfClassesOneDir-sourceToMdapi-linux 15510 ms 13692 ms 1.13
lotsOfClassesOneDir-sourceToZip-linux 15650 ms 12519 ms 1.25
lotsOfClassesOneDir-mdapiToSource-linux 10051 ms 8221 ms 1.22

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 852d8a4 Previous: c04f43a Ratio
eda-componentSetCreate-win32 574 ms 492 ms 1.17
eda-sourceToMdapi-win32 9910 ms 9128 ms 1.09
eda-sourceToZip-win32 6835 ms 6599 ms 1.04
eda-mdapiToSource-win32 9563 ms 7833 ms 1.22
lotsOfClasses-componentSetCreate-win32 1383 ms 1068 ms 1.29
lotsOfClasses-sourceToMdapi-win32 16134 ms 14306 ms 1.13
lotsOfClasses-sourceToZip-win32 11711 ms 10102 ms 1.16
lotsOfClasses-mdapiToSource-win32 11973 ms 9708 ms 1.23
lotsOfClassesOneDir-componentSetCreate-win32 2347 ms 1895 ms 1.24
lotsOfClassesOneDir-sourceToMdapi-win32 26557 ms 23324 ms 1.14
lotsOfClassesOneDir-sourceToZip-win32 18233 ms 16326 ms 1.12
lotsOfClassesOneDir-mdapiToSource-win32 21487 ms 16940 ms 1.27

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.