-
-
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
Cleanup @emotion/jest entrypoints #1920
Conversation
🦋 Changeset is good to goLatest commit: 77a7c7d We got this. This PR includes changesets to release 1 package
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 |
264322f
to
5419a79
Compare
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 77a7c7d:
|
b53a662
to
c3f28b1
Compare
c3f28b1
to
ac0c35e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a changeset ofc but other than that, LGTM
@mitchellhamilton I've added changesets, could you take a final look? |
.changeset/wet-cycles-fail.md
Outdated
'@emotion/jest': major | ||
--- | ||
|
||
`@emotion/jest/serializer`'s main purpose is compatibility with Jest's `snapshotSerializers` option, so it no longer has a default export. You can import `createSerializer` from the root entry (`@emotion/jest`) and create your own serializer if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume import * as serializer from '@emotion/jest/serializer'
would work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if so, in this changeset and the one for enzyme stuff, explain that they're individual exports now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume import * as serializer from '@emotion/jest/serializer' would work?
Yes, it is used like that somewhere in our tests.
And if so, in this changeset and the one for enzyme stuff, explain that they're individual exports now.
Done - gonna go ahead and merge this PR, but if you have any other comments then please leave them here and I will make sure to address them.
* Cleanup @emotion/jest entrypoints * Do not use strict-export-declare-modifiers rule in TS tests * Add changesets * Tweak changesets
@emotion/jest/serializer
&@emotion/jest/enzyme-serializer
primarily useful for https://jestjs.io/docs/en/configuration#snapshotserializers-arraystring , they now contain only 2 exports needed for that:test
&serialize
@emotion/jest/serializer
@emotion/jest
, it only exports serializer factories now (and matches) - i believe that in presence of@emotion/jest/serializer
this makes more sense and ultimately is a little bit less confusing as the same thing is not exported from different entrypoints using different export specifiers