Skip to content
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

Friendlier TypeScript errors. #1002

Merged
merged 23 commits into from
Jun 30, 2020
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7870a45
Add label prop to ThemeUIStyleObject
hasparus Jun 14, 2020
0647c3c
Change core/test/index extension to tsx
hasparus Jun 14, 2020
8e65bd9
Add overloads to merge.all
hasparus Jun 14, 2020
41e2e63
Fix type errors in core/test/index
hasparus Jun 14, 2020
671c4e7
Bump deps to use optional chaining in tests
hasparus Jun 14, 2020
089b302
Use optional chaining in @theme-ui/css tests
hasparus Jun 14, 2020
103d6b9
Report friendlier TypeScript errors in style objects
hasparus Jun 15, 2020
ea8346f
Make @theme-ui/css strict TypeScript
hasparus Jun 15, 2020
8cfdfad
Test that ThemeUIStyleObject errors are not confusing anymore
hasparus Jun 15, 2020
bebb666
Update reexport name
hasparus Jun 15, 2020
120192f
Import * as React in @theme-ui/core
hasparus Jun 15, 2020
8722aab
Remove unused export
hasparus Jun 15, 2020
30c522f
Make test/errors.ts expectSnippet strict
hasparus Jun 17, 2020
89253aa
Export ColorModesScale
hasparus Jun 23, 2020
8cfd2ef
Draft TypeScript chapter for the docs
hasparus Jun 23, 2020
00ff818
Add numeric index signature to ObjectOrArray
hasparus Jun 23, 2020
a5ad143
Remove unused imports
hasparus Jun 23, 2020
9033499
Add exact theme reexport example
hasparus Jun 25, 2020
3836ea1
Reference other pages in docs and add a sentence
hasparus Jun 28, 2020
92b13ec
Merge remote-tracking branch 'origin/master' into better-ts-errors
hasparus Jun 28, 2020
26017d4
Rename ObjectOrArray to Scale
hasparus Jun 28, 2020
b4a883f
Steal jxnblk's paragraph
hasparus Jun 30, 2020
0756514
Update typescript.mdx
hasparus Jun 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unused export
hasparus committed Jun 15, 2020
commit 8722aab62b1518de39175b3a57c4ca82a499c9b6
9 changes: 1 addition & 8 deletions packages/css/src/types.ts
Original file line number Diff line number Diff line change
@@ -43,13 +43,6 @@ interface CSSOthersObjectForCSSObject {
[propertiesName: string]: CSSInterpolation
}

/**
* Map all nested selectors
*/
export interface CSSSelectorObject {
[cssSelector: string]: ThemeUIStyleObject
}

interface AliasesCSSProperties {
/**
* The **`background-color`** CSS property sets the background color of an element.
@@ -468,7 +461,7 @@ export interface VariantProperty {
}

export interface ThemeDerivedStyles {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"use" is already a loaded word in React world. Tell me what you think about the rename.
Another name I considered is ComputedStyle.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emotion calls it FunctionInterpolation, but since we don't do CSS syntax in tagged template literals here, I'm not sure it would makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that UseThemeFunction is not great. I'm good with both ThemeDerivedStyles and ComputedStyles (plural?).

(theme: Theme): Exclude<ThemeUIStyleObject, ThemeDerivedStyles>
(theme: Theme): ThemeUICSSObject
}

export type Label = {