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

TypeScript definition of EmotionCache has stylis function but no insert function #1990

Closed
RoystonS opened this issue Sep 3, 2020 · 3 comments

Comments

@RoystonS
Copy link
Contributor

RoystonS commented Sep 3, 2020

Current behavior:

The TypeScript typings for EmotionCache contain a method (stylis) that isn't actually present, and are missing an important one (insert) that is.

To reproduce:

Flow typings: https://github.com/emotion-js/emotion/blob/next/packages/utils/src/types.js#L22
TypeScript typings: https://github.com/emotion-js/emotion/blob/next/packages/utils/types/index.d.ts#L18

Expected behavior:

The TypeScript typings should match the Flow ones and reality.

Environment information:

  • emotion version: @emotion/utils 1.0.0-next.0
@Andarist
Copy link
Member

Andarist commented Sep 4, 2020

Good catch - this was available in some v10 betas (

) but it has been removed since then. Would you like to prepare a PR fixing this or should we take care of this?

@RoystonS
Copy link
Contributor Author

RoystonS commented Sep 4, 2020

I thought I was going to need to use insert but it turns I don't. (I've got some code that needs to generate CSS using the same stylis plugins that Emotion has, but I don't seem to be able to get Emotion to do that for me so I'm doing a separate Stylis run.)

I'll chuck a PR together for this little change.

RoystonS pushed a commit to RoystonS/emotion that referenced this issue Sep 5, 2020
Replaced `stylis` function with `insert` function, following
the Flow definition.
Andarist added a commit that referenced this issue Sep 6, 2020
…n-existent `stylis` method with `insert` that is available at runtime (#1999)

* Update TypeScript definition of EmotionCache (#1990)

Replaced `stylis` function with `insert` function, following
the Flow definition.

* Update .changeset/honest-terms-mate.md

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
@Andarist
Copy link
Member

Andarist commented Sep 6, 2020

Got fixed in #1999

@Andarist Andarist closed this as completed Sep 6, 2020
louisgv pushed a commit to louisgv/emotion that referenced this issue Sep 6, 2020
…n-existent `stylis` method with `insert` that is available at runtime (emotion-js#1999)

* Update TypeScript definition of EmotionCache (emotion-js#1990)

Replaced `stylis` function with `insert` function, following
the Flow definition.

* Update .changeset/honest-terms-mate.md

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants