-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Properly type serializeStyles for Typescript #1236
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Preview Docs Built with commit 8deafee |
emmatown
approved these changes
Feb 23, 2019
JakeGinnivan
pushed a commit
to JakeGinnivan/emotion
that referenced
this pull request
Sep 28, 2019
4 tasks
JakeGinnivan
pushed a commit
to JakeGinnivan/emotion
that referenced
this pull request
Oct 28, 2019
Andarist
pushed a commit
that referenced
this pull request
Nov 4, 2019
…ompilation (#1501) * Restructured types to greatly reduce number of types created during compilation BREAKING CHANGE: There are a few breaking changes, see below * withTheme now infers types properly and may require removing the manually specified generic parameter * The Theme generic parameter has been removed from a number of types exported from `@emotion/styled` and `@emotion/styled-base`. * Introduced new CreateThemedStyled type which is exported from emotion-theming, use type to create your own themed `styled` export. See updated docs * WithTheme should be imported from emotion-theming * CreateStyledComponentExtrinsic, CreateStyledComponentIntrinsic and CreateStyledComponentBase all have been replaced with CreateStyledComponent * Fixing tests * Fixed a bunch of tests and improved TypeScript docs * Updated a bunch of the TypeScript docs * Removed WithTheme type, not sure it's usage and there is no tests * Few small cleanups around styled-base * Fixed tests in a few more packages * Fixed serialise tests after changes in #1236 * Removed failing redundant test in sheet typescript tests. It is failing with the same compilation error as the previous line, but formatting is causing the test failure * Removed line with expected error, I am not sure the reason it should be failing. * Need to bump the typescript version for styled-base for the union type test * TypeScript tests passing * Upgrade build image version to get newer version of yarn * fix: styled component with static API * Added changes in https://github.com/JakeGinnivan/emotion/pull/1/files to other functions with similar signatures * fix: type issue where styled component passed in * Add some additional tests around theming and fix them * Restrict css function to css interpolation * Fixed emotion-theming linting issue * Reversed some incorrect type changes, withComponent has to include the previous components props otherwise styles on the original component may fail at runtime * Fixed some accidently formatted package.json files * Allowed theming of CreateStyled and StyledTags * Restructured generic type params to make it explicit about what component props should transfer with withComponent and which shouldn't Added tests * Cleaned up some tests and added additional assertions * Default the type of SpecificComponentProps in StyledComponent * Reverted changes around ThemeProvider and added tests * Added changeset * Fixed ThemeProvider after revert * Update tslint rules to fix error * Fixed linting issues * Fixed import path for css and clarified docs * Added comment about fragment shorthand without babel being a typescript limitation * Removed breaking change around some of the internal types It's implementation detail user doesn't need to know * Reverted changes around removing function interpolation from the return types of function interpolation * Renamed Omit to DistributiveOmit To make it clear it's different to the inbuilt Omit * Removed duplicate intersected type * Renamed all usages of SFC to FC * Fixed poor grammar * Ignore lint rule rather than exporting type * Updated generic constraints * Reverted TypeScript version bump in create-emotion types * Sync docs and test code * Constrained Theme to extend {} * Add tests for broken examples in #1298 * Fix typo * Add test which verifies #1226 is fixed by type changes
louisgv
pushed a commit
to louisgv/emotion
that referenced
this pull request
Sep 6, 2020
…ompilation (emotion-js#1501) * Restructured types to greatly reduce number of types created during compilation BREAKING CHANGE: There are a few breaking changes, see below * withTheme now infers types properly and may require removing the manually specified generic parameter * The Theme generic parameter has been removed from a number of types exported from `@emotion/styled` and `@emotion/styled-base`. * Introduced new CreateThemedStyled type which is exported from emotion-theming, use type to create your own themed `styled` export. See updated docs * WithTheme should be imported from emotion-theming * CreateStyledComponentExtrinsic, CreateStyledComponentIntrinsic and CreateStyledComponentBase all have been replaced with CreateStyledComponent * Fixing tests * Fixed a bunch of tests and improved TypeScript docs * Updated a bunch of the TypeScript docs * Removed WithTheme type, not sure it's usage and there is no tests * Few small cleanups around styled-base * Fixed tests in a few more packages * Fixed serialise tests after changes in emotion-js#1236 * Removed failing redundant test in sheet typescript tests. It is failing with the same compilation error as the previous line, but formatting is causing the test failure * Removed line with expected error, I am not sure the reason it should be failing. * Need to bump the typescript version for styled-base for the union type test * TypeScript tests passing * Upgrade build image version to get newer version of yarn * fix: styled component with static API * Added changes in https://github.com/JakeGinnivan/emotion/pull/1/files to other functions with similar signatures * fix: type issue where styled component passed in * Add some additional tests around theming and fix them * Restrict css function to css interpolation * Fixed emotion-theming linting issue * Reversed some incorrect type changes, withComponent has to include the previous components props otherwise styles on the original component may fail at runtime * Fixed some accidently formatted package.json files * Allowed theming of CreateStyled and StyledTags * Restructured generic type params to make it explicit about what component props should transfer with withComponent and which shouldn't Added tests * Cleaned up some tests and added additional assertions * Default the type of SpecificComponentProps in StyledComponent * Reverted changes around ThemeProvider and added tests * Added changeset * Fixed ThemeProvider after revert * Update tslint rules to fix error * Fixed linting issues * Fixed import path for css and clarified docs * Added comment about fragment shorthand without babel being a typescript limitation * Removed breaking change around some of the internal types It's implementation detail user doesn't need to know * Reverted changes around removing function interpolation from the return types of function interpolation * Renamed Omit to DistributiveOmit To make it clear it's different to the inbuilt Omit * Removed duplicate intersected type * Renamed all usages of SFC to FC * Fixed poor grammar * Ignore lint rule rather than exporting type * Updated generic constraints * Reverted TypeScript version bump in create-emotion types * Sync docs and test code * Constrained Theme to extend {} * Add tests for broken examples in emotion-js#1298 * Fix typo * Add test which verifies emotion-js#1226 is fixed by type changes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What:
The first two arguments of serializeStyles are switched in the Typescript types. Should be:
emotion/packages/serialize/src/index.js
Lines 289 to 293 in d3a34b3
Why:
How:
Checklist: