File tree Expand file tree Collapse file tree 8 files changed +81
-0
lines changed
packages/use-sync-external-store Expand file tree Collapse file tree 8 files changed +81
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ const experimentalPackages = [
4747 'react-fs' ,
4848 'react-pg' ,
4949 'react-server-dom-webpack' ,
50+ 'use-sync-external-store' ,
5051] ;
5152
5253module . exports = {
Original file line number Diff line number Diff line change 1+ # use-sync-external-store
2+
3+ Backwards compatible shim for React's ` useSyncExternalStore ` . Works with any React that supports hooks.
4+
5+ Until ` useSyncExternalStore ` is documented, refer to https://github.com/reactwg/react-18/discussions/86
Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) Facebook, Inc. and its affiliates.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
6+ *
7+ * @flow
8+ */
9+
10+ 'use strict' ;
11+
12+ export * from './src/useSyncExternalStore' ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ if ( process . env . NODE_ENV === 'production' ) {
4+ module . exports = require ( './cjs/use-sync-external-store.production.min.js' ) ;
5+ } else {
6+ module . exports = require ( './cjs/use-sync-external-store.development.js' ) ;
7+ }
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " use-sync-external-store" ,
3+ "description" : " Backwards compatible shim for React's useSyncExternalStore. Works with any React that supports hooks." ,
4+ "version" : " 0.0.1" ,
5+ "repository" : {
6+ "type" : " git" ,
7+ "url" : " https://github.com/facebook/react.git" ,
8+ "directory" : " packages/use-sync-external-store"
9+ },
10+ "files" : [
11+ " LICENSE" ,
12+ " README.md" ,
13+ " build-info.json" ,
14+ " index.js" ,
15+ " cjs/"
16+ ],
17+ "license" : " MIT" ,
18+ "peerDependencies" : {
19+ "react" : " ^16.8.0 || ^17.0.0"
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) Facebook, Inc. and its affiliates.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
6+ *
7+ * @emails react-core
8+ */
9+
10+ 'use strict' ;
11+
12+ describe ( 'useSyncExternalStore' , ( ) => {
13+ test ( 'TODO' , ( ) => { } ) ;
14+ } ) ;
Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) Facebook, Inc. and its affiliates.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
6+ *
7+ * @flow
8+ */
9+
10+ export function useSyncExternalStore ( ) {
11+ throw new Error ( 'Not yet implemented' ) ;
12+ }
Original file line number Diff line number Diff line change @@ -684,6 +684,15 @@ const bundles = [
684684 externals : [ 'react' ] ,
685685 } ,
686686
687+ /******* Shim for useSyncExternalState *******/
688+ {
689+ bundleTypes : [ NODE_DEV , NODE_PROD ] ,
690+ moduleType : ISOMORPHIC ,
691+ entry : 'use-sync-external-store' ,
692+ global : 'useSyncExternalStore' ,
693+ externals : [ 'react' ] ,
694+ } ,
695+
687696 /******* React Scheduler (experimental) *******/
688697 {
689698 bundleTypes : [
You can’t perform that action at this time.
0 commit comments