-
Notifications
You must be signed in to change notification settings - Fork 54
[WIP] feat: add compose(), caching, converting components to hooks #2229
base: master
Are you sure you want to change the base?
Conversation
Perf comparison
Potential regressions comparing to master
Perf tests with no regressions
Generated by 🚫 dangerJS |
fluentToFabric <= 0.5 && '⚡', | ||
fluentToFabric <= 0.7 && '🦄', | ||
fluentToFabric <= 1 && '🎯', | ||
'🔧', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our "target" is 30% faster. The previous "on target' was displayed when a Fluent component was 30% faster than Fabric.
The 4 levels are fun, but it might make this harder to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted 👍
overrideStyles?: boolean | ||
} | ||
|
||
const COMPOSE_CONFIG_PROP_NAME = '__unstable_config' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this go in the react-theming
package? I thought that was where we were going to have compositional utilities.
We need a package which partners can easily use to compose components and provide a theme, with the least amount of other dependencies in it. This will allow a solid foundation to exist for building out an ecosystem of components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that composition covers only styling aspects 🤔
26cd53b
to
0521e5a
Compare
<> | ||
<Slider /> | ||
<Slider /> | ||
</> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert me plz
const renderIcon = () => { | ||
return Icon.create(icon, { | ||
// @ts-ignore | ||
return ButtonIcon.create(icon, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not sure about the ButtonIcon
component... Maybe in the end we can just combine once the styles for the Icon component + styles for the Button's icon slot and store that as a cache... I am worried that for more complicated component, creating variant for the component will mean creating new variants for each slot, and you may only need to change one style for them...
…dust-ui/react into feat/compose � Conflicts: � packages/state/src/index.ts
…dust-ui/react into feat/compose � Conflicts: � packages/accessibility/src/behaviors/index.ts � packages/react-bindings/src/hooks/useStyles.ts � packages/react-bindings/src/styles/getStyles.ts � packages/react-bindings/src/styles/resolveStylesAndClasses.tsx � packages/react-bindings/test/styles/resolveStylesAndClasses-test.ts � packages/react/src/components/Chat/ChatItem.tsx � packages/react/src/components/Chat/ChatMessage.tsx � packages/react/src/components/Checkbox/Checkbox.tsx � packages/react/src/components/Icon/Icon.tsx � packages/react/src/components/Label/Label.tsx � packages/react/src/components/Slider/Slider.tsx � packages/react/src/components/Status/Status.tsx � packages/react/src/components/Text/Text.tsx � packages/react/src/themes/teams/components/Checkbox/checkboxStyles.ts � packages/react/src/themes/teams/components/Icon/iconStyles.ts � packages/react/src/themes/teams/components/Label/labelStyles.ts � packages/react/src/themes/teams/components/Slider/sliderStyles.ts � packages/react/src/themes/teams/components/Text/textStyles.ts � packages/react/test/specs/components/Checkbox/Checkbox-test.tsx � packages/react/test/specs/components/Icon/Icon-test.tsx � packages/react/test/specs/components/Label/Label-test.tsx � packages/react/test/specs/components/Status/Status-test.tsx � packages/react/test/specs/components/Text/Text-test.tsx � packages/state/src/index.ts
DO NOT REVIEW
EARLY DRAFT
NOTICE
This PR covers too many things. We are going to rebase it, extract and discuss things before merging.