mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 12:20:38 +01:00
* Move useSyncExternalStore shim to a nested entrypoint Also renames `useSyncExternalStoreExtra` to `useSyncExternalStoreWithSelector`. - 'use-sync-external-store/shim' -> A shim for `useSyncExternalStore` that works in React 16 and 17 (any release that supports hooks). The module will first check if the built-in React API exists, before falling back to the shim. - 'use-sync-external-store/with-selector' -> An extended version of `useSyncExternalStore` that also supports `selector` and `isEqual` options. It does _not_ shim `use-sync-external-store`; it composes the built-in React API. **Use this if you only support 18+.** - 'use-sync-external-store/shim/with-selector' -> Same API, but it composes `use-sync-external-store/shim` instead. **Use this for compatibility with 16 and 17.** - 'use-sync-external-store' -> Re-exports React's built-in API. Not meant to be used. It will warn and direct users to either the shim or the built-in API. * Upgrade useSyncExternalStore to alpha channel
34 lines
925 B
JavaScript
34 lines
925 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
'use strict';
|
|
|
|
// Files that are transformed and can use ES6/Flow/JSX.
|
|
const esNextPaths = [
|
|
// Internal forwarding modules
|
|
'packages/*/*.js',
|
|
'packages/*/esm/*.js',
|
|
'packages/use-sync-external-store/shim/**/*.js',
|
|
'packages/use-sync-external-store/with-selector/**/*.js',
|
|
// Source files
|
|
'packages/*/src/**/*.js',
|
|
'packages/dom-event-testing-library/**/*.js',
|
|
'packages/react-interactions/**/*.js',
|
|
'packages/react-interactions/**/*.js',
|
|
'packages/shared/**/*.js',
|
|
// Shims and Flow environment
|
|
'scripts/flow/*.js',
|
|
'scripts/rollup/shims/**/*.js',
|
|
];
|
|
|
|
// Files that we distribute on npm that should be ES5-only.
|
|
const es5Paths = ['packages/*/npm/**/*.js'];
|
|
|
|
module.exports = {
|
|
esNextPaths,
|
|
es5Paths,
|
|
};
|