GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Set up use-sync-external-store package (#22202) · react/react@46a0f05

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • ReactVersions.js
  • packages/use-sync-external-store
    • README.md
    • index.js
    • npm
      • index.js
    • package.json
    • src
      • __tests__
        • useSyncExternalStore-test.js
      • useSyncExternalStore.js
  • scripts/rollup
    • bundles.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎ReactVersions.js‎

Copy file name to clipboardExpand all lines: ReactVersions.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

5253
module.exports = {
Collapse file

‎packages/use-sync-external-store/README.md‎

Copy file name to clipboard
+5Lines changed: 5 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
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
Collapse file

‎packages/use-sync-external-store/index.js‎

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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';
Collapse file

‎packages/use-sync-external-store/npm/index.js‎

Copy file name to clipboard
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+
}
Collapse file

‎packages/use-sync-external-store/package.json‎

Copy file name to clipboard
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
}
Collapse file

‎packages/use-sync-external-store/src/__tests__/useSyncExternalStore-test.js‎

Copy file name to clipboard
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
});
Collapse file

‎packages/use-sync-external-store/src/useSyncExternalStore.js‎

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
}
Collapse file

‎scripts/rollup/bundles.js‎

Copy file name to clipboardExpand all lines: scripts/rollup/bundles.js
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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: [

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.