-
-
Notifications
You must be signed in to change notification settings - Fork 0
Update Dependencies #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Dependencies #178
Conversation
🦋 Changeset detectedLatest commit: dd587c7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
| export const Default: Story = { | ||
| args: { | ||
| trigger: <Button>Open Popover</Button>, | ||
| triggerProps: { asChild: true }, |
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.
We should normalize a pattern for this across the board at some point. A lot of components that use a trigger have different compositional patterns atm.
| {...rest} | ||
| > | ||
| {sections.map((section) => | ||
| match(section) |
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.
ts-pattern tip: If we match on the entire section, and then derive the arms based on destructured props a few cool things happen:
-
Since it knows
sectionTypecan only be eitherpanelorresizeTriggeryou can see below that theexhaustivepattern still works properly. I thought this was pretty cool. You can increase the scope of this (i.e. match on multiple props in the same arm) and it will still provide type safety if you miss a combination. -
The entire
sectionis passed to the return handler and its properties are narrowed in terms of type inference! Which is why we don't need to do any casting for i.e.idin theresizeTriggermatch arm, because it is inferred already based on the matchingsectionType.
Cool stuff!
| (props: PropsWithoutRef<ComponentProps<T>>, ref) => { | ||
| const slotStyles = useContext(StyleContext); | ||
|
|
||
| // eslint-disable-next-line react-hooks/refs |
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.
This is the only line added to this file, the rest was formatting. Happy to dig into this, just didnt want to mess with this file at all as it is used throughout every component. If there is indeed issue here though with this generalized context helper as a whole, it could provide major perf impact in downstream apps, so may be worth digging into in the future!
Co-authored-by: Brian Cooper <20056195+coopbri@users.noreply.github.com>
Co-authored-by: Brian Cooper <20056195+coopbri@users.noreply.github.com>
Co-authored-by: Brian Cooper <20056195+coopbri@users.noreply.github.com>
Description
The main purpose of this PR is updating dependencies (minus storybook related deps) as well as peer dependencies that downstream apps must rely on. A few other changes were made in order to resolve some underlying issues:
itemprop initemPropsonComboboxas it is handled internallySplitterprops and logic to handle breaking changes from the dependency updates as well as provide better type safetyIconto prevent recreation of component classes on every renderuseBreakpointto derive state during render and prevent cascading renders due to synchronoussetStates within effectsTest Steps