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

This commit is contained in:
Henry Jameson 2024-02-09 15:52:11 +02:00
parent 79d2184afa
commit 1cfdde819b
2 changed files with 2 additions and 4 deletions

View File

@ -7,8 +7,7 @@ export default {
'Icon', 'Icon',
'Button', 'Button',
'Input', 'Input',
'PanelHeader', 'PanelHeader'
'DropdownMenu'
], ],
defaultRules: [ defaultRules: [
{ {

View File

@ -1,5 +1,4 @@
import { convert, brightness } from 'chromatism' import { convert, brightness } from 'chromatism'
import merge from 'lodash.merge'
import { import {
alphaBlend, alphaBlend,
getTextColor, getTextColor,
@ -369,7 +368,7 @@ export const init = (extraRuleset, palette) => {
// Inheriting all of the applicable rules // Inheriting all of the applicable rules
const existingRules = ruleset.filter(findRules({ component: component.name, ...combination, parent })) 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 = { const computedRule = {
component: component.name, component: component.name,
...combination, ...combination,