mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 00:20:28 +01:00
This adds a "suspended by" row for each chunk that is referenced from a client reference. So when you select a client component, you can see what bundles will block that client component when loading on the client. This is only done in the browser build since if we added it on the server, it would show up as a blocking resource and while it's possible we expect that a typical server request won't block on loading JS. <img width="664" height="486" alt="Screenshot 2025-08-17 at 3 45 14 PM" src="https://github.com/user-attachments/assets/b1f83445-2a4e-4470-9a20-7cd215ab0482" /> <img width="745" height="678" alt="Screenshot 2025-08-17 at 3 46 58 PM" src="https://github.com/user-attachments/assets/3558eae1-cf34-4e11-9d0e-02ec076356a4" /> Currently this is only included if it ends up wrapped in a lazy like in the typical type position of a Client Component, but there's a general issue that maybe hard references need to transfer their debug info to the parent which can transfer it to the Fiber.
112 lines
2.7 KiB
JavaScript
112 lines
2.7 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',
|
|
WeakRef: 'readonly',
|
|
|
|
Int8Array: 'readonly',
|
|
Uint8Array: 'readonly',
|
|
Uint8ClampedArray: 'readonly',
|
|
Int16Array: 'readonly',
|
|
Uint16Array: 'readonly',
|
|
Int32Array: 'readonly',
|
|
Uint32Array: 'readonly',
|
|
Float32Array: 'readonly',
|
|
Float64Array: 'readonly',
|
|
BigInt64Array: 'readonly',
|
|
BigUint64Array: 'readonly',
|
|
DataView: 'readonly',
|
|
ArrayBuffer: 'readonly',
|
|
|
|
Reflect: 'readonly',
|
|
globalThis: 'readonly',
|
|
|
|
FinalizationRegistry: 'readonly',
|
|
|
|
ScrollTimeline: 'readonly',
|
|
navigation: 'readonly',
|
|
|
|
// Vendor specific
|
|
MSApp: 'readonly',
|
|
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
|
|
// CommonJS / Node
|
|
process: 'readonly',
|
|
setImmediate: 'readonly',
|
|
Buffer: 'readonly',
|
|
// Trusted Types
|
|
trustedTypes: 'readonly',
|
|
|
|
// Scheduler profiling
|
|
TaskController: 'readonly',
|
|
reportError: 'readonly',
|
|
AggregateError: 'readonly',
|
|
|
|
// Flight
|
|
Promise: 'readonly',
|
|
|
|
// Temp
|
|
AsyncLocalStorage: 'readonly',
|
|
async_hooks: 'readonly',
|
|
|
|
// Flight Webpack
|
|
__webpack_chunk_load__: 'readonly',
|
|
__webpack_get_script_filename__: 'readonly',
|
|
__webpack_require__: 'readonly',
|
|
|
|
// Flight Turbopack
|
|
__turbopack_load_by_url__: 'readonly',
|
|
__turbopack_require__: 'readonly',
|
|
|
|
// Flight Parcel
|
|
parcelRequire: 'readonly',
|
|
|
|
// jest
|
|
expect: 'readonly',
|
|
jest: 'readonly',
|
|
|
|
// act
|
|
IS_REACT_ACT_ENVIRONMENT: 'readonly',
|
|
|
|
// Native Scheduler
|
|
nativeRuntimeScheduler: 'readonly',
|
|
|
|
Bun: 'readonly',
|
|
},
|
|
parserOptions: {
|
|
ecmaVersion: 2020,
|
|
sourceType: 'script',
|
|
},
|
|
rules: {
|
|
'no-undef': 'error',
|
|
'no-shadow-restricted-names': 'error',
|
|
'no-restricted-syntax': [
|
|
'error',
|
|
// TODO: Can be removed once we upgrade GCC to a version without `optimizeArgumentsArray` optimization.
|
|
{
|
|
selector: 'Identifier[name=/^JSCompiler_OptimizeArgumentsArray_/]',
|
|
message:
|
|
'Google Closure Compiler optimized `arguments` access. ' +
|
|
'This affects function arity. ' +
|
|
'Create a reference to `arguments` to avoid this optimization',
|
|
},
|
|
],
|
|
},
|
|
|
|
// 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: ['ft-flow', 'jest', 'no-for-of-loops', 'react', 'react-internal'],
|
|
};
|