Skip to content

Bump deps after releasing 4.15.3#4392

Merged
compulim merged 12 commits intomicrosoft:mainfrom
compulim:bump-deps-4.15.2
Aug 14, 2022
Merged

Bump deps after releasing 4.15.3#4392
compulim merged 12 commits intomicrosoft:mainfrom
compulim:bump-deps-4.15.2

Conversation

@compulim
Copy link
Contributor

@compulim compulim commented Aug 11, 2022

Related to #4388.

Changelog Entry

Changed

Description

Bump dependencies after releasing 4.15.3.

Update to TypeScript triggered some errors which were previously green. The errors are legit and we need fix some typings in our code instead.

Skip-bump react-redux as 8.0.2 is not ES5.

Design

Jest 28 with jest-environment-jsdom and ESM

Most package developers are aware that "package consumed in browser" means "package will be processed by Webpack/ESBuild/Rollup/etc." That means, it is okay to use either CommonJS or ESM for module resolution.

ESM is preferred because it could potentially provide better treeshaking.

Thus, many packages export itself as ESM when the consumer is a browser, i.e. via package.json/exports/./default. For example, uuid is a package which export itself as ES5 + ESM when the consumer is a browser.

When jest-environment-jsdom resolves a package, it pretend to be a browser. That means, packages resolved under jest-environment-jsdom test environment could be ESM, because the package expose ESM for browser.

As jest@28 does not support ESM yet (behind experimental flag), that means, using default configuration, packages resolved by jest-environment-jsdom could be in ESM and Jest will not be able to execute them.

Quick thinking, there are a few ways to solve the issue:

  1. Enable ESM even though it is experimental
  2. Use testEnvironmentOptions with { "customExportConditions": ["node"] } to resolve imports as "node" condition, which is "more likely" to be CommonJS
  3. Modify transformIgnorePattern to whitelist packages that need to be transformed

We are using point 3 because:

  • We don't have a lot of dependencies that export themselves as ESM under browser condition

Specific Changes

  • Run npm run bump on all packages
  • Correct typings in some .ts/.tsx
  • Add jest-environment-jsdom as it is no longer included in jest@28
  • Add react-redux to skipBump as its 8.0.1 is not a ES5 package
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim mentioned this pull request Aug 12, 2022
74 tasks
@compulim compulim added the release Release checklist label Aug 12, 2022
@compulim compulim added this to the release-4.15.4 milestone Aug 12, 2022
@compulim compulim marked this pull request as ready for review August 12, 2022 23:28
@compulim compulim merged commit 87ce14c into microsoft:main Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Release checklist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants