-
-
Notifications
You must be signed in to change notification settings - Fork 270
[all components] Fix type portability #2912
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
Conversation
commit: |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Bundle size report
|
Signed-off-by: atomiks <cc.glows@gmail.com>
| export const MyCheckbox = React.forwardRef<HTMLDivElement, CheckboxProps>(() => { | ||
| return <div />; | ||
| }); |
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.
The main public test for type portability
|
|
||
| export type * from './root/DialogRoot'; | ||
| export type * from './trigger/DialogTrigger'; | ||
| export type * from './portal/DialogPortal'; | ||
| export type * from './popup/DialogPopup'; | ||
| export type * from './backdrop/DialogBackdrop'; | ||
| export type * from './title/DialogTitle'; | ||
| export type * from './description/DialogDescription'; | ||
| export type * from './close/DialogClose'; |
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.
Makes types portable (re-exports top-level types). Namespaces themselves re-export those top-level types so there are no breaking changes
Yes absolutely. That's the reason I named the script |
.github/workflows/ci.yml
Outdated
| - run: pnpm install | ||
| - run: pnpm release:build | ||
| - run: pnpm validate-declarations | ||
| - run: pnpm -F ./test/public-types release:test |
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 and validate-declarations kind of feels more at place in circleci.
Not that it matters that much
97f4dda to
eed9d75
Compare
eed9d75 to
21d20de
Compare
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.
Only sampled a few of the library files for review, but seems solid from code infra POV. Leaving final review to Base UI team.
Co-authored-by: Jan Potoms <2109932+Janpot@users.noreply.github.com> Signed-off-by: atomiks <cc.glows@gmail.com>
Signed-off-by: atomiks <cc.glows@gmail.com>
6d09caa to
f2d6a12
Compare
mnajdova
left a comment
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.
Half way there, will continue but you can keep checking the comments so far.
mnajdova
left a comment
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.
Nice!
Fixes #2881
Fixes #2629
@Janpot, I created a few test files in
test/public-typesto ensure the types are portable. Maybe it should run in CI?With this change, types are visible in Intellisense:
The main import always comes first so pressing Enter will still be correct, at which point you can ignore the top-level types and just use namespaces