Repository navigation
chore: Update Emotion to v11 - #55736
Conversation
|
Link to Calypso live: https://calypso.live?image=registry.a8c.com/calypso/app:build-13773 |
1c63cd6 to
d2a14d6
Compare
|
This PR modifies the release build for editing-toolkit To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-mMA-p2 |
d2a14d6 to
63bd6ec
Compare
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~499 bytes removed 📉 [gzipped]) DetailsCommon code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~77022 bytes added 📈 [gzipped]) DetailsSections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~2348 bytes added 📈 [gzipped]) DetailsReact components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
sirbrillig
left a comment
There was a problem hiding this comment.
On behalf of Payments: the code looks good and checkout still appears to work and look correct. Thank you!
|
Shouldn't we need to declare a dependency on |
ciampo
left a comment
There was a problem hiding this comment.
Hey Noah, great job! Thank you for looking into the migration to Emotion 11.
Although I'm not directly involved, I've had a look and left a few inline comments :)
According to https://emotion.sh/docs/install, we just need |
Thanks for all the TS tips!! I'll defer to you on those, as I don't have much experience with best practices :) |
13f7b48 to
475cfa1
Compare
There was a problem hiding this comment.
Not for this PR, but I suspect we can remove @emotion/react from here. Probably even remove types entirely.
475cfa1 to
3a0e737
Compare
This reverts commit 672b06d.
It looks like Storybook won't support Emotion 11 for a while, and that potentially may move away from Emotion at some point: storybookjs/storybook#13145 (comment) |
|
After much debugging of the clash between versions of emotion used in storybook and in app, and for those who come after me, I found that storybook has now provided a feature flag to avoid clashing with later versions of emotion: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#emotion11-quasi-compatibility |
Nice find! Edit: Since it's only available in newer versions, I'm looking at doing that in #58880 |
Changes proposed in this Pull Request
Update Emotion packages to v11.
The main changes needed were:
@emotion/core->@emotion/react)@emotion/react, and then importstyleddirectly from@emotion/styled)PropTypesin some cases. Emotion 11 has better typescript support, so if thePropTypesdid not exactly match the typescript types, it would fail. So I removed manualPropTypesdeclarations in two places. (They now rely on the Typescript prop types)Testing instructions
yarnshould succeed locallycomposite-checkout:storybook:startand verify that the components show up in the browser.