-
Notifications
You must be signed in to change notification settings - Fork 47.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flight specific entry point for react package #20304
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-unstable-index.server.production.min.js'); | ||
} else { | ||
module.exports = require('./cjs/react-unstable-index.server.development.js'); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,24 @@ | |
"umd/", | ||
"jsx-runtime.js", | ||
"jsx-dev-runtime.js", | ||
"unstable-index.server.js", | ||
"unstable-cache.js" | ||
], | ||
"main": "index.js", | ||
"exports": { | ||
".": { | ||
"react-server": "./unstable-index.server.js", | ||
"default": "./index.js" | ||
}, | ||
"./index": { | ||
"react-server": "./unstable-index.server.js", | ||
"default": "./index.js" | ||
}, | ||
"./build-info.json": "./build-info.json", | ||
"./jsx-runtime": "./jsx-runtime.js", | ||
"./jsx-dev-runtime": "./jsx-dev-runtime.js", | ||
"./": "./" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The exports protocol is an allow list so we must list everything we want to expose here. That's actually great because we can explicitly forbid deep linking. Unfortunately our build tooling is using this same file to find things so we need to export everything until we fix that. |
||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/facebook/react.git", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* 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. | ||
* | ||
* @flow | ||
*/ | ||
|
||
export { | ||
Children, | ||
createRef, | ||
forwardRef, | ||
lazy, | ||
memo, | ||
useCallback, | ||
useContext, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. There will likely be a new type of context like a "server context" that's serializable or something like that. |
||
useDebugValue, | ||
useMemo, | ||
useMutableSource as unstable_useMutableSource, | ||
createMutableSource as unstable_createMutableSource, | ||
Fragment, | ||
Profiler, | ||
StrictMode, | ||
Suspense, | ||
createElement, | ||
cloneElement, | ||
isValidElement, | ||
version, | ||
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, | ||
// exposeConcurrentModeAPIs | ||
useDeferredValue as unstable_useDeferredValue, | ||
SuspenseList as unstable_SuspenseList, | ||
unstable_useOpaqueIdentifier, | ||
// enableDebugTracing | ||
unstable_DebugTracingMode, | ||
} from './src/React'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* 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. | ||
* | ||
* @flow | ||
*/ | ||
|
||
throw new Error( | ||
'This entry point is not yet supported outside of experimental channels', | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know this feature existed, that's cool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was thinking the same thing. Just finished reading about it myself.