mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
cce18e3504
This extends the scope of the cache and fetch instrumentation using AsyncLocalStorage for microtasks. This is an intermediate step. It sets up the dispatcher only once. This is unique to RSC because it uses the react.shared-subset module for its shared state. Ideally we should support multiple renderers. We should also have this take over from an outer SSR's instrumented fetch. We should also be able to have a fallback to global state per request where AsyncLocalStorage doesn't exist and then the whole client-side solutions. I'm still figuring out the right wiring for that so this is a temporary hack.
69 lines
1.5 KiB
JavaScript
69 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
env: {
|
|
commonjs: true,
|
|
browser: true,
|
|
},
|
|
globals: {
|
|
// ES 6
|
|
BigInt: 'readonly',
|
|
Map: 'readonly',
|
|
Set: 'readonly',
|
|
Proxy: 'readonly',
|
|
Symbol: 'readonly',
|
|
WeakMap: 'readonly',
|
|
WeakSet: 'readonly',
|
|
Uint16Array: 'readonly',
|
|
Reflect: 'readonly',
|
|
globalThis: 'readonly',
|
|
// Vendor specific
|
|
MSApp: 'readonly',
|
|
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
|
|
// CommonJS / Node
|
|
process: 'readonly',
|
|
setImmediate: 'readonly',
|
|
Buffer: 'readonly',
|
|
// Trusted Types
|
|
trustedTypes: 'readonly',
|
|
|
|
// Scheduler profiling
|
|
Int32Array: 'readonly',
|
|
ArrayBuffer: 'readonly',
|
|
|
|
TaskController: 'readonly',
|
|
reportError: 'readonly',
|
|
|
|
// Flight
|
|
Uint8Array: 'readonly',
|
|
Promise: 'readonly',
|
|
|
|
// Temp
|
|
AsyncLocalStorage: 'readonly',
|
|
|
|
// Flight Webpack
|
|
__webpack_chunk_load__: 'readonly',
|
|
__webpack_require__: 'readonly',
|
|
|
|
// jest
|
|
expect: 'readonly',
|
|
jest: 'readonly',
|
|
|
|
// act
|
|
IS_REACT_ACT_ENVIRONMENT: 'readonly',
|
|
},
|
|
parserOptions: {
|
|
ecmaVersion: 5,
|
|
sourceType: 'script',
|
|
},
|
|
rules: {
|
|
'no-undef': 'error',
|
|
'no-shadow-restricted-names': 'error',
|
|
},
|
|
|
|
// These plugins aren't used, but eslint complains if an eslint-ignore comment
|
|
// references unused plugins. An alternate approach could be to strip
|
|
// eslint-ignore comments as part of the build.
|
|
plugins: ['jest', 'no-for-of-loops', 'react', 'react-internal'],
|
|
};
|