Repository navigation
Expand file tree
/
Copy pathtsconfig.build.json
More file actions
47 lines (47 loc) · 2.18 KB
/
Copy pathtsconfig.build.json
File metadata and controls
47 lines (47 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"],
"exclude": [
"node_modules",
"dist",
"src/**/*.test.ts",
"src/**/*.test.tsx",
"src/**/__tests__/**",
"conformance",
"bench",
// The codegen spec must never be transpiled. React Native's babel plugin
// rewrites the default export into a static view config only when it sees
// an `ExportDefaultDeclaration` whose callee is `codegenNativeComponent`
// (@react-native/babel-plugin-codegen/index.js:155-160), and tsc's
// CommonJS emit turns that into `exports.default = ...`, which the visitor
// never matches. Nothing in the build reports it: the default export stays
// the runtime `codegenNativeComponent`, which returns
// `requireNativeComponent` (Libraries/Utilities/codegenNativeComponent.js:67-70)
// — dead under bridgeless, where a view config comes from
// `getViewManagerConfig` and that soft-errors to null
// (BridgelessUIManager.js:273-291). What a consumer gets is a run that
// renders with a null view config, an invariant violation
// (ReactNativeViewConfigRegistry.js:122), or — where the require resolves
// to nothing at all — the throw in `RunHost`. The `<Text selectable>`
// fallback that used to absorb both went with the old architecture in
// 0.10.0. Loud at render, silent here, which is why `npm run check:codegen`
// reproduces the transpiled copy as a negative control.
//
// EXCLUDING IT HERE IS NOT ENOUGH ON ITS OWN. `exclude` only filters the
// `include` glob: a file reached by an `import` — even an `import type` —
// is pulled back into the program and emitted anyway (verified with tsc
// 5.5). So nothing that IS built may import this module statically: the
// only way to reach it from `RunHost` is a call-expression `require`,
// which tsc does not follow. `check:codegen` builds this config into a
// scratch directory and fails if the spec reappears in the output.
"src/view/SelectableRunHostNativeComponent.ts"
]
}