From 1cfdde819b611c7572ac89cc00d886f07d26b3d7 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 9 Feb 2024 15:52:11 +0200 Subject: [PATCH] don't use lodash (-~300ms speed) --- src/components/panel.style.js | 3 +-- src/services/theme_data/theme_data_3.service.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/panel.style.js b/src/components/panel.style.js index d93792e9..7b7f7ccb 100644 --- a/src/components/panel.style.js +++ b/src/components/panel.style.js @@ -7,8 +7,7 @@ export default { 'Icon', 'Button', 'Input', - 'PanelHeader', - 'DropdownMenu' + 'PanelHeader' ], defaultRules: [ { diff --git a/src/services/theme_data/theme_data_3.service.js b/src/services/theme_data/theme_data_3.service.js index 5083d469..66de974b 100644 --- a/src/services/theme_data/theme_data_3.service.js +++ b/src/services/theme_data/theme_data_3.service.js @@ -1,5 +1,4 @@ import { convert, brightness } from 'chromatism' -import merge from 'lodash.merge' import { alphaBlend, getTextColor, @@ -369,7 +368,7 @@ export const init = (extraRuleset, palette) => { // Inheriting all of the applicable rules const existingRules = ruleset.filter(findRules({ component: component.name, ...combination, parent })) - const { directives: computedDirectives } = existingRules.reduce((acc, rule) => merge(acc, rule), {}) + const computedDirectives = existingRules.map(r => r.directives).reduce((acc, directives) => ({ ...acc, ...directives }), {}) const computedRule = { component: component.name, ...combination,