Skip to content

Commit

Permalink
chore: add comment explaining new error [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Mar 28, 2024
1 parent 2da0b13 commit 5f2cafe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/collections/componentSetBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ export const entryToTypeAndName =
const [typeName, ...name] = rawEntry.split(':').map((entry) => entry.trim());
const type = reg.getTypeByName(typeName);
const parent = reg.getParentType(typeName);
// If a user is requesting a child type that is unaddressable (more common with custom registries to create proper behavior)
// throw an error letting them know to use the entire parent instead
// or if they're requesting a COFT, unadressable without parent, don't throw because the parent could be requested - we don't know at this point
if (type.isAddressable === false && parent !== undefined && !type.unaddressableWithoutParent) {
throw new Error(`Cannot use this type, instead use ${parent.name}`);
}
Expand Down

2 comments on commit 5f2cafe

@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: 5f2cafe Previous: 2da0b13 Ratio
eda-componentSetCreate-linux 183 ms 195 ms 0.94
eda-sourceToMdapi-linux 1927 ms 1964 ms 0.98
eda-sourceToZip-linux 1440 ms 1425 ms 1.01
eda-mdapiToSource-linux 2672 ms 2781 ms 0.96
lotsOfClasses-componentSetCreate-linux 348 ms 349 ms 1.00
lotsOfClasses-sourceToMdapi-linux 3475 ms 3541 ms 0.98
lotsOfClasses-sourceToZip-linux 3090 ms 3172 ms 0.97
lotsOfClasses-mdapiToSource-linux 3339 ms 3361 ms 0.99
lotsOfClassesOneDir-componentSetCreate-linux 617 ms 628 ms 0.98
lotsOfClassesOneDir-sourceToMdapi-linux 6198 ms 6334 ms 0.98
lotsOfClassesOneDir-sourceToZip-linux 5767 ms 5901 ms 0.98
lotsOfClassesOneDir-mdapiToSource-linux 5986 ms 6227 ms 0.96

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: 5f2cafe Previous: 2da0b13 Ratio
eda-componentSetCreate-win32 418 ms 369 ms 1.13
eda-sourceToMdapi-win32 3750 ms 3386 ms 1.11
eda-sourceToZip-win32 2290 ms 2147 ms 1.07
eda-mdapiToSource-win32 6448 ms 5700 ms 1.13
lotsOfClasses-componentSetCreate-win32 932 ms 851 ms 1.10
lotsOfClasses-sourceToMdapi-win32 7850 ms 7275 ms 1.08
lotsOfClasses-sourceToZip-win32 5032 ms 4586 ms 1.10
lotsOfClasses-mdapiToSource-win32 7867 ms 7089 ms 1.11
lotsOfClassesOneDir-componentSetCreate-win32 1636 ms 1474 ms 1.11
lotsOfClassesOneDir-sourceToMdapi-win32 14636 ms 13157 ms 1.11
lotsOfClassesOneDir-sourceToZip-win32 9147 ms 8367 ms 1.09
lotsOfClassesOneDir-mdapiToSource-win32 13736 ms 12898 ms 1.06

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

Please sign in to comment.