peachsim 0.1.2661 → 0.1.2663
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/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 +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +381 -34
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-USJ3U6EV.mjs → acorn-GXZHC6Z5.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-VO3IKPJQ.mjs → chunk-3PLIZHXJ.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-22OE2SDL.mjs → chunk-45GQD2X5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-N6VYW7ST.mjs → chunk-4V256AAR.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ZEV5QATR.mjs → chunk-5OJPOD6B.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YG742NZE.mjs → chunk-5Z5Q5DCY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FH6AZQ3X.mjs → chunk-6X2G46JR.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QLD2VNSE.mjs → chunk-CVAO4T6T.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YR4VALGH.mjs → chunk-DPLKN4VG.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-5ESYNY5Q.mjs → chunk-DUPDKR46.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-C6SGD3HB.mjs → chunk-EC5A4V5T.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MOX3PEKS.mjs → chunk-EDANXB55.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-JZNXRB2R.mjs → chunk-ILEIXGKP.mjs} +25 -2
- package/dist-lib/esm-chunks/{chunk-HIPO6H4T.mjs → chunk-K4YR2DYZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-THDPLOES.mjs → chunk-PZLZRTLG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-I3V626NF.mjs → chunk-QZPLOMNW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WGKY5MW3.mjs → chunk-R53R5E3O.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MKZYIFGO.mjs → chunk-RK2B4K2F.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-AJGC4BJS.mjs → chunk-S4DRFJWS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-445HQCQW.mjs → chunk-VGO6ZEQ4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-B27TGLJK.mjs → chunk-VMEBFOJV.mjs} +19 -16
- package/dist-lib/esm-chunks/{chunk-Z6ZFDHEF.mjs → chunk-W32VR7O3.mjs} +20 -15
- package/dist-lib/esm-chunks/{chunk-RCQC45HG.mjs → chunk-WKSBQPZO.mjs} +19 -1
- package/dist-lib/esm-chunks/{chunk-OVGSRJ47.mjs → chunk-WPZBGLGG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GBUGHBPX.mjs → chunk-WQ2WN5E2.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-TCSPS6GW.mjs → metro-layout-parser-N2EK3E3B.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-5YV2GUJW.mjs → swift-package-prebuilt-RG7C6DZN.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-BZ5NCBGU.mjs → swift-sdk-app-module-42W4DLYA.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-BRZLNRJ6.mjs → swift-sdk-image-JWECDNB5.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-HFFFGL6R.mjs → swift-sdk-image-producer-JYBC3FRT.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +377 -30
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +388 -39
- package/dist-lib/host/fetch-proxy-handler.cjs +43 -15
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +20 -2
- package/dist-lib/native-app-identity-project.mjs +16 -16
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +85 -85
- package/dist-lib/public-origins-lib.json +69 -64
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +8 -8
- package/dist-lib/skills.cjs +388 -39
- package/dist-lib/swift-compile.cjs +57 -12
- package/dist-lib/swift-compile.mjs +12 -12
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +19 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/java-platform/licenses/openjdk.txt +9 -2
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/swift-compile.ts +5 -1
- package/src/swift-root-lock.ts +26 -0
- package/src/swift-sdk-image.ts +13 -8
- package/src/swift-toolchain.ts +18 -0
- package/src/turbo-fabric-app.ts +281 -0
- package/src/turbo-source.ts +30 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2663 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1297,7 +1297,7 @@ var init_src = __esm({
|
|
|
1297
1297
|
var runtime_companion_default;
|
|
1298
1298
|
var init_runtime_companion = __esm({
|
|
1299
1299
|
"runtime-companion.json"() {
|
|
1300
|
-
runtime_companion_default = { abi: 1, sha256: "
|
|
1300
|
+
runtime_companion_default = { abi: 1, sha256: "0ad3faed77929d763ea2b0a67e07d83b2b0f804b2274fbd017286c33d22db5ef", file: "node/cli-0ad3faed77929d763ea2b0a67e07d83b2b0f804b2274fbd017286c33d22db5ef.cjs" };
|
|
1301
1301
|
}
|
|
1302
1302
|
});
|
|
1303
1303
|
|
|
@@ -7230,6 +7230,24 @@ var init_swift_toolchain = __esm({
|
|
|
7230
7230
|
import_node_zlib3 = __toESM(require("node:zlib"), 1);
|
|
7231
7231
|
init_swiftTargetContract();
|
|
7232
7232
|
compilerArchives = {
|
|
7233
|
+
"swift-6.4.0-RELEASE-custom-747babe6f837e240": {
|
|
7234
|
+
identity: "747babe6f837e240",
|
|
7235
|
+
archive: "tar.zst",
|
|
7236
|
+
hosts: {
|
|
7237
|
+
"darwin-arm64": {
|
|
7238
|
+
checksum: "2bc61029a5e9f29e4d8d0ed85936edd72b249821f48e2fbbf602d1424f30aa69",
|
|
7239
|
+
manifest: "4bdb605f2db31b12e507bbc0998e4054226aae1926ff1361d2e1bd6a8f87d14a"
|
|
7240
|
+
},
|
|
7241
|
+
"linux-x64": {
|
|
7242
|
+
checksum: "99b8ee28b2afe719ae02b88b4258a05584b7a1e29bb8d429c925819de0c10144",
|
|
7243
|
+
manifest: "b3e5970647fb2020917fceb4b632d733bb0247523739a6eaebe11d1a96d7e3e4"
|
|
7244
|
+
},
|
|
7245
|
+
"linux-arm64": {
|
|
7246
|
+
checksum: "34ace308eac458cd9c808e3bb8b1689ae02f0dff3f7b9d71ab7cf779e5a0cb78",
|
|
7247
|
+
manifest: "87b337c62eb9c546662c21cb31082995aadb3f1088ca3624a4843ab8137452b3"
|
|
7248
|
+
}
|
|
7249
|
+
}
|
|
7250
|
+
},
|
|
7233
7251
|
"swift-6.4.0-RELEASE-custom-77d2c2623ec68c0c": {
|
|
7234
7252
|
identity: "77d2c2623ec68c0c",
|
|
7235
7253
|
archive: "tar.zst",
|
|
@@ -10073,7 +10091,7 @@ var init_swift_objc_sdk_tree = __esm({
|
|
|
10073
10091
|
|
|
10074
10092
|
// src/swift-compiler-digest.ts
|
|
10075
10093
|
function swiftArchiveCompilerDigestValue() {
|
|
10076
|
-
return true ? "
|
|
10094
|
+
return true ? "1d6a57a8166d9d9b3e8a4b6c03c70b1f73f858a100be595aef34f901cf8433d9" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname, "archive");
|
|
10077
10095
|
}
|
|
10078
10096
|
var import_node_crypto9, import_node_fs20, import_node_path16, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
|
|
10079
10097
|
var init_swift_compiler_digest = __esm({
|
|
@@ -30734,6 +30752,25 @@ function rootLockKey(root) {
|
|
|
30734
30752
|
function swiftRootLocksDir() {
|
|
30735
30753
|
return import_node_path41.default.join((0, import_node_os11.homedir)(), ".peach", "cache", "swift-root-locks");
|
|
30736
30754
|
}
|
|
30755
|
+
function withSwiftRootReadHolds(work) {
|
|
30756
|
+
const holds = [];
|
|
30757
|
+
const release = () => {
|
|
30758
|
+
for (const hold of holds.splice(0)) hold.release();
|
|
30759
|
+
};
|
|
30760
|
+
return swiftRootReadHolds.run(holds, async () => {
|
|
30761
|
+
try {
|
|
30762
|
+
return await work(release);
|
|
30763
|
+
} finally {
|
|
30764
|
+
release();
|
|
30765
|
+
}
|
|
30766
|
+
});
|
|
30767
|
+
}
|
|
30768
|
+
function retainSwiftRootReadHold(hold) {
|
|
30769
|
+
const holds = swiftRootReadHolds.getStore();
|
|
30770
|
+
if (!holds) return false;
|
|
30771
|
+
holds.push(hold);
|
|
30772
|
+
return true;
|
|
30773
|
+
}
|
|
30737
30774
|
function lockDirectoryFor(root) {
|
|
30738
30775
|
const directory2 = import_node_path41.default.join(
|
|
30739
30776
|
swiftRootLocksDir(),
|
|
@@ -30907,10 +30944,11 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
|
|
|
30907
30944
|
(0, import_node_fs43.writeFileSync)(import_node_path41.default.join(directory2, name(held, "released")), "");
|
|
30908
30945
|
}
|
|
30909
30946
|
}
|
|
30910
|
-
var import_node_child_process26, import_node_crypto26, import_node_fs43, import_node_os11, import_node_path41, POLL_MS, INSPECT_ATTEMPTS, START_TOLERANCE_MS, name;
|
|
30947
|
+
var import_node_async_hooks2, import_node_child_process26, import_node_crypto26, import_node_fs43, import_node_os11, import_node_path41, POLL_MS, INSPECT_ATTEMPTS, START_TOLERANCE_MS, name, swiftRootReadHolds;
|
|
30911
30948
|
var init_swift_root_lock = __esm({
|
|
30912
30949
|
"src/swift-root-lock.ts"() {
|
|
30913
30950
|
"use strict";
|
|
30951
|
+
import_node_async_hooks2 = require("node:async_hooks");
|
|
30914
30952
|
import_node_child_process26 = require("node:child_process");
|
|
30915
30953
|
import_node_crypto26 = require("node:crypto");
|
|
30916
30954
|
import_node_fs43 = require("node:fs");
|
|
@@ -30922,6 +30960,7 @@ var init_swift_root_lock = __esm({
|
|
|
30922
30960
|
INSPECT_ATTEMPTS = 5;
|
|
30923
30961
|
START_TOLERANCE_MS = 2e3;
|
|
30924
30962
|
name = (number3, suffix) => `${String(number3).padStart(12, "0")}.${suffix}`;
|
|
30963
|
+
swiftRootReadHolds = new import_node_async_hooks2.AsyncLocalStorage();
|
|
30925
30964
|
}
|
|
30926
30965
|
});
|
|
30927
30966
|
|
|
@@ -31372,20 +31411,23 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
|
|
|
31372
31411
|
}
|
|
31373
31412
|
const work = `${directory2}.work`;
|
|
31374
31413
|
try {
|
|
31375
|
-
return await
|
|
31376
|
-
|
|
31377
|
-
|
|
31378
|
-
|
|
31379
|
-
|
|
31380
|
-
|
|
31381
|
-
|
|
31414
|
+
return await withSwiftRootReadHolds(
|
|
31415
|
+
(releaseFrameworks) => linkSwiftSdkImage(
|
|
31416
|
+
moduleRoot,
|
|
31417
|
+
key2,
|
|
31418
|
+
directory2,
|
|
31419
|
+
work,
|
|
31420
|
+
scopedLookups,
|
|
31421
|
+
imports2,
|
|
31422
|
+
releaseFrameworks
|
|
31423
|
+
)
|
|
31382
31424
|
);
|
|
31383
31425
|
} finally {
|
|
31384
31426
|
(0, import_node_fs45.rmSync)(work, { recursive: true, force: true });
|
|
31385
31427
|
}
|
|
31386
31428
|
});
|
|
31387
31429
|
}
|
|
31388
|
-
async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLookups, imports2) {
|
|
31430
|
+
async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLookups, imports2, releaseFrameworks) {
|
|
31389
31431
|
(0, import_node_fs45.rmSync)(work, { recursive: true, force: true });
|
|
31390
31432
|
(0, import_node_fs45.mkdirSync)(work, { recursive: true });
|
|
31391
31433
|
const toolchain = swiftModuleToolchain(moduleRoot);
|
|
@@ -31586,6 +31628,7 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
|
|
|
31586
31628
|
linkTo("linked", ["-Map", map2, "-o", linked]),
|
|
31587
31629
|
linkTo("relocs", ["--emit-relocs", "-o", withRelocs])
|
|
31588
31630
|
]);
|
|
31631
|
+
releaseFrameworks();
|
|
31589
31632
|
for (const result of links) {
|
|
31590
31633
|
if (result.status === "rejected") throw result.reason;
|
|
31591
31634
|
}
|
|
@@ -40495,7 +40538,7 @@ ${compatShape}` : "";
|
|
|
40495
40538
|
sdk: sdk2,
|
|
40496
40539
|
icu,
|
|
40497
40540
|
prebuilt,
|
|
40498
|
-
readHold
|
|
40541
|
+
readHold: frameworkReadHold
|
|
40499
40542
|
} = await withFrameworkLock(async (slot, frameworkLease) => {
|
|
40500
40543
|
budget.startCompile();
|
|
40501
40544
|
if (slot && swiftFrameworkSlotKey(slot) !== frameworkKey)
|
|
@@ -40546,6 +40589,7 @@ ${compatShape}` : "";
|
|
|
40546
40589
|
readHold: readHold2
|
|
40547
40590
|
};
|
|
40548
40591
|
});
|
|
40592
|
+
let readHold = frameworkReadHold;
|
|
40549
40593
|
const buildOptions = {
|
|
40550
40594
|
env: baseBuildEnv,
|
|
40551
40595
|
maxBuffer: 64 * 1024 * 1024,
|
|
@@ -41024,6 +41068,7 @@ ${compatShape}` : "";
|
|
|
41024
41068
|
if ((0, import_node_fs55.statSync)(linked).size <= 8)
|
|
41025
41069
|
throw new Error("swift-compile: deferred linker produced no executable");
|
|
41026
41070
|
stage("project link verified");
|
|
41071
|
+
if (readHold && retainSwiftRootReadHold(readHold)) readHold = void 0;
|
|
41027
41072
|
return;
|
|
41028
41073
|
}
|
|
41029
41074
|
const output = options2.project ? projectOutputFile(root2, linked, options2.project) : linked;
|
|
@@ -41344,7 +41389,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
|
|
|
41344
41389
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
41345
41390
|
MULTI_MANIFEST_VERSION = 76;
|
|
41346
41391
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
41347
|
-
compilerSourceDigest = true ? "
|
|
41392
|
+
compilerSourceDigest = true ? "a8a1fcc341892ac0e1a3c924e733388ee30478222b3e1839692997c6dd5555a8" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
41348
41393
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
41349
41394
|
MODULE_MAP_RESPONSE_FILE_RUN = 16;
|
|
41350
41395
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
@@ -68419,7 +68464,7 @@ var init_provenance = __esm({
|
|
|
68419
68464
|
import_node_crypto45 = require("node:crypto");
|
|
68420
68465
|
import_node_fs75 = require("node:fs");
|
|
68421
68466
|
import_node_path75 = require("node:path");
|
|
68422
|
-
swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"d6a3228567a46c6d5280895383093889d9b868958a117881061bdd74729a225f","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"facdbeb9de6bb12da4ab4954553edfaadd0e486f1181443138be70c3d8396236","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"523fdfffc0cff95c8df7beeca437622a07d4fd666f0bb22b0ff67d14c42a7b10","swift-package.ts":"05c6cf101fbc944f6684a70db0a9c5aede846b2f0482a6b4a5a0abed737d4658","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"
|
|
68467
|
+
swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"d6a3228567a46c6d5280895383093889d9b868958a117881061bdd74729a225f","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"facdbeb9de6bb12da4ab4954553edfaadd0e486f1181443138be70c3d8396236","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"523fdfffc0cff95c8df7beeca437622a07d4fd666f0bb22b0ff67d14c42a7b10","swift-package.ts":"05c6cf101fbc944f6684a70db0a9c5aede846b2f0482a6b4a5a0abed737d4658","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"692791414734a0fe5949c1d2638941d5de882b8737675deae2e3a49512f2a126","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"c72b724fc497e4cf603c355f86eb3c07c929ad299758cffbc6ff88ed241654c6","xcode-project.ts":"e30510099ee19d34de62d8ae859df53f77594a4ab105fdb5bcd7e005ec9689ca","xcode-target-members.ts":"96f6a9f5567a4fbd9806252229b35b9a451a112b20f70f8c20189ffd428815fd","xcode-json-project.ts":"df6d6db28e0c8cfdf1f480e1e32d35f12c9cf1936642d5dda923889fb18a8fd6","openstep-plist.ts":"da11f86885ef1e25979ad989f332195c113c4b7a43f108e8d36646973430b81b"}') : swiftCoverageSourceDigests((0, import_node_path75.join)(__sootsim_import_meta_dirname, ".."));
|
|
68423
68468
|
}
|
|
68424
68469
|
});
|
|
68425
68470
|
|
|
@@ -87023,7 +87068,7 @@ var init_swift_standin_digest = __esm({
|
|
|
87023
87068
|
];
|
|
87024
87069
|
RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
87025
87070
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
|
|
87026
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
87071
|
+
STANDIN_SOURCE_DIGEST = true ? "052de0fbd3c71d7f303b5bc9cc36a998a980e3c58320282620a45495172d86ad" : standinSourceDigest();
|
|
87027
87072
|
}
|
|
87028
87073
|
});
|
|
87029
87074
|
|
|
@@ -97591,11 +97636,11 @@ async function swiftArtifactAssets(artifact, { sdkUrl, sdkBindingUrl }) {
|
|
|
97591
97636
|
}
|
|
97592
97637
|
return assets2;
|
|
97593
97638
|
}
|
|
97594
|
-
var
|
|
97639
|
+
var import_node_async_hooks3, import_node_child_process60, import_node_crypto69, import_node_fs114, import_node_os24, import_node_path116, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SDK_PATH, SDK_BINDING_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, swiftArtifactDigests, sharedProjects, projectScope, projects, sharedSourceEntries, sourceEntries, sharedXcodeProjects, xcodeProjects, preparedScriptInputs, emptyWasmAssembly, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, layoutScope, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, IOS_SDK_FRAMEWORKS, sdkStartupParts, sdkPieces, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
|
|
97595
97640
|
var init_swift_host = __esm({
|
|
97596
97641
|
"src/swift-host.ts"() {
|
|
97597
97642
|
"use strict";
|
|
97598
|
-
|
|
97643
|
+
import_node_async_hooks3 = require("node:async_hooks");
|
|
97599
97644
|
import_node_child_process60 = require("node:child_process");
|
|
97600
97645
|
import_node_crypto69 = require("node:crypto");
|
|
97601
97646
|
import_node_fs114 = __toESM(require("node:fs"), 1);
|
|
@@ -97653,7 +97698,7 @@ var init_swift_host = __esm({
|
|
|
97653
97698
|
};
|
|
97654
97699
|
swiftArtifactDigests = /* @__PURE__ */ new WeakMap();
|
|
97655
97700
|
sharedProjects = /* @__PURE__ */ new Map();
|
|
97656
|
-
projectScope = new
|
|
97701
|
+
projectScope = new import_node_async_hooks3.AsyncLocalStorage();
|
|
97657
97702
|
projects = () => projectScope.getStore()?.projects ?? sharedProjects;
|
|
97658
97703
|
sharedSourceEntries = /* @__PURE__ */ new Map();
|
|
97659
97704
|
sourceEntries = () => projectScope.getStore()?.sourceEntries ?? sharedSourceEntries;
|
|
@@ -97664,7 +97709,7 @@ var init_swift_host = __esm({
|
|
|
97664
97709
|
XCODE_APP_DIR = "__app__";
|
|
97665
97710
|
XCODE_FRAMEWORKS_DIR = "__frameworks__";
|
|
97666
97711
|
XCODE_PACKAGES_DIR = SWIFT_REMOTE_PACKAGES_DIR;
|
|
97667
|
-
layoutScope = new
|
|
97712
|
+
layoutScope = new import_node_async_hooks3.AsyncLocalStorage();
|
|
97668
97713
|
HOSTED_LIMITS = {
|
|
97669
97714
|
sourceBytes: MAX_SWIFT_COMPILE_SOURCE_BYTES,
|
|
97670
97715
|
resources: MAX_SWIFT_COMPILE_RESOURCES,
|
|
@@ -98286,6 +98331,291 @@ var init_turbo_codegen_intake = __esm({
|
|
|
98286
98331
|
}
|
|
98287
98332
|
});
|
|
98288
98333
|
|
|
98334
|
+
// src/turbo-fabric-app.ts
|
|
98335
|
+
var FABRIC_APP_INCLUDES, FABRIC_APP_PRESENTER, FABRIC_APP_INSTALL, FABRIC_APP_METHODS, FABRIC_APP_TEARDOWN;
|
|
98336
|
+
var init_turbo_fabric_app = __esm({
|
|
98337
|
+
"src/turbo-fabric-app.ts"() {
|
|
98338
|
+
"use strict";
|
|
98339
|
+
FABRIC_APP_INCLUDES = `#import <Block.h>
|
|
98340
|
+
#import <React/RCTScheduler.h>
|
|
98341
|
+
#import <React/RCTSurfacePresenter.h>
|
|
98342
|
+
#include <jsi/JSIDynamic.h>
|
|
98343
|
+
#include <react/renderer/components/view/BaseViewProps.h>
|
|
98344
|
+
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
98345
|
+
#include <react/renderer/core/InstanceHandle.h>
|
|
98346
|
+
#include <react/renderer/core/LayoutableShadowNode.h>
|
|
98347
|
+
#include <react/renderer/mounting/ShadowTree.h>
|
|
98348
|
+
#include <react/renderer/uimanager/UIManager.h>
|
|
98349
|
+
`;
|
|
98350
|
+
FABRIC_APP_PRESENTER = `
|
|
98351
|
+
namespace {
|
|
98352
|
+
extern std::shared_ptr<react::CallInvoker> fabricInvoker;
|
|
98353
|
+
extern std::shared_ptr<react::RuntimeScheduler> fabricScheduler;
|
|
98354
|
+
}
|
|
98355
|
+
|
|
98356
|
+
@interface PeachAppSurfacePresenter : RCTSurfacePresenter
|
|
98357
|
+
@property(nonatomic) std::function<void(const react::MountingTransaction &)> publishMount;
|
|
98358
|
+
@property(nonatomic) std::function<void(react::Tag, folly::dynamic)> publishProps;
|
|
98359
|
+
@property(nonatomic) std::function<void(react::Tag, const std::string &, const folly::dynamic &)> dispatchCommand;
|
|
98360
|
+
@end
|
|
98361
|
+
|
|
98362
|
+
@implementation PeachAppSurfacePresenter
|
|
98363
|
+
- (void)schedulerDidFinishTransaction:(std::shared_ptr<const react::MountingCoordinator>)coordinator {
|
|
98364
|
+
// guest commits can finish outside a React Native scheduler task.
|
|
98365
|
+
fabricInvoker->invokeAsync([](jsi::Runtime &) {
|
|
98366
|
+
fabricScheduler->scheduleWork([](jsi::Runtime &) {});
|
|
98367
|
+
});
|
|
98368
|
+
}
|
|
98369
|
+
|
|
98370
|
+
- (void)schedulerShouldRenderTransactions:(std::shared_ptr<const react::MountingCoordinator>)coordinator {
|
|
98371
|
+
if (auto transaction = coordinator->pullTransaction()) {
|
|
98372
|
+
self.publishMount(*transaction);
|
|
98373
|
+
}
|
|
98374
|
+
}
|
|
98375
|
+
|
|
98376
|
+
- (void)schedulerDidSynchronouslyUpdateViewOnUIThread:(ReactTag)tag props:(folly::dynamic)props {
|
|
98377
|
+
self.publishProps(static_cast<react::Tag>(tag), std::move(props));
|
|
98378
|
+
}
|
|
98379
|
+
|
|
98380
|
+
- (void)schedulerDidDispatchCommand:(const react::ShadowView &)shadowView
|
|
98381
|
+
commandName:(const std::string &)name
|
|
98382
|
+
args:(const folly::dynamic &)args {
|
|
98383
|
+
self.dispatchCommand(shadowView.tag, name, args);
|
|
98384
|
+
}
|
|
98385
|
+
@end
|
|
98386
|
+
|
|
98387
|
+
namespace {
|
|
98388
|
+
using AppNode = std::shared_ptr<const react::ShadowNode>;
|
|
98389
|
+
using AppChildren = std::vector<AppNode>;
|
|
98390
|
+
|
|
98391
|
+
class PeachAppShadowTree {
|
|
98392
|
+
public:
|
|
98393
|
+
PeachAppShadowTree(std::shared_ptr<react::UIManager> manager, const react::ContextContainer &context)
|
|
98394
|
+
: manager_(std::move(manager)), context_(context) {}
|
|
98395
|
+
|
|
98396
|
+
~PeachAppShadowTree() {
|
|
98397
|
+
if (surface_ != 0) manager_->getShadowTreeRegistry().remove(surface_);
|
|
98398
|
+
}
|
|
98399
|
+
|
|
98400
|
+
void commit(jsi::Runtime &rt, react::SurfaceId surface, double width, double height, double scale,
|
|
98401
|
+
bool rtl, const jsi::Array &roots) {
|
|
98402
|
+
react::LayoutConstraints constraints;
|
|
98403
|
+
constraints.maximumSize = {static_cast<react::Float>(width), static_cast<react::Float>(height)};
|
|
98404
|
+
constraints.minimumSize = constraints.maximumSize;
|
|
98405
|
+
constraints.layoutDirection = rtl ? react::LayoutDirection::RightToLeft : react::LayoutDirection::LeftToRight;
|
|
98406
|
+
react::LayoutContext layout;
|
|
98407
|
+
layout.pointScaleFactor = static_cast<react::Float>(scale);
|
|
98408
|
+
layout.viewportSize = constraints.maximumSize;
|
|
98409
|
+
if (surface_ != 0 && surface_ != surface)
|
|
98410
|
+
throw jsi::JSError(rt, "Fabric runtime is already bound to another app surface");
|
|
98411
|
+
if (surface_ == 0) {
|
|
98412
|
+
surface_ = surface;
|
|
98413
|
+
manager_->startEmptySurface(std::make_unique<react::ShadowTree>(surface_, constraints, layout, *manager_, context_));
|
|
98414
|
+
} else if (constraints != constraints_ || layout != layout_) {
|
|
98415
|
+
manager_->getShadowTreeRegistry().visit(surface_, [&](const react::ShadowTree &tree) {
|
|
98416
|
+
tree.commit([&](const react::RootShadowNode &root) {
|
|
98417
|
+
return root.clone({surface_, context_}, constraints, layout);
|
|
98418
|
+
}, {});
|
|
98419
|
+
});
|
|
98420
|
+
}
|
|
98421
|
+
constraints_ = constraints;
|
|
98422
|
+
layout_ = layout;
|
|
98423
|
+
|
|
98424
|
+
std::unordered_map<react::Tag, AppNode> next;
|
|
98425
|
+
auto children = readChildren(rt, roots, next);
|
|
98426
|
+
nodes_.swap(next);
|
|
98427
|
+
manager_->completeSurface(surface_, children,
|
|
98428
|
+
{.enableStateReconciliation = true, .mountSynchronously = false, .source = react::ShadowTree::CommitSource::React});
|
|
98429
|
+
}
|
|
98430
|
+
|
|
98431
|
+
jsi::Value handle(jsi::Runtime &rt, react::Tag tag, const jsi::Value &surface, const jsi::Value &generation) const {
|
|
98432
|
+
auto value = react::valueFromShadowNode(rt, node(rt, tag));
|
|
98433
|
+
auto object = value.getObject(rt);
|
|
98434
|
+
object.setProperty(rt, "__nativeTag", tag);
|
|
98435
|
+
object.setProperty(rt, "__viewTag", tag);
|
|
98436
|
+
object.setProperty(rt, "__surfaceId", surface);
|
|
98437
|
+
object.setProperty(rt, "__surfaceGeneration", generation);
|
|
98438
|
+
return object;
|
|
98439
|
+
}
|
|
98440
|
+
|
|
98441
|
+
void dispatch(jsi::Runtime &rt, react::Tag tag, std::string type, const jsi::Value &payload) const {
|
|
98442
|
+
const auto emitter = std::dynamic_pointer_cast<const react::ViewEventEmitter>(node(rt, tag)->getEventEmitter());
|
|
98443
|
+
if (emitter) emitter->dispatchEvent(std::move(type), jsi::dynamicFromValue(rt, payload));
|
|
98444
|
+
}
|
|
98445
|
+
|
|
98446
|
+
void publish(jsi::Runtime &rt, const react::ShadowViewMutation &mutation, const jsi::Function &apply) const {
|
|
98447
|
+
using Mutation = react::ShadowViewMutation;
|
|
98448
|
+
if (mutation.type != Mutation::Insert && mutation.type != Mutation::Update) return;
|
|
98449
|
+
const auto &view = mutation.newChildShadowView;
|
|
98450
|
+
const auto found = nodes_.find(view.tag);
|
|
98451
|
+
if (found == nodes_.end()) return;
|
|
98452
|
+
const auto newest = manager_->getNewestCloneOfShadowNode(*found->second);
|
|
98453
|
+
const auto *target = dynamic_cast<const react::LayoutableShadowNode *>(newest.get());
|
|
98454
|
+
if (!target) return;
|
|
98455
|
+
const react::ShadowNode *parent = nullptr;
|
|
98456
|
+
if (mutation.parentTag != surface_) {
|
|
98457
|
+
const auto mountedParent = nodes_.find(mutation.parentTag);
|
|
98458
|
+
if (mountedParent != nodes_.end()) parent = mountedParent->second.get();
|
|
98459
|
+
}
|
|
98460
|
+
auto layout = jsi::Value::null();
|
|
98461
|
+
// fabric's differ includes the offsets of ancestors it flattens into the mount parent.
|
|
98462
|
+
const auto targetMetrics = mutation.parentTag == surface_ || parent
|
|
98463
|
+
? manager_->getRelativeLayoutMetrics(*target, parent, {.includeTransform = false})
|
|
98464
|
+
: react::EmptyLayoutMetrics;
|
|
98465
|
+
if (targetMetrics != react::EmptyLayoutMetrics && view.layoutMetrics.frame != targetMetrics.frame) {
|
|
98466
|
+
const auto &frame = view.layoutMetrics.frame;
|
|
98467
|
+
const auto &targetFrame = targetMetrics.frame;
|
|
98468
|
+
auto rect = jsi::Array(rt, 8);
|
|
98469
|
+
double dimensions[] = {frame.origin.x, frame.origin.y, frame.size.width, frame.size.height,
|
|
98470
|
+
targetFrame.origin.x, targetFrame.origin.y, targetFrame.size.width, targetFrame.size.height};
|
|
98471
|
+
for (size_t i = 0; i < 8; ++i) rect.setValueAtIndex(rt, i, dimensions[i]);
|
|
98472
|
+
layout = std::move(rect);
|
|
98473
|
+
}
|
|
98474
|
+
auto props = jsi::Object(rt);
|
|
98475
|
+
if (const auto *style = dynamic_cast<const react::BaseViewProps *>(view.props.get())) {
|
|
98476
|
+
const auto *targetStyle = dynamic_cast<const react::BaseViewProps *>(target->getProps().get());
|
|
98477
|
+
if (targetStyle && style->opacity != targetStyle->opacity) props.setProperty(rt, "opacity", style->opacity);
|
|
98478
|
+
if (targetStyle && style->transform != targetStyle->transform) {
|
|
98479
|
+
auto matrix = jsi::Array(rt, 16);
|
|
98480
|
+
const auto transform = style->resolveTransform(view.layoutMetrics);
|
|
98481
|
+
for (size_t i = 0; i < 16; ++i) matrix.setValueAtIndex(rt, i, transform.matrix[i]);
|
|
98482
|
+
auto operation = jsi::Object(rt);
|
|
98483
|
+
operation.setProperty(rt, "matrix", std::move(matrix));
|
|
98484
|
+
auto entries = jsi::Array(rt, 1);
|
|
98485
|
+
entries.setValueAtIndex(rt, 0, std::move(operation));
|
|
98486
|
+
props.setProperty(rt, "transform", std::move(entries));
|
|
98487
|
+
}
|
|
98488
|
+
}
|
|
98489
|
+
apply.call(rt, view.tag, std::move(props), std::move(layout));
|
|
98490
|
+
}
|
|
98491
|
+
|
|
98492
|
+
private:
|
|
98493
|
+
AppNode node(jsi::Runtime &rt, react::Tag tag) const {
|
|
98494
|
+
if (tag == surface_) {
|
|
98495
|
+
AppNode root;
|
|
98496
|
+
manager_->getShadowTreeRegistry().visit(surface_, [&](const react::ShadowTree &tree) {
|
|
98497
|
+
root = tree.getCurrentRevision().rootShadowNode;
|
|
98498
|
+
});
|
|
98499
|
+
if (root) return root;
|
|
98500
|
+
}
|
|
98501
|
+
auto found = nodes_.find(tag);
|
|
98502
|
+
if (found == nodes_.end()) throw jsi::JSError(rt, "Fabric view is absent from its committed surface");
|
|
98503
|
+
if (auto current = manager_->getNewestCloneOfShadowNode(*found->second)) return current;
|
|
98504
|
+
return found->second;
|
|
98505
|
+
}
|
|
98506
|
+
|
|
98507
|
+
std::shared_ptr<AppChildren> readChildren(jsi::Runtime &rt, const jsi::Array &values,
|
|
98508
|
+
std::unordered_map<react::Tag, AppNode> &next) const {
|
|
98509
|
+
auto children = std::make_shared<AppChildren>();
|
|
98510
|
+
children->reserve(values.size(rt));
|
|
98511
|
+
for (size_t i = 0; i < values.size(rt); ++i) {
|
|
98512
|
+
auto row = values.getValueAtIndex(rt, i).asObject(rt).asArray(rt);
|
|
98513
|
+
if (row.size(rt) != 5) throw jsi::JSError(rt, "invalid Fabric view in app commit");
|
|
98514
|
+
const auto tag = static_cast<react::Tag>(row.getValueAtIndex(rt, 0).asNumber());
|
|
98515
|
+
const auto component = row.getValueAtIndex(rt, 1).asString(rt).utf8(rt);
|
|
98516
|
+
const auto properties = row.getValueAtIndex(rt, 2);
|
|
98517
|
+
const auto instance = row.getValueAtIndex(rt, 3);
|
|
98518
|
+
auto descendants = readChildren(rt, row.getValueAtIndex(rt, 4).asObject(rt).asArray(rt), next);
|
|
98519
|
+
auto existing = nodes_.find(tag);
|
|
98520
|
+
AppNode view;
|
|
98521
|
+
if (existing == nodes_.end()) {
|
|
98522
|
+
auto initial = manager_->createNode(tag, component, surface_, react::RawProps(rt, properties),
|
|
98523
|
+
std::make_shared<react::InstanceHandle>(rt, instance, tag));
|
|
98524
|
+
for (const auto &child : *descendants) manager_->appendChild(initial, child);
|
|
98525
|
+
view = std::move(initial);
|
|
98526
|
+
} else {
|
|
98527
|
+
view = manager_->cloneNode(*existing->second, descendants, react::RawProps(rt, properties));
|
|
98528
|
+
}
|
|
98529
|
+
if (!next.emplace(tag, view).second) throw jsi::JSError(rt, "duplicate Fabric view tag in app commit");
|
|
98530
|
+
children->push_back(std::move(view));
|
|
98531
|
+
}
|
|
98532
|
+
return children;
|
|
98533
|
+
}
|
|
98534
|
+
|
|
98535
|
+
std::shared_ptr<react::UIManager> manager_;
|
|
98536
|
+
const react::ContextContainer &context_;
|
|
98537
|
+
react::SurfaceId surface_ = 0;
|
|
98538
|
+
react::LayoutConstraints constraints_;
|
|
98539
|
+
react::LayoutContext layout_;
|
|
98540
|
+
std::unordered_map<react::Tag, AppNode> nodes_;
|
|
98541
|
+
};
|
|
98542
|
+
|
|
98543
|
+
PeachAppSurfacePresenter *appSurfacePresenter;
|
|
98544
|
+
std::unique_ptr<PeachAppShadowTree> appShadowTree;
|
|
98545
|
+
std::optional<jsi::Function> appMountHandler;
|
|
98546
|
+
std::optional<jsi::Function> appPropsHandler;
|
|
98547
|
+
std::optional<jsi::Function> appCommandHandler;
|
|
98548
|
+
}
|
|
98549
|
+
|
|
98550
|
+
id peachAppSurfacePresenter() {
|
|
98551
|
+
return appSurfacePresenter;
|
|
98552
|
+
}
|
|
98553
|
+
`;
|
|
98554
|
+
FABRIC_APP_INSTALL = `
|
|
98555
|
+
react::RuntimeExecutor execute = [invoker = fabricInvoker](std::function<void(jsi::Runtime &)> &&work) {
|
|
98556
|
+
using RuntimeBlock = void (^)(jsi::Runtime &);
|
|
98557
|
+
if (const auto *block = work.target<RuntimeBlock>()) {
|
|
98558
|
+
// stack blocks need a copy before the executor can queue them.
|
|
98559
|
+
RuntimeBlock owned = (__bridge_transfer RuntimeBlock)_Block_copy((__bridge const void *)*block);
|
|
98560
|
+
work = [owned](jsi::Runtime &rt) { owned(rt); };
|
|
98561
|
+
}
|
|
98562
|
+
invoker->invokeAsync(std::move(work));
|
|
98563
|
+
};
|
|
98564
|
+
appSurfacePresenter = [[PeachAppSurfacePresenter alloc] initWithContextContainer:fabricContext
|
|
98565
|
+
runtimeExecutor:execute bridgelessBindingsExecutor:execute];
|
|
98566
|
+
appShadowTree = std::make_unique<PeachAppShadowTree>(appSurfacePresenter.scheduler.uiManager, *fabricContext);
|
|
98567
|
+
appSurfacePresenter.publishMount = [execute](const react::MountingTransaction &transaction) {
|
|
98568
|
+
execute([surface = transaction.getSurfaceId(), mutations = transaction.getMutations()](jsi::Runtime &rt) {
|
|
98569
|
+
if (appShadowTree && appMountHandler) {
|
|
98570
|
+
for (const auto &mutation : mutations) appShadowTree->publish(rt, mutation, *appMountHandler);
|
|
98571
|
+
[appSurfacePresenter.scheduler reportMount:surface];
|
|
98572
|
+
}
|
|
98573
|
+
});
|
|
98574
|
+
};
|
|
98575
|
+
appSurfacePresenter.publishProps = [execute](react::Tag tag, folly::dynamic props) {
|
|
98576
|
+
execute([tag, props = std::move(props)](jsi::Runtime &rt) {
|
|
98577
|
+
if (appPropsHandler) appPropsHandler->call(rt, tag, jsi::valueFromDynamic(rt, props));
|
|
98578
|
+
});
|
|
98579
|
+
};
|
|
98580
|
+
appSurfacePresenter.dispatchCommand = [execute](react::Tag tag, const std::string &name, const folly::dynamic &args) {
|
|
98581
|
+
execute([tag, name, args](jsi::Runtime &rt) {
|
|
98582
|
+
if (appCommandHandler) appCommandHandler->call(rt, tag, jsi::String::createFromUtf8(rt, name), jsi::valueFromDynamic(rt, args));
|
|
98583
|
+
});
|
|
98584
|
+
};
|
|
98585
|
+
`;
|
|
98586
|
+
FABRIC_APP_METHODS = `
|
|
98587
|
+
method("commitApp", 6, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
|
|
98588
|
+
appShadowTree->commit(rt, static_cast<react::SurfaceId>(args[0].asNumber()), args[1].asNumber(),
|
|
98589
|
+
args[2].asNumber(), args[3].asNumber(), args[4].getBool(), args[5].asObject(rt).asArray(rt));
|
|
98590
|
+
return jsi::Value::undefined();
|
|
98591
|
+
});
|
|
98592
|
+
method("setAppHandlers", 3, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
|
|
98593
|
+
appMountHandler = args[0].asObject(rt).asFunction(rt);
|
|
98594
|
+
appPropsHandler = args[1].asObject(rt).asFunction(rt);
|
|
98595
|
+
appCommandHandler = args[2].asObject(rt).asFunction(rt);
|
|
98596
|
+
return jsi::Value::undefined();
|
|
98597
|
+
});
|
|
98598
|
+
method("dispatchAppEvent", 3, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
|
|
98599
|
+
appShadowTree->dispatch(rt, static_cast<react::Tag>(args[0].asNumber()), args[1].asString(rt).utf8(rt), args[2]);
|
|
98600
|
+
return jsi::Value::undefined();
|
|
98601
|
+
});
|
|
98602
|
+
constexpr auto *shadowFactory = "peachCreateFabricShadowHandle";
|
|
98603
|
+
rt.global().setProperty(rt, shadowFactory, jsi::Function::createFromHostFunction(rt,
|
|
98604
|
+
jsi::PropNameID::forAscii(rt, shadowFactory), 3,
|
|
98605
|
+
[](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
|
|
98606
|
+
return appShadowTree->handle(rt, static_cast<react::Tag>(args[0].asNumber()), args[1], args[2]);
|
|
98607
|
+
}));
|
|
98608
|
+
`;
|
|
98609
|
+
FABRIC_APP_TEARDOWN = `
|
|
98610
|
+
appShadowTree.reset();
|
|
98611
|
+
appMountHandler.reset();
|
|
98612
|
+
appPropsHandler.reset();
|
|
98613
|
+
appCommandHandler.reset();
|
|
98614
|
+
appSurfacePresenter = nil;
|
|
98615
|
+
`;
|
|
98616
|
+
}
|
|
98617
|
+
});
|
|
98618
|
+
|
|
98289
98619
|
// src/turbo-source.ts
|
|
98290
98620
|
function codegenSpecRoot(codegen) {
|
|
98291
98621
|
const nested = import_node_path120.default.join(codegen, "ReactCodegen");
|
|
@@ -99468,6 +99798,7 @@ async function collectTurboSources(options2) {
|
|
|
99468
99798
|
};
|
|
99469
99799
|
let objc = Boolean(options2.reactNativeProvider);
|
|
99470
99800
|
let fabric = Boolean(options2.reactNativeProvider);
|
|
99801
|
+
let appPresenter = false;
|
|
99471
99802
|
const fabricPackages = /* @__PURE__ */ new Set();
|
|
99472
99803
|
const fabricViews = [];
|
|
99473
99804
|
let fabricTarget = null;
|
|
@@ -99605,6 +99936,11 @@ async function collectTurboSources(options2) {
|
|
|
99605
99936
|
providerObjC = true;
|
|
99606
99937
|
const stripped2 = stripComments(text7);
|
|
99607
99938
|
if (OBJC_TURBO.test(stripped2) || OBJC_BRIDGE.test(stripped2)) {
|
|
99939
|
+
if (/-\s*\(\s*void\s*\)\s*setSurfacePresenter\s*:/.test(stripped2)) {
|
|
99940
|
+
fabric = true;
|
|
99941
|
+
appPresenter = true;
|
|
99942
|
+
fabricTarget ??= { targetName, label, root: provider.root };
|
|
99943
|
+
}
|
|
99608
99944
|
const registers2 = OBJC_REGISTERED.test(stripped2);
|
|
99609
99945
|
for (const [, className2] of stripped2.matchAll(/@implementation\s+(\w+)/g))
|
|
99610
99946
|
if (!managers.has(className2)) {
|
|
@@ -100060,7 +100396,7 @@ async function collectTurboSources(options2) {
|
|
|
100060
100396
|
if (fabricPackages.has(owner))
|
|
100061
100397
|
fabricViews.push({ name: name3, className: className2 });
|
|
100062
100398
|
}
|
|
100063
|
-
const hostTarget = (fabricViews.length > 0 ? fabricTarget : null) ?? (paperClasses.length > 0 ? paperTarget : null);
|
|
100399
|
+
const hostTarget = (fabricViews.length > 0 ? fabricTarget : null) ?? (paperClasses.length > 0 ? paperTarget : null) ?? (appPresenter ? fabricTarget : null);
|
|
100064
100400
|
if (hostTarget) {
|
|
100065
100401
|
result.fabricComponents = fabricViews.map(({ name: name3 }) => name3);
|
|
100066
100402
|
result.paperViewManagers = [...new Set(paperClasses)].sort();
|
|
@@ -100094,7 +100430,7 @@ async function collectTurboSources(options2) {
|
|
|
100094
100430
|
}
|
|
100095
100431
|
}
|
|
100096
100432
|
const unit2 = `${targetPath(hostTarget.targetName)}/PeachFabricHost.mm`;
|
|
100097
|
-
add(unit2, fabricHostSource(fabricViews, result.paperViewManagers));
|
|
100433
|
+
add(unit2, fabricHostSource(fabricViews, result.paperViewManagers, appPresenter));
|
|
100098
100434
|
scanText(
|
|
100099
100435
|
{ key: unit2, ...hostTarget, relative: "PeachFabricHost.mm" },
|
|
100100
100436
|
result.files[unit2]
|
|
@@ -100532,6 +100868,7 @@ RCT_EXPORT_METHOD(load:(NSString *)uri
|
|
|
100532
100868
|
extern "C" void RCTRegisterModule(Class);
|
|
100533
100869
|
static PeachTurboModuleDelegate *delegate;
|
|
100534
100870
|
static RCTTurboModuleManager *manager;
|
|
100871
|
+
id peachAppSurfacePresenter() __attribute__((weak));
|
|
100535
100872
|
|
|
100536
100873
|
@implementation PeachTurboModuleDelegate
|
|
100537
100874
|
|
|
@@ -100556,6 +100893,9 @@ static RCTTurboModuleManager *manager;
|
|
|
100556
100893
|
- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
|
|
100557
100894
|
{
|
|
100558
100895
|
id<RCTTurboModule> module = [moduleClass new];
|
|
100896
|
+
if (peachAppSurfacePresenter && [module respondsToSelector:@selector(setSurfacePresenter:)]) {
|
|
100897
|
+
[module performSelector:@selector(setSurfacePresenter:) withObject:peachAppSurfacePresenter()];
|
|
100898
|
+
}
|
|
100559
100899
|
if ([module respondsToSelector:@selector(setDispatchToJSThread:)])
|
|
100560
100900
|
((id<RCTJSDispatcherModule>)module).dispatchToJSThread = ^(dispatch_block_t block) {
|
|
100561
100901
|
dispatchToJSThread(block);
|
|
@@ -100631,8 +100971,8 @@ ${hasEventDispatcher ? " if (![RCTGetModuleClasses() containsObject:[RCTEventDi
|
|
|
100631
100971
|
auto& runtime = peach::jsi_runtime::create(
|
|
100632
100972
|
[] { invoker->drain(); },
|
|
100633
100973
|
[] {
|
|
100634
|
-
if (peachTeardownFabricViews) peachTeardownFabricViews();
|
|
100635
100974
|
[manager invalidate];
|
|
100975
|
+
if (peachTeardownFabricViews) peachTeardownFabricViews();
|
|
100636
100976
|
manager = nil;
|
|
100637
100977
|
delegate = nil;
|
|
100638
100978
|
invoker.reset();
|
|
@@ -100738,12 +101078,13 @@ ${moduleProviders ? " [found addObjectsFromArray:RCTModuleProviders.moduleProvi
|
|
|
100738
101078
|
}
|
|
100739
101079
|
`;
|
|
100740
101080
|
}
|
|
100741
|
-
function fabricHostSource(views, paperClasses) {
|
|
101081
|
+
function fabricHostSource(views, paperClasses, appPresenter) {
|
|
100742
101082
|
const entries2 = views.map(
|
|
100743
101083
|
({ name: name3, className: className2 }) => `@${JSON.stringify(name3)}: NSClassFromString(@${JSON.stringify(className2)})`
|
|
100744
101084
|
).join(", ");
|
|
100745
101085
|
const paper = paperClasses.length > 0;
|
|
100746
|
-
return `${FABRIC_HOST_INCLUDES}${paper ? FABRIC_HOST_PAPER_INCLUDES : ""}
|
|
101086
|
+
return `${FABRIC_HOST_INCLUDES}${paper ? FABRIC_HOST_PAPER_INCLUDES : ""}${appPresenter ? FABRIC_APP_INCLUDES : ""}
|
|
101087
|
+
${appPresenter ? FABRIC_APP_PRESENTER : ""}
|
|
100747
101088
|
@interface PeachFabricComponents : NSObject <RCTComponentViewFactoryComponentProvider>
|
|
100748
101089
|
@end
|
|
100749
101090
|
|
|
@@ -101483,7 +101824,8 @@ static void peachEventDispatcherDispatchEvent(id self, SEL _cmd, id<RCTEvent> ev
|
|
|
101483
101824
|
NSNumber *reactTag = event.viewTag;
|
|
101484
101825
|
if (!reactTag) return;
|
|
101485
101826
|
auto found = fabricViews.find(reactTag.intValue);
|
|
101486
|
-
if (found == fabricViews.end() || !found->second.family
|
|
101827
|
+
if (found == fabricViews.end() || !found->second.family ||
|
|
101828
|
+
!dynamic_cast<const react::LegacyViewManagerInteropComponentDescriptor *>(found->second.descriptor)) return;
|
|
101487
101829
|
NSArray *args = [event arguments];
|
|
101488
101830
|
NSString *eventName = args.count >= 2 && [args[1] isKindOfClass:[NSString class]]
|
|
101489
101831
|
? args[1]
|
|
@@ -101763,6 +102105,7 @@ ${paper ? ` // Register missing Objective-C selectors on UIKit/QuartzCore class
|
|
|
101763
102105
|
std::weak_ptr<react::EventLogger>());
|
|
101764
102106
|
react::ComponentDescriptorParameters parameters{fabricDispatcher, fabricContext, nullptr};
|
|
101765
102107
|
fabricDescriptors = [factory createComponentDescriptorRegistryWithParameters:parameters];
|
|
102108
|
+
${appPresenter ? FABRIC_APP_INSTALL : ""}
|
|
101766
102109
|
auto views = jsi::Object(rt);
|
|
101767
102110
|
auto method = [&](const char *name, unsigned count, jsi::HostFunctionType body) {
|
|
101768
102111
|
views.setProperty(
|
|
@@ -101787,6 +102130,7 @@ ${paper ? ` // Register missing Objective-C selectors on UIKit/QuartzCore class
|
|
|
101787
102130
|
}
|
|
101788
102131
|
}));
|
|
101789
102132
|
};
|
|
102133
|
+
${appPresenter ? FABRIC_APP_METHODS : ""}
|
|
101790
102134
|
// create(name, instanceHandle, props), Create then Insert: the family the
|
|
101791
102135
|
// handle's events resolve through, the first props, the initial state, and
|
|
101792
102136
|
// the layout the view has before the engine measures it
|
|
@@ -102147,6 +102491,7 @@ void peachTeardownFabricViews() {
|
|
|
102147
102491
|
fabricFocusParentTag = 0;
|
|
102148
102492
|
fabricOwner.reset();
|
|
102149
102493
|
fabricEventHandler.reset();
|
|
102494
|
+
${appPresenter ? FABRIC_APP_TEARDOWN : ""}
|
|
102150
102495
|
}
|
|
102151
102496
|
|
|
102152
102497
|
extern "C" void *peach_fabric_view_content(int tag) {
|
|
@@ -102178,6 +102523,7 @@ var init_turbo_source = __esm({
|
|
|
102178
102523
|
init_swift_source_file();
|
|
102179
102524
|
init_swiftContract();
|
|
102180
102525
|
init_turbo_codegen_intake();
|
|
102526
|
+
init_turbo_fabric_app();
|
|
102181
102527
|
init_xcode_project();
|
|
102182
102528
|
TURBO_CORE_TARGET = "TurboCore";
|
|
102183
102529
|
TURBO_FMT_TARGET = "TurboFmt";
|
|
@@ -102437,6 +102783,7 @@ using namespace facebook;
|
|
|
102437
102783
|
#import <React/RCTUIManager.h>
|
|
102438
102784
|
#import <React/RCTUtils.h>
|
|
102439
102785
|
#import <React/RCTViewManager.h>
|
|
102786
|
+
#include <react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h>
|
|
102440
102787
|
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
102441
102788
|
#include <react/renderer/core/ShadowNodeFragment.h>
|
|
102442
102789
|
#include <react/utils/FollyConvert.h>
|
|
@@ -103689,7 +104036,7 @@ var init_react_native_core = __esm({
|
|
|
103689
104036
|
init_swift_distribution();
|
|
103690
104037
|
init_swift_package();
|
|
103691
104038
|
init_swiftContract();
|
|
103692
|
-
recipe = true ? "
|
|
104039
|
+
recipe = true ? "32fd4cb91d846dff44d3a53361a8b93d320b064cfdcfc0b760c1861bc7f53cea" : reactNativeCoreDigest(__sootsim_import_meta_dirname);
|
|
103693
104040
|
strings3 = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
|
|
103694
104041
|
building = /* @__PURE__ */ new Map();
|
|
103695
104042
|
}
|
|
@@ -104908,7 +105255,7 @@ var init_nitro_superset = __esm({
|
|
|
104908
105255
|
init_nitroContract();
|
|
104909
105256
|
init_swift_standin_digest();
|
|
104910
105257
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
104911
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
105258
|
+
NITRO_COMPILER_DIGEST = true ? "778407e61286034d6ed55be5fcb9b0f2902174b4539a50a46d1cb522ad8b7082" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
104912
105259
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
104913
105260
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
104914
105261
|
published = /* @__PURE__ */ new Map();
|
|
@@ -105884,7 +106231,7 @@ var init_expo_eager_seam_contract = __esm({
|
|
|
105884
106231
|
|
|
105885
106232
|
// src/expo-native-compiler-digest.ts
|
|
105886
106233
|
function expoNativeCompilerDigestValue() {
|
|
105887
|
-
return true ? "
|
|
106234
|
+
return true ? "7c21202b510e2d8e478f15f4d1d2696e06cb8b02a9bbfa34bf6a353ab6bf8cad" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
105888
106235
|
}
|
|
105889
106236
|
var import_node_crypto80;
|
|
105890
106237
|
var init_expo_native_compiler_digest = __esm({
|
|
@@ -109805,11 +110152,11 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
109805
110152
|
throw failure2;
|
|
109806
110153
|
}
|
|
109807
110154
|
}
|
|
109808
|
-
var
|
|
110155
|
+
var import_node_async_hooks4, import_node_child_process65, import_node_crypto84, import_node_fs134, import_node_module20, import_node_os28, import_node_path137, import_node_url4, import_node_util18, run11, scriptEnv, EXPO_SWIFT_ENTRY, WITNESS_BATCH, traceStore, discoveryCache, preparedCache, savedFs, ignoredRoots, ownTemporaryRoots, EXPO_MODULE_SCAN_TIMEOUT_MS, preparedExpoSwift, openPreparations, ExpoSwiftLinkRefusal;
|
|
109809
110156
|
var init_expo_swift_host = __esm({
|
|
109810
110157
|
"src/expo-swift-host.ts"() {
|
|
109811
110158
|
"use strict";
|
|
109812
|
-
|
|
110159
|
+
import_node_async_hooks4 = require("node:async_hooks");
|
|
109813
110160
|
import_node_child_process65 = require("node:child_process");
|
|
109814
110161
|
import_node_crypto84 = require("node:crypto");
|
|
109815
110162
|
import_node_fs134 = __toESM(require("node:fs"), 1);
|
|
@@ -109851,7 +110198,7 @@ var init_expo_swift_host = __esm({
|
|
|
109851
110198
|
scriptEnv = { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" };
|
|
109852
110199
|
EXPO_SWIFT_ENTRY = "Sources/PeachExpoApp/PeachExpoEntry.swift";
|
|
109853
110200
|
WITNESS_BATCH = 200;
|
|
109854
|
-
traceStore = new
|
|
110201
|
+
traceStore = new import_node_async_hooks4.AsyncLocalStorage();
|
|
109855
110202
|
discoveryCache = /* @__PURE__ */ new Map();
|
|
109856
110203
|
preparedCache = /* @__PURE__ */ new Map();
|
|
109857
110204
|
savedFs = null;
|
|
@@ -114053,7 +114400,7 @@ init_bundleAssets();
|
|
|
114053
114400
|
init_expo_native_workspace();
|
|
114054
114401
|
|
|
114055
114402
|
// src/host/staged-host-files.ts
|
|
114056
|
-
var
|
|
114403
|
+
var import_node_async_hooks5 = require("node:async_hooks");
|
|
114057
114404
|
var import_node_crypto92 = require("node:crypto");
|
|
114058
114405
|
var import_node_fs148 = __toESM(require("node:fs"), 1);
|
|
114059
114406
|
var import_node_path152 = __toESM(require("node:path"), 1);
|
|
@@ -114162,7 +114509,7 @@ function readPackageManifest() {
|
|
|
114162
114509
|
var { routes, bundledFiles } = readPackageManifest();
|
|
114163
114510
|
|
|
114164
114511
|
// src/host/staged-host-files.ts
|
|
114165
|
-
var stagedCapture = new
|
|
114512
|
+
var stagedCapture = new import_node_async_hooks5.AsyncLocalStorage();
|
|
114166
114513
|
async function captureStagedHostFiles(prepare3) {
|
|
114167
114514
|
const names = /* @__PURE__ */ new Set();
|
|
114168
114515
|
const value = await stagedCapture.run(names, prepare3);
|