Skip to content

Conversation

osdiab
Copy link
Contributor

@osdiab osdiab commented Apr 21, 2020

What:
Adds speedy() type to StyleSheet type

Why:

How: Added a function to the StyleSheet definitions

Checklist:

  • Documentation N/A

  • Tests N/A

  • Code complete N/A

  • Changeset Not sure?

  • Idk if anything needs to be done for Flow

@changeset-bot
Copy link

changeset-bot bot commented Apr 21, 2020

🦋 Changeset is good to go

Latest commit: 1d3ff39

We got this.

This PR includes changesets to release 4 packages
Name Type
@emotion/css Patch
@emotion/jest Patch
@emotion/react Patch
@emotion/server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Apr 21, 2020

Codecov Report

❗ No coverage uploaded for pull request base (next@58dc08a). Click here to learn what that means.
The diff coverage is n/a.

Impacted Files Coverage Δ
packages/jest-emotion/src/utils.js 98.85% <0.00%> (ø)
packages/babel-plugin-emotion/src/index.js 98.66% <0.00%> (ø)
packages/native/src/styled.js 100.00% <0.00%> (ø)
scripts/test-utils/prod-mode.js 100.00% <0.00%> (ø)
packages/emotion-server/src/index.js 100.00% <0.00%> (ø)
...ages/eslint-plugin-emotion/src/rules/no-vanilla.js 100.00% <0.00%> (ø)
packages/create-emotion-server/src/stream.js 100.00% <0.00%> (ø)
packages/eslint-plugin-emotion/src/index.js 100.00% <0.00%> (ø)
packages/core/src/utils.js 100.00% <0.00%> (ø)
scripts/old-babel-tester/src/index.js 100.00% <0.00%> (ø)
... and 71 more

@Andarist
Copy link
Member

This method is only available when access emotion.sheet:

cache.sheet.speedy = function(value: boolean) {
. It's not part of the core sheet API.

@osdiab
Copy link
Contributor Author

osdiab commented Apr 24, 2020

@Andarist Not sure I follow - are you saying it works when importing from emotion but not from some other place where a StyleSheet object would be present?

@Andarist
Copy link
Member

Yes, the sheet object is being mutated (receives a new method) when emotion instance is being created

@osdiab
Copy link
Contributor Author

osdiab commented Apr 28, 2020

Then does this update work for you @Andarist ?

@Andarist Andarist changed the base branch from master to next July 8, 2020 10:50
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 8, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1d3ff39:

Sandbox Source
Emotion Configuration

@Andarist Andarist changed the title Add sheet.speedy() type to StyleSheet for TypeScript Add speedy method to the TS type declaration of the sheet object available on Emotion instances Jul 8, 2020
@Andarist
Copy link
Member

Andarist commented Jul 8, 2020

@osdiab sorry for the lack of response for quite some time. I've adjusted your PR - so you can take a look at what I have meant as this method only being available on Emotion's sheets and how this should be typed.

@mitchellhamilton could you review this? I'm mostly interested in the approval of the chosen type name (CSSStyleSheet). The rest is quite a no-brainer 😉

@Andarist Andarist requested a review from emmatown July 8, 2020 13:04
@Andarist Andarist merged commit 6d32d82 into emotion-js:next Jul 8, 2020
@github-actions github-actions bot mentioned this pull request Jul 8, 2020
louisgv pushed a commit to louisgv/emotion that referenced this pull request Sep 6, 2020
…lable on Emotion instances (emotion-js#1848)

* Add sheet.speedy() type to StyleSheet

* Stylesheet.speedy is optional

* No semicolon for consistency

* Add speedy method to the TS type declaration of the sheet object available on Emotion instance

* Add changeset

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
@github-actions github-actions bot mentioned this pull request Nov 10, 2020
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.

3 participants