peachsim 0.1.2199 → 0.1.2200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/commands/inspect/settling.ts +20 -20
- package/cli/outbound-endpoints.ts +12 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +1421 -1117
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +22 -22
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +45896 -39977
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +50877 -49773
- package/dist-lib/host/fetch-proxy-handler.cjs +16 -4
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +36 -24
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +100 -10
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +16 -4
- package/dist-lib/native-app-identity-project.cjs +14 -2
- package/dist-lib/native-app-identity-project.mjs +14 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +302 -289
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +21 -21
- package/dist-lib/sdk.mjs +21 -21
- package/dist-lib/skills.cjs +3518 -2919
- package/dist-lib/swift-compile.cjs +34 -3
- package/dist-lib/swift-compile.mjs +34 -3
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +41 -7
- package/dist-lib/vite.cjs +16 -4
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/app-prefetch-contract.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +5 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAValueFunction.h +1 -1
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Modules/module.modulemap +1 -0
- package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/UIKitText.apinotes +14 -0
- package/src/android-layout-ids.ts +50 -0
- package/src/android-view-classes.ts +41 -0
- package/src/expo-swift-host.ts +6 -1
- package/src/java-module-abi.ts +2 -0
- package/src/javaAbiContract.ts +2 -0
- package/src/kotlin-app.ts +33 -7
- package/src/kotlin-host.ts +83 -6
- package/src/kotlin-maven-sources.ts +248 -0
- package/src/native-prebuilt.ts +2 -2
- package/src/react-native-core-build.ts +176 -0
- package/src/react-native-core-digest.ts +1 -1
- package/src/react-native-core.ts +24 -7
- package/src/swift-standin-emit.ts +9 -1
- package/src/swift-wasm-prune.ts +41 -3
- package/src/turbo-compile.ts +2 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process'
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
import { cacheDir } from './home-paths'
|
|
5
|
+
import { describeNativeEntry, nativeEntryCache, nativeEntryKey } from './native-prebuilt'
|
|
6
|
+
import {
|
|
7
|
+
reactNativeCoreEntry,
|
|
8
|
+
reactNativeCoreFloor,
|
|
9
|
+
type ReactNativeCoreMode,
|
|
10
|
+
} from './react-native-core'
|
|
11
|
+
import { compileSwiftProjectUnit } from './swift-compile'
|
|
12
|
+
import { swiftModuleToolchain } from './swift-distribution'
|
|
13
|
+
import { isSwiftNativeTranslationUnit, swiftManifestTargets } from './swift-package'
|
|
14
|
+
import { withSwiftRootLock } from './swift-root-lock'
|
|
15
|
+
import { collectTurboCompileInput } from './turbo-compile'
|
|
16
|
+
import { collectTurboSources, prepareTurboSourceDependencies } from './turbo-source'
|
|
17
|
+
|
|
18
|
+
/** builds the React Native core for an installed app into the local
|
|
19
|
+
* native-prebuilt cache, the directory a published entry downloads into, and
|
|
20
|
+
* returns that directory. an entry already in the cache is returned as is. */
|
|
21
|
+
export async function buildReactNativeCore(
|
|
22
|
+
project: string,
|
|
23
|
+
reactNativeRoot: string,
|
|
24
|
+
mode: ReactNativeCoreMode,
|
|
25
|
+
moduleRoot: string,
|
|
26
|
+
): Promise<string> {
|
|
27
|
+
const entry = reactNativeCoreEntry(reactNativeRoot, moduleRoot, mode)
|
|
28
|
+
const directory = nativeEntryCache('react-native', entry.name, entry.key)
|
|
29
|
+
const work = path.join(cacheDir(), 'react-native-core-build', entry.key)
|
|
30
|
+
return withSwiftRootLock(work, async () => {
|
|
31
|
+
if (fs.existsSync(path.join(directory, 'descriptor.json'))) return directory
|
|
32
|
+
const module = { root: moduleRoot, ...swiftModuleToolchain(moduleRoot) }
|
|
33
|
+
const floor = reactNativeCoreFloor(reactNativeRoot)
|
|
34
|
+
await prepareTurboSourceDependencies(reactNativeRoot)
|
|
35
|
+
const codegenDir = path.join(work, 'codegen')
|
|
36
|
+
fs.mkdirSync(work, { recursive: true })
|
|
37
|
+
fs.rmSync(codegenDir, { recursive: true, force: true })
|
|
38
|
+
const collection = await collectTurboSources({
|
|
39
|
+
appRoot: project,
|
|
40
|
+
projectRoot: project,
|
|
41
|
+
reactNativeRoot,
|
|
42
|
+
providers: [],
|
|
43
|
+
codegenDir,
|
|
44
|
+
...(mode === 'turbo-cxx'
|
|
45
|
+
? { reactNativeCore: true }
|
|
46
|
+
: { reactNativeProvider: true }),
|
|
47
|
+
...(mode === 'turbo' ? { turboDispatch: true } : {}),
|
|
48
|
+
})
|
|
49
|
+
const producer = {
|
|
50
|
+
...collection,
|
|
51
|
+
files: { ...collection.files },
|
|
52
|
+
targets: [...collection.targets],
|
|
53
|
+
}
|
|
54
|
+
if (mode === 'turbo') {
|
|
55
|
+
// only the producer executable supplies this host callback; it is absent from the archives.
|
|
56
|
+
producer.targets.push({
|
|
57
|
+
name: 'PeachCoreProducerHost',
|
|
58
|
+
path: 'Sources/PeachCoreProducerHost',
|
|
59
|
+
executable: false,
|
|
60
|
+
languageMode: 5,
|
|
61
|
+
mainActorIsolation: false,
|
|
62
|
+
resources: false,
|
|
63
|
+
clangSettings: [{ tool: 'c', flags: ['-fblocks'] }],
|
|
64
|
+
})
|
|
65
|
+
producer.files['Sources/PeachCoreProducerHost/include/PeachCoreProducerHost.h'] =
|
|
66
|
+
'#pragma once\n'
|
|
67
|
+
producer.files['Sources/PeachCoreProducerHost/Dispatch.m'] =
|
|
68
|
+
'#import <dispatch/dispatch.h>\nvoid peachTurboDispatchAsync(dispatch_block_t block) { dispatch_async(dispatch_get_main_queue(), block); }\n'
|
|
69
|
+
}
|
|
70
|
+
const input = collectTurboCompileInput(producer, null, floor)
|
|
71
|
+
const { compiler: _compiler, recipe: _recipe, ...nativeInputs } = entry.inputs
|
|
72
|
+
const buildRoot = path.join(
|
|
73
|
+
cacheDir(),
|
|
74
|
+
'react-native-core-products',
|
|
75
|
+
nativeEntryKey(nativeInputs),
|
|
76
|
+
)
|
|
77
|
+
await compileSwiftProjectUnit(input, {
|
|
78
|
+
...module,
|
|
79
|
+
moduleRoot: module.root,
|
|
80
|
+
buildRoot,
|
|
81
|
+
intermediates: true,
|
|
82
|
+
})
|
|
83
|
+
const products = path.join(buildRoot, '.build/wasm32-unknown-wasip1/release')
|
|
84
|
+
const emitted = swiftManifestTargets(
|
|
85
|
+
fs.readFileSync(path.join(buildRoot, 'Package.swift'), 'utf8'),
|
|
86
|
+
)
|
|
87
|
+
const libraries: Record<string, string> = {}
|
|
88
|
+
const binaryModules: Record<string, string> = {}
|
|
89
|
+
for (const target of collection.targets) {
|
|
90
|
+
const objects = emitted
|
|
91
|
+
.filter((product) => !product.executable && product.path === target.path)
|
|
92
|
+
.flatMap((product) => {
|
|
93
|
+
const built = path.join(products, `${product.name}.build`)
|
|
94
|
+
return fs
|
|
95
|
+
.readdirSync(built, { recursive: true, encoding: 'utf8' })
|
|
96
|
+
.filter((file) => file.endsWith('.o'))
|
|
97
|
+
.map((file) => path.join(built, file))
|
|
98
|
+
})
|
|
99
|
+
.sort()
|
|
100
|
+
if (objects.length === 0)
|
|
101
|
+
throw new Error(`${target.name}: core build produced no objects`)
|
|
102
|
+
const members = path.join(work, 'members', target.name)
|
|
103
|
+
fs.rmSync(members, { recursive: true, force: true })
|
|
104
|
+
fs.mkdirSync(members, { recursive: true })
|
|
105
|
+
const stripped = objects.map((file, index) => {
|
|
106
|
+
const output = path.join(members, `${index}-${path.basename(file)}`)
|
|
107
|
+
execFileSync(path.join(module.toolchainBin, 'llvm-objcopy'), [
|
|
108
|
+
'--strip-debug',
|
|
109
|
+
file,
|
|
110
|
+
output,
|
|
111
|
+
])
|
|
112
|
+
return output
|
|
113
|
+
})
|
|
114
|
+
const archive = path.join(work, `lib${target.name}.a`)
|
|
115
|
+
fs.rmSync(archive, { force: true })
|
|
116
|
+
execFileSync(path.join(module.toolchainBin, 'llvm-ar'), [
|
|
117
|
+
'rcsD',
|
|
118
|
+
archive,
|
|
119
|
+
...stripped,
|
|
120
|
+
])
|
|
121
|
+
libraries[target.name] = fs.readFileSync(archive).toString('base64')
|
|
122
|
+
const swiftModule = path.join(products, 'Modules', `${target.name}.swiftmodule`)
|
|
123
|
+
if (fs.existsSync(swiftModule)) {
|
|
124
|
+
binaryModules[target.name] = fs.readFileSync(swiftModule).toString('base64')
|
|
125
|
+
collection.files[
|
|
126
|
+
`Sources/TurboCore/include/${target.name}/${target.name}-Swift.h`
|
|
127
|
+
] = fs.readFileSync(
|
|
128
|
+
path.join(buildRoot, '.build/peach-cxx-headers', `${target.name}-Swift.h`),
|
|
129
|
+
'utf8',
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
// keep textually included implementations available to the preprocessor.
|
|
133
|
+
target.exclude = [
|
|
134
|
+
...new Set([
|
|
135
|
+
...(target.exclude ?? []),
|
|
136
|
+
...Object.keys(collection.files)
|
|
137
|
+
.filter(
|
|
138
|
+
(file) =>
|
|
139
|
+
file.startsWith(`${target.path}/`) &&
|
|
140
|
+
(isSwiftNativeTranslationUnit(file) || file.endsWith('.swift')),
|
|
141
|
+
)
|
|
142
|
+
.map((file) => file.slice(target.path.length + 1)),
|
|
143
|
+
]),
|
|
144
|
+
]
|
|
145
|
+
collection.files[`${target.path}/PeachPrebuiltCore.c`] = '\n'
|
|
146
|
+
collection.files[`${target.path}/include/PeachPrebuiltCore.h`] = '#pragma once\n'
|
|
147
|
+
}
|
|
148
|
+
const prebuilt = collectTurboCompileInput(collection, null, floor)
|
|
149
|
+
const core = {
|
|
150
|
+
files: prebuilt.files,
|
|
151
|
+
entry: prebuilt.entry,
|
|
152
|
+
libraries,
|
|
153
|
+
binaryModules,
|
|
154
|
+
staticClangTargets: prebuilt.staticClangTargets ?? [],
|
|
155
|
+
...(prebuilt.headerAliases ? { headerAliases: prebuilt.headerAliases } : {}),
|
|
156
|
+
...(prebuilt.nativeTargets ? { nativeTargets: prebuilt.nativeTargets } : {}),
|
|
157
|
+
}
|
|
158
|
+
// the descriptor lands last, by rename, so a reader never sees a partial entry.
|
|
159
|
+
const staging = `${directory}.${process.pid}.building`
|
|
160
|
+
fs.rmSync(staging, { recursive: true, force: true })
|
|
161
|
+
fs.mkdirSync(staging, { recursive: true })
|
|
162
|
+
const coreFile = path.join(staging, 'core.json')
|
|
163
|
+
fs.writeFileSync(coreFile, JSON.stringify(core))
|
|
164
|
+
const descriptor = describeNativeEntry('react-native', entry.name, entry.inputs, [
|
|
165
|
+
coreFile,
|
|
166
|
+
])
|
|
167
|
+
fs.writeFileSync(path.join(staging, 'descriptor.json'), JSON.stringify(descriptor))
|
|
168
|
+
fs.mkdirSync(path.dirname(directory), { recursive: true })
|
|
169
|
+
fs.rmSync(directory, { recursive: true, force: true })
|
|
170
|
+
fs.renameSync(staging, directory)
|
|
171
|
+
console.error(
|
|
172
|
+
`[peach] React Native core ${entry.name}: built ${collection.targets.length} targets locally`,
|
|
173
|
+
)
|
|
174
|
+
return directory
|
|
175
|
+
})
|
|
176
|
+
}
|
|
@@ -10,7 +10,7 @@ export const REACT_NATIVE_CORE_SOURCES = [
|
|
|
10
10
|
'nitro-dependencies.ts',
|
|
11
11
|
'nitroAdapterContract.ts',
|
|
12
12
|
'podspec-sources.ts',
|
|
13
|
-
'
|
|
13
|
+
'react-native-core-build.ts',
|
|
14
14
|
]
|
|
15
15
|
|
|
16
16
|
export function reactNativeCoreDigest(directory: string): string {
|
package/src/react-native-core.ts
CHANGED
|
@@ -152,17 +152,34 @@ export function reactNativeCoreEntry(
|
|
|
152
152
|
return { name, inputs, key: nativeEntryKey(inputs) }
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
// the published core is a cache of this build: a cli whose compiler or a
|
|
156
|
+
// runtime whose distribution has no published entry yet builds it once into the
|
|
157
|
+
// same local cache instead of refusing the app.
|
|
158
|
+
const building = new Map<string, Promise<string>>()
|
|
159
|
+
|
|
160
|
+
export async function prebuiltReactNativeCore(
|
|
161
|
+
project: string,
|
|
156
162
|
reactNativeRoot: string,
|
|
157
163
|
moduleRoot: string,
|
|
158
164
|
mode: ReactNativeCoreMode,
|
|
159
|
-
): ReactNativeCoreInput {
|
|
165
|
+
): Promise<ReactNativeCoreInput> {
|
|
160
166
|
const entry = reactNativeCoreEntry(reactNativeRoot, moduleRoot, mode)
|
|
161
|
-
|
|
162
|
-
if (!dir)
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
let dir = fetchNativeEntry('react-native', entry.name, entry.key)
|
|
168
|
+
if (!dir) {
|
|
169
|
+
let pending = building.get(entry.key)
|
|
170
|
+
if (!pending) {
|
|
171
|
+
console.error(
|
|
172
|
+
`[peach] no published React Native ${entry.name} core at ${NATIVE_PREBUILT_ORIGIN}/${nativeEntryPrefix('react-native', entry.name, entry.key)}; building it locally`,
|
|
173
|
+
)
|
|
174
|
+
pending = import('./react-native-core-build')
|
|
175
|
+
.then(({ buildReactNativeCore }) =>
|
|
176
|
+
buildReactNativeCore(project, reactNativeRoot, mode, moduleRoot),
|
|
177
|
+
)
|
|
178
|
+
.finally(() => building.delete(entry.key))
|
|
179
|
+
building.set(entry.key, pending)
|
|
180
|
+
}
|
|
181
|
+
dir = await pending
|
|
182
|
+
}
|
|
166
183
|
const file = path.join(dir, 'core.json')
|
|
167
184
|
const descriptor: unknown = JSON.parse(
|
|
168
185
|
fs.readFileSync(path.join(dir, 'descriptor.json'), 'utf8'),
|
|
@@ -1296,8 +1296,16 @@ export function emitSwiftStandin(
|
|
|
1296
1296
|
[...superChain(owner.get(member.identifier.precise) ?? '')].some((at) =>
|
|
1297
1297
|
options.requiredInits?.has(`${pathOf(byId.get(at)!)}.init()`),
|
|
1298
1298
|
)
|
|
1299
|
+
// clang imports an init a class takes from a protocol requirement as
|
|
1300
|
+
// required, which a non-final class must declare to conform
|
|
1301
|
+
const protocolInit =
|
|
1302
|
+
member.kind.identifier === 'swift.init' &&
|
|
1303
|
+
/^c:objc\(pl\)\w+\(im\).*::SYNTHESIZED::c:objc\(cs\)/.test(
|
|
1304
|
+
member.identifier.precise,
|
|
1305
|
+
)
|
|
1299
1306
|
const required =
|
|
1300
|
-
context.inClass &&
|
|
1307
|
+
context.inClass &&
|
|
1308
|
+
(flags.has('required') || requiredInit || restatesRequired || protocolInit)
|
|
1301
1309
|
const final = context.inClass && flags.has('final') ? 'final ' : ''
|
|
1302
1310
|
const mutating = flags.has('mutating')
|
|
1303
1311
|
? 'mutating '
|
package/src/swift-wasm-prune.ts
CHANGED
|
@@ -1070,6 +1070,32 @@ function getModulePrefix(file: string): string {
|
|
|
1070
1070
|
return dash > 0 ? base.slice(0, dash) : base
|
|
1071
1071
|
}
|
|
1072
1072
|
|
|
1073
|
+
// protocol descriptors of the SwiftUI protocols whose conformers declare @State, @Environment and other DynamicProperty fields
|
|
1074
|
+
const SWIFTUI_WRAPPER_HOST_PROTOCOLS = new Set(
|
|
1075
|
+
[
|
|
1076
|
+
'View',
|
|
1077
|
+
'ViewModifier',
|
|
1078
|
+
'App',
|
|
1079
|
+
'Scene',
|
|
1080
|
+
'Gesture',
|
|
1081
|
+
'ToolbarContent',
|
|
1082
|
+
'Commands',
|
|
1083
|
+
'DynamicProperty',
|
|
1084
|
+
].map((name) => `$s7SwiftUI${name.length}${name}Mp`),
|
|
1085
|
+
)
|
|
1086
|
+
|
|
1087
|
+
/** SwiftUI and Combine own the wrappers; any other object keeps its field descriptors when its conformance records reference a protocol whose conformers hold them. */
|
|
1088
|
+
export function keepsSwiftUIReflection(
|
|
1089
|
+
file: string,
|
|
1090
|
+
undefinedSymbols: Iterable<string>,
|
|
1091
|
+
): boolean {
|
|
1092
|
+
if (/^(SwiftUI|Combine|_[A-Za-z0-9]+_SwiftUI)-/.test(path.basename(file))) return true
|
|
1093
|
+
for (const name of undefinedSymbols) {
|
|
1094
|
+
if (SWIFTUI_WRAPPER_HOST_PROTOCOLS.has(name)) return true
|
|
1095
|
+
}
|
|
1096
|
+
return false
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1073
1099
|
export function pruneSwiftWasmLink(
|
|
1074
1100
|
directory: string,
|
|
1075
1101
|
toolchainBin: string,
|
|
@@ -1121,11 +1147,23 @@ export function pruneSwiftWasmLink(
|
|
|
1121
1147
|
const distDir = path.join(moduleRoot, 'lib')
|
|
1122
1148
|
// the app's own struct and class field descriptors stay: SwiftUI attaches
|
|
1123
1149
|
// @State and @StateObject by reflecting the app's view structs.
|
|
1124
|
-
// the shim reflects its own wrappers
|
|
1125
|
-
//
|
|
1150
|
+
// the shim reflects its own wrappers (State, ObservedObject, Published), so SwiftUI, Combine and framework SwiftUI overlays (_StoreKit_SwiftUI) keep their descriptors.
|
|
1151
|
+
// any other object keeps them when it conforms to a SwiftUI protocol whose conformers hold property wrappers: its record references the protocol descriptor.
|
|
1152
|
+
const keepsReflection = new Map<ParsedObject, boolean>()
|
|
1153
|
+
const declaresSwiftUIConformers = (obj: ParsedObject) => {
|
|
1154
|
+
let keeps = keepsReflection.get(obj)
|
|
1155
|
+
if (keeps === undefined) {
|
|
1156
|
+
keeps = keepsSwiftUIReflection(
|
|
1157
|
+
obj.file,
|
|
1158
|
+
obj.symNames.filter((n, i) => n && (obj.symFlags[i]! & 0x10) !== 0),
|
|
1159
|
+
)
|
|
1160
|
+
keepsReflection.set(obj, keeps)
|
|
1161
|
+
}
|
|
1162
|
+
return keeps
|
|
1163
|
+
}
|
|
1126
1164
|
const dropsReflection = (obj: ParsedObject, name: string | undefined) =>
|
|
1127
1165
|
!!name &&
|
|
1128
|
-
|
|
1166
|
+
!declaresSwiftUIConformers(obj) &&
|
|
1129
1167
|
(name.startsWith('l__swift5_reflection_descriptor') ||
|
|
1130
1168
|
(name.startsWith('$s') &&
|
|
1131
1169
|
(name.endsWith('CMF') || name.endsWith('VMF')) &&
|
package/src/turbo-compile.ts
CHANGED
|
@@ -416,7 +416,8 @@ export async function compileTurboModule(options: {
|
|
|
416
416
|
await options.prepareReactNativeCore?.(collection.coreMode, options.moduleRoot)
|
|
417
417
|
linkReactNativeCore(
|
|
418
418
|
collection,
|
|
419
|
-
prebuiltReactNativeCore(
|
|
419
|
+
await prebuiltReactNativeCore(
|
|
420
|
+
options.projectRoot,
|
|
420
421
|
options.reactNativeRoot,
|
|
421
422
|
options.moduleRoot,
|
|
422
423
|
collection.coreMode,
|