-
Notifications
You must be signed in to change notification settings - Fork 100
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
fix(emotion,shared-types): better TS types for theme objects and their overrides #1780
base: master
Are you sure you want to change the base?
Conversation
…r overrides Also convert some of the final files in the docs app to TS and improve their typing TEST PLAN: Try to make various theme and override objects, they should have nice autocomplete and no errors
@@ -87,3 +141,62 @@ export type { | |||
GenerateStyle, | |||
ComponentStyle | |||
} | |||
/* |
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've left this here intentionally to test this complex type
@@ -29,21 +29,75 @@ import type { | |||
DeepPartial |
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 type changes in this file and the main change
|
@@ -130,4 +130,4 @@ export { Drilldown } from '@instructure/ui-drilldown' | |||
export { SourceCodeEditor } from '@instructure/ui-source-code-editor' | |||
export { TopNavBar } from '@instructure/ui-top-nav-bar' | |||
export { TruncateList } from '@instructure/ui-truncate-list' | |||
export { canvas, canvasHighContrast, instructure } from '@instructure/ui-themes' |
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 was left here from v9... we really need to type check the docs app
@@ -47,6 +46,19 @@ type AllowedPropKeys = Readonly<Array<PropKeys>> | |||
|
|||
type DocumentProps = DocumentOwnProps & WithStyleProps<null, DocumentStyle> | |||
|
|||
// TODO this does not match the TS type either fix or remove |
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 just moved from /__docs__/src/propTypes.js
// matches whitespace at the end of a string | ||
line.replace(/\s*$/, '') |
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 think .replace() does not change the original string, so the whitespace isn't actually removed. The result should be reassigned e.g.: line = line.replace(/\s*$/, '')
Also convert some of the final files in the docs app to TS and improve their typing
TEST PLAN:
Try to make various theme and override objects, they should have nice autocomplete and no errors