peachsim 0.1.2528 → 0.1.2530
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/bridge-flow-runner.ts +62 -115
- package/cli/commands/flow.ts +72 -29
- package/cli/commands/inspect/settling.ts +17 -0
- package/cli/commands/test.ts +19 -14
- 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 +12 -9
- 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 +16 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-XCLML2QI.mjs → acorn-YVRVG3K7.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-ZTLF52SH.mjs → chunk-2WH6I726.mjs} +12 -12
- package/dist-lib/esm-chunks/{chunk-QLN4PL2B.mjs → chunk-3V3QWLVG.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-V6ZGGSRX.mjs → chunk-6PHCBORD.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-W42SUW36.mjs → chunk-AFCI2JQL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YXALRIKU.mjs → chunk-B5YOIP4V.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2RYVAXP7.mjs → chunk-BACARNR4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JC4USRP6.mjs → chunk-EQRX3NE2.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-PTEP7NR5.mjs → chunk-FRV2MWLR.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-PQHFJQ36.mjs → chunk-GUIH6C3J.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-W6YW6CIA.mjs → chunk-IYR5Q33V.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QWWCXLPI.mjs → chunk-NBOGCAWQ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YAUEK3DM.mjs → chunk-QQ3SVDCR.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HBJSPSXY.mjs → chunk-VSH5P6JS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WM5Y3PCV.mjs → chunk-WM26AFHQ.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-3Z2XYMKR.mjs → chunk-X3MXQKQ3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-KWEGJS22.mjs → chunk-XY5OJABO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SFON4YYW.mjs → chunk-Y2NPAJV3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6HN3M5HU.mjs → chunk-YO6WUDWP.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UI27RY3A.mjs → chunk-YOIJ4H4H.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-IW655T4F.mjs → chunk-ZKAF7FRZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7EUYLPZR.mjs → chunk-ZNYML6R7.mjs} +4 -4
- package/dist-lib/esm-chunks/{metro-layout-parser-JCGEX4NM.mjs → metro-layout-parser-MZ26V7TP.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-SHFZEOJF.mjs → swift-package-prebuilt-SK54BG3Y.mjs} +10 -10
- package/dist-lib/esm-chunks/{swift-sdk-app-module-5HDWRT2F.mjs → swift-sdk-app-module-4EUT66BB.mjs} +13 -13
- package/dist-lib/esm-chunks/{swift-sdk-image-N5ELFWMH.mjs → swift-sdk-image-2Y4Q3HYS.mjs} +13 -13
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-25DMYDZW.mjs → swift-sdk-image-producer-KQC2JCMQ.mjs} +4 -4
- package/dist-lib/expo-swift-bundle.cjs +11 -8
- 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 +140 -106
- package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
- 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 +16 -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 +1 -1
- package/dist-lib/native-app-identity-project.mjs +15 -15
- 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 +79 -79
- package/dist-lib/public-origins-lib.json +71 -69
- 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 +16 -1
- package/dist-lib/sdk.mjs +22 -7
- package/dist-lib/skills.cjs +252 -222
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +10 -10
- 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 +5 -5
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -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/@xmldom/xmldom.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/bplist-parser.cjs +1 -1
- package/dist-lib/vendor/ignore.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/plist.cjs +1 -1
- package/dist-lib/vendor/smol-toml.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/dist-types/packages/peach-engine/src/engine/nativeScrollContract.d.ts +1 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/src/swift-distribution.lock.json +5 -0
- package/src/swift-startup-split.ts +66 -61
- package/src/turbo-source.ts +7 -4
- package/src/wasm-lazy-split.ts +46 -24
package/src/turbo-source.ts
CHANGED
|
@@ -3128,7 +3128,7 @@ ${
|
|
|
3128
3128
|
// an app's Fabric component views, which its own Fabric host defines. the
|
|
3129
3129
|
// bridge proxy and module decorator are what RCTInstance gives the renderer's
|
|
3130
3130
|
// context container, where the legacy view manager interop reads them
|
|
3131
|
-
void peachInstallFabricViews(facebook::jsi::Runtime &runtime, std::shared_ptr<facebook::react::CallInvoker> invoker, id bridgeProxy, id moduleDecorator) __attribute__((weak));
|
|
3131
|
+
void peachInstallFabricViews(facebook::jsi::Runtime &runtime, std::shared_ptr<facebook::react::CallInvoker> invoker, id bridgeProxy, id moduleDecorator, id imageLoader) __attribute__((weak));
|
|
3132
3132
|
void peachTeardownFabricViews() __attribute__((weak));
|
|
3133
3133
|
|
|
3134
3134
|
// UIKitCore: the key window and root view controller an app delegate makes at launch
|
|
@@ -3245,7 +3245,9 @@ ${
|
|
|
3245
3245
|
}];
|
|
3246
3246
|
[decorator.moduleRegistry setTurboModuleRegistry:manager];
|
|
3247
3247
|
[manager installJSBindings:runtime];
|
|
3248
|
-
if (peachInstallFabricViews)
|
|
3248
|
+
if (peachInstallFabricViews) {
|
|
3249
|
+
peachInstallFabricViews(runtime, invoker, ${bridgeProxy ? 'bridgeProxy' : 'nil'}, decorator, [manager moduleForName:"RCTImageLoader"]);
|
|
3250
|
+
}
|
|
3249
3251
|
}
|
|
3250
3252
|
|
|
3251
3253
|
// the screenshot the device took, as UIKit posts it to every observer in the
|
|
@@ -3316,6 +3318,7 @@ const FABRIC_HOST_INCLUDES = `#import <Foundation/Foundation.h>
|
|
|
3316
3318
|
#include <react/renderer/core/StateUpdate.h>
|
|
3317
3319
|
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
|
|
3318
3320
|
#include <react/utils/ContextContainer.h>
|
|
3321
|
+
#include <react/utils/ManagedObjectWrapper.h>
|
|
3319
3322
|
#include <algorithm>
|
|
3320
3323
|
#include <array>
|
|
3321
3324
|
#include <cmath>
|
|
@@ -3354,7 +3357,6 @@ const FABRIC_HOST_PAPER_INCLUDES = `#import <UIKit/UIKit.h>
|
|
|
3354
3357
|
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
3355
3358
|
#include <react/renderer/core/ShadowNodeFragment.h>
|
|
3356
3359
|
#include <react/utils/FollyConvert.h>
|
|
3357
|
-
#include <react/utils/ManagedObjectWrapper.h>
|
|
3358
3360
|
#include <cmath>
|
|
3359
3361
|
#include <cstdio>
|
|
3360
3362
|
#include <mutex>
|
|
@@ -4623,13 +4625,14 @@ static void peachEventDispatcherDispatchEvent(id self, SEL _cmd, id<RCTEvent> ev
|
|
|
4623
4625
|
@end
|
|
4624
4626
|
`
|
|
4625
4627
|
: ''
|
|
4626
|
-
}void peachInstallFabricViews(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> invoker, id bridgeProxy, id moduleDecorator) {
|
|
4628
|
+
}void peachInstallFabricViews(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> invoker, id bridgeProxy, id moduleDecorator, id imageLoader) {
|
|
4627
4629
|
fabricInvoker = std::move(invoker);
|
|
4628
4630
|
fabricComponents = [PeachFabricComponents new];
|
|
4629
4631
|
RCTComponentViewFactory *factory = [RCTComponentViewFactory currentComponentViewFactory];
|
|
4630
4632
|
factory.thirdPartyFabricComponentsProvider = fabricComponents;
|
|
4631
4633
|
fabricRegistry = [RCTComponentViewRegistry new];
|
|
4632
4634
|
fabricContext = std::make_shared<react::ContextContainer>();
|
|
4635
|
+
fabricContext->insert("RCTImageLoader", react::wrapManagedObject(imageLoader));
|
|
4633
4636
|
fabricScheduler = std::make_shared<react::RuntimeScheduler>(
|
|
4634
4637
|
[](std::function<void(jsi::Runtime &)> &&work) { fabricInvoker->invokeAsync(std::move(work)); });
|
|
4635
4638
|
fabricContext->insert(react::RuntimeSchedulerKey, std::weak_ptr<react::RuntimeScheduler>(fabricScheduler));
|
package/src/wasm-lazy-split.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { execFile } from 'node:child_process'
|
|
2
2
|
import { createHash } from 'node:crypto'
|
|
3
3
|
import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
4
|
+
import { availableParallelism } from 'node:os'
|
|
4
5
|
import { dirname, join } from 'node:path'
|
|
5
6
|
import { promisify } from 'node:util'
|
|
7
|
+
import { mapLimit } from '../../../src/helpers/mapLimit.ts'
|
|
6
8
|
import { NATIVE_DYLD_TABLE_SECTION } from '../../peach-kit/src/nativeDyldTableContract'
|
|
7
9
|
import {
|
|
8
10
|
NATIVE_DYLD_SECTION,
|
|
@@ -19,6 +21,7 @@ import {
|
|
|
19
21
|
NATIVE_TABLE_IMPORT_MODULE,
|
|
20
22
|
NATIVE_TABLE_RESERVE_SLOTS,
|
|
21
23
|
} from '../../peach-kit/src/nativeWasmContract'
|
|
24
|
+
import { windowAdmission } from './admitted-mac-build'
|
|
22
25
|
import {
|
|
23
26
|
appendLazyPlacement,
|
|
24
27
|
hasFunctionTable,
|
|
@@ -298,20 +301,28 @@ export async function splitNativeWasm(
|
|
|
298
301
|
writeFileSync(slotFile, slots.join('\n') + '\n')
|
|
299
302
|
const tableTool = join(dirname(binaryen), 'wasm-table-guard')
|
|
300
303
|
let primaryTable: LazyPlacementTable | undefined
|
|
301
|
-
const guard = async (
|
|
304
|
+
const guard = async (
|
|
305
|
+
file: string,
|
|
306
|
+
lazy?: readonly number[],
|
|
307
|
+
env?: NodeJS.ProcessEnv,
|
|
308
|
+
) => {
|
|
302
309
|
const guarded = file.replace(/\.wasm$/, '.guarded.wasm')
|
|
303
310
|
let tableMinimum = 0
|
|
304
311
|
// a part of lazy functions that makes no indirect call has no table to guard.
|
|
305
312
|
if (primaryTable && !hasFunctionTable(readFileSync(file))) copyFileSync(file, guarded)
|
|
306
313
|
else {
|
|
307
|
-
const { stdout } = await run(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
314
|
+
const { stdout } = await run(
|
|
315
|
+
tableTool,
|
|
316
|
+
[
|
|
317
|
+
file,
|
|
318
|
+
guarded,
|
|
319
|
+
named ? '1' : '0',
|
|
320
|
+
shared ? '1' : '0',
|
|
321
|
+
slotFile,
|
|
322
|
+
...(adapted ? ['adapted'] : []),
|
|
323
|
+
],
|
|
324
|
+
{ env },
|
|
325
|
+
)
|
|
315
326
|
const layout: unknown = JSON.parse(stdout)
|
|
316
327
|
if (
|
|
317
328
|
typeof layout !== 'object' ||
|
|
@@ -353,22 +364,33 @@ export async function splitNativeWasm(
|
|
|
353
364
|
if (!primaryLazy.has(lazy)) members.push(lazy)
|
|
354
365
|
lazyByGroup.set(group, members)
|
|
355
366
|
}
|
|
356
|
-
const
|
|
357
|
-
const dyldGroups: { first: number; part: number }[] = []
|
|
358
|
-
for (const [id, slots] of slotsByPart.entries()) {
|
|
367
|
+
const parts = slotsByPart.flatMap((slots, id) => {
|
|
359
368
|
const lazy = lazyByGroup.get(id)
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
369
|
+
return slots.length || lazy ? [{ id, slots, lazy }] : []
|
|
370
|
+
})
|
|
371
|
+
if (!parts.length) return { primary: describePart(input), sides: [] }
|
|
372
|
+
const admitted = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES)
|
|
373
|
+
const requested = Number(process.env.BINARYEN_CORES)
|
|
374
|
+
const jobs = Math.min(
|
|
375
|
+
8,
|
|
376
|
+
availableParallelism(),
|
|
377
|
+
Number.isInteger(admitted) && admitted > 0 ? admitted : 8,
|
|
378
|
+
Number.isInteger(requested) && requested > 0 ? requested : 8,
|
|
379
|
+
)
|
|
380
|
+
const env = jobs > 1 ? { ...process.env, BINARYEN_CORES: '1' } : undefined
|
|
381
|
+
const sides = await mapLimit(
|
|
382
|
+
parts,
|
|
383
|
+
jobs,
|
|
384
|
+
async ({ id, slots, lazy }): Promise<NativeWasmSide> => {
|
|
385
|
+
const part = await guard(join(directory, `side-${id}.wasm`), lazy, env)
|
|
386
|
+
const bytes = readFileSync(part.file)
|
|
387
|
+
assertWasmCodeOnly(bytes)
|
|
388
|
+
return { ...part, slots, sha256: createHash('sha256').update(bytes).digest('hex') }
|
|
389
|
+
},
|
|
390
|
+
)
|
|
391
|
+
const dyldGroups = parts.flatMap(({ lazy }, part) =>
|
|
392
|
+
lazy ? [{ first: lazy[0]!, part }] : [],
|
|
393
|
+
)
|
|
372
394
|
return {
|
|
373
395
|
primary,
|
|
374
396
|
sides,
|