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

Fix & upgrade benchmarks #2544

Merged
merged 6 commits into from Nov 14, 2021
Merged

Conversation

srmagura
Copy link
Member

What/How

  • yarn install in the Emotion repository fails on Windows if only Visual Studio 2022 is installed. scripts/benchmarks depended on parcel@1.x.x which depends on deasync which failed to build because it used a version of node-gyp that didn't know about the new version of Visual Studio.
    • Solution: Upgrade to Parcel 2. Fix a few runtime errors in the benchmark app that resulted from the upgrade.
  • Benchmark app still didn't work — it seemed like it was coded against an older version of react-native-web than what was actually installed.
    • Solution: Upgrade to the latest react-native-web and tweak benchmark app as necessary.
  • Now the benchmark app works but yarn run-benchmark fails with ERR_INVALID_REDIRECT when trying to access the web page.
    • Solution: Upgrade to the latest http-server. Upgrade other dependencies for the sake of modernization.
  • yarn run-benchmark doesn't run against emotion-styled.
    • Solution: Add emotion-styled to the list of libraries to test.
  • Then I ran the ssr-benchmark which failed because it was CommonJS and it couldn't import the latest version of d3-scale-chromatic which is ESM.
    • Solution: Convert ssr-benchmark code to ESM.
  • ssr-benchmark still fails because it is not passing a key to createCache and because it is trying to read directly from a React context. It looks like this code hadn't been tested against Emotion 11 and recent versions of React.
    • Solution: Pass key to createCache and use useContext.

Why: yarn install and the benchmarks should work 😉

Checklist:

  • Documentation N/A
  • Tests N/A
  • Code complete
  • Changeset N/A

And fix various runtime errors when running the benchmark application
- Upgrade to ES modules
- Fix trying to create an Emotion cache without a key
- Fix trying to read directly from a React context object
This was presumably caused by updating react-native-web from 0.13 to
0.17.
@changeset-bot
Copy link

changeset-bot bot commented Nov 13, 2021

⚠️ No Changeset found

Latest commit: 6e16197

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 13, 2021

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 6e16197:

Sandbox Source
Emotion Configuration

@Andarist Andarist merged commit 3c902cf into emotion-js:main Nov 14, 2021
@srmagura srmagura deleted the upgrade-benchmark branch January 13, 2022 01:42
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.

None yet

2 participants