dillon1000/react

Commit

Fix `act` bundle size regression (#19832)

Adds back the `TestUtils.act` implementation that I had removed
in #19745. This version of `act` is implemented in "userspace" (i.e. not
the reconciler), so it doesn't add to the production bundle size.

I had removed this in #19745 in favor of the `act` exported by the
reconciler because I thought we would remove support for `act` in
production in the impending major release. (It currently warns.)

However, we've since decided to continue supporting `act` in prod for
now, so that it doesn't block people from upgrading to v17. We'll drop
support in a future major release.

So, to avoid bloating the production bundle size, we need to move the
public version of `act` back to "userspace", like it was before.

This doesn't negate the main goal of #19745, though, which was to
decouple the public version(s) of `act` from the internal one that we
use to test React itself.
Browse files
Changed paths5 files
First-parent comparison
M packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js ModifiedM packages/react-dom/src/client/ReactDOM.js ModifiedM packages/react-dom/src/test-utils/ReactTestUtils.js ModifiedR packages/react-dom/src/test-utils/ReactTestUtilsAct.js →packages/react-dom/src/test-utils/ReactTestUtilsInternalAct.js RenamedA packages/react-dom/src/test-utils/ReactTestUtilsPublicAct.js Added
Patch

Files changed

Rendering syntax-highlighted changes…