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

Properly type serializeStyles for Typescript #1236

Merged
merged 1 commit into from
Feb 23, 2019

Conversation

benmerckx
Copy link
Contributor

What:

The first two arguments of serializeStyles are switched in the Typescript types. Should be:

export const serializeStyles = function(
args: Array<Interpolation>,
registered: RegisteredCache | void,
mergedProps: void | Object
): SerializedStyles {

Why:

How:

Checklist:

  • Documentation
  • Tests
  • Code complete

@netlify
Copy link

netlify bot commented Feb 22, 2019

Preview Docs

Built with commit 8deafee

https://deploy-preview-1236--emotion.netlify.com

@emmatown emmatown merged commit 27079e1 into emotion-js:master Feb 23, 2019
JakeGinnivan pushed a commit to JakeGinnivan/emotion that referenced this pull request Sep 28, 2019
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants