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

Build: Fix the sb-bench CI step #19029

Merged
merged 12 commits into from
Aug 30, 2022
Merged

Build: Fix the sb-bench CI step #19029

merged 12 commits into from
Aug 30, 2022

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Aug 26, 2022

Issue: The CI task of sb-bench was failing.

  • I had to update and sync up the dependencies of playwright with the ones in the image used for the CI runner.
  • I had to fix some issues after the emotion upgrade because I had to regenerate the yarn lockfile to do the above.

related: #18992 I think this replaces it. @Andarist

@ndelangen ndelangen self-assigned this Aug 26, 2022
@ndelangen ndelangen added the maintenance User-facing maintenance tasks label Aug 26, 2022
@ndelangen ndelangen requested a review from shilman August 26, 2022 10:03
@shilman shilman changed the title Tech - fix the sb-bench CI step Build: Fix the sb-bench CI step Aug 26, 2022
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are the king!!! 👑

Emotion changed to use exports map, and esbuild wasn't pivking the right entry anymore,
resulting in react not being detected, and thus not bundled, and thus missing at runtime!

I changed the tsup/esbuild config to prefer the ESM version, and this seems to have fixed the issue.

Many thanks to @anderist for the assist!
…the suggested fix by @anderist

He suggested that 'hiding' the dependency on an export that may or may not exists away from bundlers would solve it.
This is what they do in emotion itself, but esbuild optimizes that away again.
@@ -80,6 +80,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => {
: false,
esbuildOptions: (c) => {
/* eslint-disable no-param-reassign */
c.conditions = ['module'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recheck what kind of an effect does it have on esbuild - is this purely additive to the default conditions? or does it replace them? I think that I was checking this in the past and that this is additive - some default conditions just cant be turned off but I'm not 100% sure.

@Andarist
Copy link
Contributor

related: #18992 I think this replaces it. @Andarist

Yes, this is same-ish - I would still recommend updating the dependency ranges for Emotion deps in package.json files though.

@ndelangen
Copy link
Member Author

So it seems there's a bunch of these missing / broken:
https://www.chromatic.com/test?appId=5da9c7ef6e6df60020a7f102&id=6308f03bd7fcbd4674f94f90

@ndelangen
Copy link
Member Author

@shilman @tmeasday good to merge?

@ndelangen ndelangen merged commit c4bc348 into next Aug 30, 2022
@ndelangen ndelangen deleted the tech/fix-bench branch August 30, 2022 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants