Skip to content

Commit d1514a1

Browse files
jcfrancobenelan
authored andcommitted
perf: build theme dictionaries in parallel (#11861)
**Related Issue:** N/A ## Summary ✨🏎️✨
1 parent ced6f79 commit d1514a1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/calcite-design-tokens/src/build/format/index-file.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ export const formatIndexFile: FormatFn = async (args) => {
2525
const themes = ["light", "dark"] as const;
2626
const format = options.fileExtension.replace(".", "") as Stylesheet;
2727

28-
const darkDictionary = await dark.getPlatformTokens(options.platform, { cache: true });
29-
const lightDictionary = await light.getPlatformTokens(options.platform, { cache: true });
28+
const [darkDictionary, lightDictionary] = await Promise.all([
29+
dark.getPlatformTokens(options.platform, { cache: true }),
30+
light.getPlatformTokens(options.platform, { cache: true }),
31+
]);
3032

3133
const commonVarFormat = "css";
3234
const varLists = {

packages/calcite-design-tokens/src/build/transforms/value/merge-value.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ const transformValueMergeValues: ValueTransform["transform"] = async (token, con
1717
}
1818

1919
if (!dictionaries) {
20-
const darkDictionary = await dark.getPlatformTokens(options.platform, { cache: true });
21-
const lightDictionary = await light.getPlatformTokens(options.platform, { cache: true });
20+
const [darkDictionary, lightDictionary] = await Promise.all([
21+
dark.getPlatformTokens(options.platform, { cache: true }),
22+
light.getPlatformTokens(options.platform, { cache: true }),
23+
]);
2224

2325
dictionaries = { dark: darkDictionary, light: lightDictionary };
2426
}

0 commit comments

Comments
 (0)