logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 1cfdde819b611c7572ac89cc00d886f07d26b3d7
parent 79d2184afa9c04c9f7afb07e1910ae1f9fbdb18d
Author: Henry Jameson <me@hjkos.com>
Date:   Fri,  9 Feb 2024 15:52:11 +0200

don't use lodash (-~300ms speed)

Diffstat:

Msrc/components/panel.style.js3+--
Msrc/services/theme_data/theme_data_3.service.js3+--
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git 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 @@ -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,