-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Reexport @theme-ui/components from theme-ui #41915
Reexport @theme-ui/components from theme-ui #41915
Conversation
@hasparus Thank you for submitting this PR! 🔔 @erikdstock @ifiokjr @sbardian @pomber @wKovacs64 @prateekkathal - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
@hasparus The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings. Let’s review the numbers, shall we? theme-ui/v*Comparison details for theme-ui/v* 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. theme-ui__components/v*Comparison details for theme-ui__components/v* 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. |
@hasparus I don't think it is a good idea to introduce breaking changes. Maybe we should keep the old keys/properties to support older versions. Please add the below as a comment. DEPRACATED: Not supported after theme-ui:^0.3.* Also, I'd suggest adding tests for the newer versions separately rather than changing the old ones. |
I get the point. It leads to another problem though.
I'd find deprecation comment fitting, if theme-ui added a deprecation warning at runtime. There is no warning, thus, this is a breaking change, and we can either help the user deal with it by removing |
We needed to upgrade required version to 3.5 because @types/theme-ui__components explodes on TS3.4 (due to "as" prop). |
import { Interpolation, SerializedStyles } from '@emotion/serialize'; | ||
export * from '@theme-ui/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 am not sure why this belongs here. The goal is to only make types exportable, not components by itself.
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.
Take a look at https://github.com/system-ui/theme-ui/blob/b0257f0aa3dda6e65482552780fda715783205c3/packages/theme-ui/src/index.js#L18
This is the title of my pull request.
ThemeUI 0.3 reexports @theme-ui/components. We want to provide typings for these reexported components, so we can have typechecking and autoimports while using theme-ui.
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.
@hasparus It seems I completely overlooked the fact that a types/theme-ui components was released by you.
Hmm... I think in that case, my comments are irrelevant!
Thanks for making the PR 👍
Also, just to be clear: The title should rather say,
"Exporting component types from @types/theme-ui__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.
Sorry I didn’t express myself clearly. I assumed "types" is implicit in the context of DefinitelyTyped. A bit lazy of me.
@@ -157,14 +154,6 @@ export interface SxProps { | |||
|
|||
type SxComponent<T extends SxProps = IntrinsicSxElements['div']> = React.ComponentClass<T & { as?: React.ElementType }>; | |||
|
|||
export const Box: SxComponent; |
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.
Again, the goal is to define component props, not make them exportable from the main package itself.
@hasparus It seems like there is a PR sitting for I'd defer merging this PR as the proposed changes might fix older versions of theme-ui types. If a breaking change must be introduced, it should be made ensuring previous builds don't have errors. |
@hasparus One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits or comments. Thank you! |
@hasparus I am gonna wait on the updated version of Styled System types to be merged and will then approve this one. Thanks again for the PR! 👍 |
A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped! |
Please fill in this template.
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).Select one of these and delete the others:
If changing an existing definition:
tslint.json
containing{ "extends": "dtslint/dt.json" }
. If for reason the any rule need to be disabled, disable it for that line using// tslint:disable-next-line [ruleName]
and not for whole package so that the need for disabling can be reviewed.Linked to system-ui/theme-ui#121.