peachsim 0.1.1881 → 0.1.1887

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.
Files changed (160) hide show
  1. package/cli/commands/control.ts +11 -10
  2. package/cli/commands/reset.ts +1 -1
  3. package/cli/native-input.ts +1 -1
  4. package/cli/outbound-endpoints.ts +1 -1
  5. package/detox/index.ts +62 -1
  6. package/dist-lib/agent-daemon-client.cjs +1 -1
  7. package/dist-lib/agent-events.cjs +1 -1
  8. package/dist-lib/attached-projects.cjs +1 -1
  9. package/dist-lib/auth/shared-session.cjs +1 -1
  10. package/dist-lib/backend-origin.cjs +1 -1
  11. package/dist-lib/beta.cjs +1 -1
  12. package/dist-lib/beta.mjs +1 -1
  13. package/dist-lib/bridge-constants.cjs +1 -1
  14. package/dist-lib/bridge-contract-input.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.mjs +1 -1
  16. package/dist-lib/bridge-contract.cjs +1 -1
  17. package/dist-lib/bridge-contract.mjs +1 -1
  18. package/dist-lib/bundle-channel.cjs +9079 -4305
  19. package/dist-lib/capture-contract.cjs +1 -1
  20. package/dist-lib/capture-contract.mjs +1 -1
  21. package/dist-lib/cloud-contract.cjs +1 -1
  22. package/dist-lib/cloud-contract.mjs +1 -1
  23. package/dist-lib/cloud-test-args.cjs +1 -1
  24. package/dist-lib/cloud-test-args.mjs +1 -1
  25. package/dist-lib/cloud.cjs +1 -1
  26. package/dist-lib/cloud.mjs +1 -1
  27. package/dist-lib/config.cjs +1 -1
  28. package/dist-lib/config.mjs +1 -1
  29. package/dist-lib/detox/index.cjs +35 -2
  30. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  31. package/dist-lib/expo-swift-bundle.cjs +8609 -3976
  32. package/dist-lib/expo-swift-metadata.cjs +5 -1
  33. package/dist-lib/expo-swift-metadata.mjs +5 -1
  34. package/dist-lib/home-paths.cjs +1 -1
  35. package/dist-lib/host/bridge-host.cjs +9894 -5149
  36. package/dist-lib/host/fetch-proxy-handler.cjs +93 -13
  37. package/dist-lib/host/fetch-proxy-overrides.cjs +10 -2
  38. package/dist-lib/host/fetch-proxy-overrides.mjs +8 -2
  39. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  40. package/dist-lib/host/websocket-proxy.cjs +1 -1
  41. package/dist-lib/index.cjs +538 -120
  42. package/dist-lib/jump-to-source-babel.cjs +1 -1
  43. package/dist-lib/jump-to-source-native.cjs +1 -1
  44. package/dist-lib/kotlin-host.cjs +1 -1
  45. package/dist-lib/menu.cjs +1 -1
  46. package/dist-lib/menu.mjs +1 -1
  47. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  48. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  49. package/dist-lib/metro-production-bundle.cjs +1 -1
  50. package/dist-lib/metro-production-bundle.mjs +1 -1
  51. package/dist-lib/metro.cjs +536 -118
  52. package/dist-lib/native-app-identity-project.cjs +408 -72
  53. package/dist-lib/native-app-identity-project.mjs +739 -375
  54. package/dist-lib/native-app-identity.cjs +37 -1
  55. package/dist-lib/native-app-identity.mjs +36 -1
  56. package/dist-lib/native-firebase-metadata.cjs +1 -1
  57. package/dist-lib/native-firebase-metadata.mjs +1 -1
  58. package/dist-lib/pdfium-raster.cjs +1 -1
  59. package/dist-lib/pdfium-raster.mjs +1 -1
  60. package/dist-lib/plist.cjs +1 -1
  61. package/dist-lib/plist.mjs +1 -1
  62. package/dist-lib/profiles.cjs +1 -1
  63. package/dist-lib/public-brand.cjs +1 -1
  64. package/dist-lib/public-origins-lib-esm.json +61 -28
  65. package/dist-lib/public-origins-lib.json +250 -92
  66. package/dist-lib/react-native-host-modules.cjs +1 -1
  67. package/dist-lib/react-native-host-modules.mjs +1 -1
  68. package/dist-lib/reap-browser.cjs +1 -1
  69. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  70. package/dist-lib/sdk.cjs +1 -1
  71. package/dist-lib/sdk.mjs +1 -1
  72. package/dist-lib/skills.cjs +16568 -11674
  73. package/dist-lib/swift-compile.cjs +6874 -2537
  74. package/dist-lib/swift-compile.mjs +6207 -1866
  75. package/dist-lib/swift-package.cjs +20 -3
  76. package/dist-lib/swift-package.mjs +20 -3
  77. package/dist-lib/swift-submit.cjs +2 -2
  78. package/dist-lib/swift-submit.mjs +2 -2
  79. package/dist-lib/swift-toolchain.cjs +19 -1
  80. package/dist-lib/swift.cjs +1 -1
  81. package/dist-lib/vite-swift.cjs +8753 -4124
  82. package/dist-lib/vite.cjs +93 -13
  83. package/dist-lib/worklet-executable.cjs +1 -1
  84. package/dist-lib/worklet-executable.mjs +1 -1
  85. package/dist-types/packages/peach-engine/src/engine/canvaskit-api.d.ts +1 -1
  86. package/dist-types/packages/peach-engine/src/engine/fontDataContract.d.ts +2 -0
  87. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
  88. package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +1 -0
  89. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +11 -1
  90. package/dist-types/packages/peach-engine/src/render-worker/shell-tree-wire.d.ts +2 -1
  91. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +1 -0
  92. package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +10 -1
  93. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  94. package/dist-types/packages/peach-kit/src/ui/popover-placement.d.ts +1 -1
  95. package/dist-types/packages/sootsim-swift/src/securityHostContract.d.ts +10 -0
  96. package/package.json +1 -1
  97. package/runtime-companion.json +1 -1
  98. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h +555 -0
  99. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +1 -0
  100. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +6 -0
  101. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSURLProtocol.h +0 -1
  102. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Modules/module.modulemap +6 -0
  103. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBarButtonItemBadge.h +1 -1
  104. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBarMinimization.h +1 -1
  105. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h +1 -1
  106. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISearchTab.h +1 -1
  107. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITab.h +1 -1
  108. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabAccessory.h +2 -2
  109. package/sdk/ios/usr/include/os/activity.h +534 -0
  110. package/sdk/ios/usr/include/os.modulemap +15 -0
  111. package/sdk/ios/wasm/include/fcntl.h +16 -0
  112. package/sdk/ios/wasm/include/string.h +5 -0
  113. package/sdk/native-hashes.json +1 -1
  114. package/src/dns-over-https.ts +61 -9
  115. package/src/expo-swift-bundle.ts +2 -7
  116. package/src/expo-swift-host.ts +11 -3
  117. package/src/host/fetch-proxy-handler.ts +51 -2
  118. package/src/host/fetch-proxy-overrides.ts +4 -0
  119. package/src/host/hostname-resolver.ts +9 -5
  120. package/src/native-app-identity-project.ts +13 -2
  121. package/src/native-app-identity.ts +47 -0
  122. package/src/nitro-adapter.lock.json +260 -260
  123. package/src/nitro-bundle.ts +7 -10
  124. package/src/nitro-superset.lock.json +4 -4
  125. package/src/podspec-sources.ts +20 -0
  126. package/src/storageSnapshotContract.ts +20 -1
  127. package/src/swift-compile.ts +409 -77
  128. package/src/swift-compiler-digest.ts +15 -0
  129. package/src/swift-coverage/xcode-packages.ts +3 -2
  130. package/src/swift-distribution.lock.json +12 -12
  131. package/src/swift-guest-archive.ts +153 -0
  132. package/src/swift-guest-compile.ts +449 -0
  133. package/src/swift-guest-image-ledger.ts +656 -0
  134. package/src/swift-guest-link-plan.ts +52 -0
  135. package/src/swift-guest-link.ts +1414 -0
  136. package/src/swift-guest-linked-spans.ts +338 -0
  137. package/src/swift-guest-manifest.ts +141 -0
  138. package/src/swift-guest-projection-storage.ts +310 -0
  139. package/src/swift-guest-projection.ts +252 -0
  140. package/src/swift-guest-runtime-plan.ts +834 -0
  141. package/src/swift-guest-source-inputs.ts +427 -0
  142. package/src/swift-guest-source-plan.ts +279 -0
  143. package/src/swift-host.ts +157 -36
  144. package/src/swift-icu.ts +60 -18
  145. package/src/swift-link-roots.ts +27 -50
  146. package/src/swift-package-manifest.ts +34 -18
  147. package/src/swift-package.ts +32 -2
  148. package/src/swift-packages.ts +138 -17
  149. package/src/swift-runtime-products.ts +73 -0
  150. package/src/swift-shared-sdk.ts +1 -1
  151. package/src/swift-submit.ts +15 -3
  152. package/src/swift-toolchain.ts +18 -0
  153. package/src/swift-wasm-prune.ts +313 -14
  154. package/src/swiftContract.ts +83 -0
  155. package/src/swiftRuntimeProductContract.ts +85 -45
  156. package/src/turbo-bundle.ts +1 -1
  157. package/src/turbo-codegen-intake.ts +10 -3
  158. package/src/turbo-runtime.lock.json +23 -23
  159. package/src/wasm-optimize.ts +16 -4
  160. package/src/xcode-project.ts +142 -14
@@ -11,6 +11,89 @@ export interface SwiftMetalSource {
11
11
  sha256: string
12
12
  }
13
13
 
14
+ /** source products and direct links, before the guest linker merges images. */
15
+ export interface SwiftSourceLinkGraph {
16
+ entry: string
17
+ targets: {
18
+ id: string
19
+ /** the generated SwiftPM target owning its objects, or no source producer. */
20
+ sourceTarget: string | null
21
+ productName: string
22
+ productType: string
23
+ installName: string | null
24
+ buildVersion: {
25
+ platform: string | null
26
+ minimumOS: string | null
27
+ sdk: string | null
28
+ }
29
+ /** resolved Xcode MACH_O_TYPE or SwiftPM product linkage; null for untyped source groups. */
30
+ machOType: string | null
31
+ linkerFlags: string[]
32
+ /** direct product links in phase order, never build dependencies. */
33
+ dependencies: { target: string; attributes: string[] }[]
34
+ }[]
35
+ }
36
+
37
+ export function isSwiftSourceLinkGraph(value: unknown): value is SwiftSourceLinkGraph {
38
+ if (!value || typeof value !== 'object') return false
39
+ const text = (value: unknown): value is string =>
40
+ typeof value === 'string' &&
41
+ value.length > 0 &&
42
+ value.length <= 4096 &&
43
+ !value.includes('\0')
44
+ const entry = Reflect.get(value, 'entry')
45
+ const targets: unknown = Reflect.get(value, 'targets')
46
+ if (!text(entry) || !Array.isArray(targets) || targets.length > 1024) return false
47
+ const ids = new Set<string>()
48
+ for (const target of targets) {
49
+ if (!target || typeof target !== 'object') return false
50
+ const id = Reflect.get(target, 'id')
51
+ const source = Reflect.get(target, 'sourceTarget')
52
+ const flags: unknown = Reflect.get(target, 'linkerFlags')
53
+ const dependencies: unknown = Reflect.get(target, 'dependencies')
54
+ const build: unknown = Reflect.get(target, 'buildVersion')
55
+ const nullableText = (value: unknown): boolean => value === null || text(value)
56
+ if (
57
+ !text(id) ||
58
+ ids.has(id) ||
59
+ !(source === null || text(source)) ||
60
+ !text(Reflect.get(target, 'productName')) ||
61
+ !text(Reflect.get(target, 'productType')) ||
62
+ !nullableText(Reflect.get(target, 'installName')) ||
63
+ !build ||
64
+ typeof build !== 'object' ||
65
+ !['platform', 'minimumOS', 'sdk'].every((key) =>
66
+ nullableText(Reflect.get(build, key)),
67
+ ) ||
68
+ !(
69
+ Reflect.get(target, 'machOType') === null ||
70
+ text(Reflect.get(target, 'machOType'))
71
+ ) ||
72
+ !Array.isArray(flags) ||
73
+ !flags.every(text) ||
74
+ !Array.isArray(dependencies) ||
75
+ !dependencies.every(
76
+ (link) =>
77
+ link &&
78
+ typeof link === 'object' &&
79
+ text(Reflect.get(link, 'target')) &&
80
+ Array.isArray(Reflect.get(link, 'attributes')) &&
81
+ Reflect.get(link, 'attributes').every(text),
82
+ )
83
+ )
84
+ return false
85
+ ids.add(id)
86
+ }
87
+ return (
88
+ ids.has(entry) &&
89
+ targets.every((target) =>
90
+ Reflect.get(target, 'dependencies').every((link: { target: string }) =>
91
+ ids.has(link.target),
92
+ ),
93
+ )
94
+ )
95
+ }
96
+
14
97
  export interface SwiftResourceBundle {
15
98
  target: string
16
99
  sourcePath: string
@@ -12,6 +12,19 @@ export const swiftFrameworkProductSchema = v.object({
12
12
  linkage: v.picklist(['static', 'dynamic', 'automatic']),
13
13
  targets: v.array(v.string()),
14
14
  }),
15
+ // framework names are distinct from SDK library linkNames. they identify
16
+ // the packaged owner, not an observed native image dependency.
17
+ frameworkAliases: v.array(
18
+ v.object({
19
+ kind: v.literal('framework'),
20
+ name: v.string(),
21
+ targets: v.array(v.string()),
22
+ moduleMap: v.string(),
23
+ moduleMapSha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
24
+ wasmSdkId: v.string(),
25
+ wasmSdkChecksum: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
26
+ }),
27
+ ),
15
28
  targets: v.array(
16
29
  v.object({
17
30
  name: v.string(),
@@ -29,60 +42,78 @@ export type SwiftFrameworkProduct = v.InferOutput<typeof swiftFrameworkProductSc
29
42
  export const SWIFT_SDK_PRODUCT_FILE = 'runtime-products.json'
30
43
 
31
44
  /** producer facts; the consuming compiler resolves guest image scopes and build versions. */
32
- export const swiftSdkProductSchema = v.object({
33
- id: v.string(),
34
- installName: v.string(),
35
- target: v.literal('wasm32-unknown-wasip1'),
36
- linkNames: v.array(v.string()),
37
- buildDependencies: v.array(v.string()),
38
- linkDependencies: v.nullable(v.array(v.string())),
39
- autolink: v.array(v.string()),
40
- sources: v.array(
41
- v.object({
42
- path: v.string(),
43
- sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
44
- }),
45
- ),
46
- artifacts: v.array(
47
- v.variant('kind', [
45
+ export const swiftSdkProductSchema = v.pipe(
46
+ v.object({
47
+ id: v.string(),
48
+ installName: v.string(),
49
+ target: v.literal('wasm32-unknown-wasip1'),
50
+ linkNames: v.array(v.string()),
51
+ // absent records declare no framework namespace, even when a library name matches.
52
+ frameworkAliases: v.optional(
53
+ v.array(
54
+ v.object({
55
+ name: v.string(),
56
+ moduleMap: v.string(),
57
+ moduleMapSha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
58
+ }),
59
+ ),
60
+ [],
61
+ ),
62
+ buildDependencies: v.array(v.string()),
63
+ linkOwnership: v.picklist(['image', 'containing-image']),
64
+ linkDependencies: v.nullable(v.array(v.string())),
65
+ autolink: v.array(v.string()),
66
+ sources: v.array(
48
67
  v.object({
49
- kind: v.literal('archive'),
50
68
  path: v.string(),
51
69
  sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
52
- members: v.array(
53
- v.object({
54
- name: v.string(),
55
- ordinal: v.pipe(v.number(), v.integer(), v.minValue(1)),
56
- sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
57
- sources: v.array(v.string()),
58
- }),
59
- ),
60
70
  }),
61
- v.object({
62
- kind: v.literal('object'),
63
- path: v.string(),
64
- sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
65
- sources: v.array(v.string()),
66
- input: v.optional(
67
- v.object({
68
- product: v.string(),
69
- artifact: v.object({
70
- path: v.string(),
71
+ ),
72
+ artifacts: v.array(
73
+ v.variant('kind', [
74
+ v.object({
75
+ kind: v.literal('archive'),
76
+ path: v.string(),
77
+ sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
78
+ members: v.array(
79
+ v.object({
80
+ name: v.string(),
81
+ ordinal: v.pipe(v.number(), v.integer(), v.minValue(1)),
71
82
  sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
83
+ sources: v.array(v.string()),
72
84
  }),
73
- member: v.optional(
74
- v.object({
75
- name: v.string(),
76
- ordinal: v.pipe(v.number(), v.integer(), v.minValue(1)),
85
+ ),
86
+ }),
87
+ v.object({
88
+ kind: v.literal('object'),
89
+ path: v.string(),
90
+ sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
91
+ sources: v.array(v.string()),
92
+ input: v.optional(
93
+ v.object({
94
+ product: v.string(),
95
+ artifact: v.object({
96
+ path: v.string(),
77
97
  sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
78
98
  }),
79
- ),
80
- }),
81
- ),
82
- }),
83
- ]),
99
+ member: v.optional(
100
+ v.object({
101
+ name: v.string(),
102
+ ordinal: v.pipe(v.number(), v.integer(), v.minValue(1)),
103
+ sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
104
+ }),
105
+ ),
106
+ }),
107
+ ),
108
+ }),
109
+ ]),
110
+ ),
111
+ }),
112
+ v.check(
113
+ (product) => product.linkOwnership === 'image' || product.linkDependencies === null,
114
+ 'containing-image products cannot declare an image scope',
84
115
  ),
85
- })
116
+ )
86
117
 
87
118
  export const swiftSdkProductsSchema = v.object({
88
119
  version: v.literal(1),
@@ -90,3 +121,12 @@ export const swiftSdkProductsSchema = v.object({
90
121
  })
91
122
 
92
123
  export type SwiftSdkProduct = v.InferOutput<typeof swiftSdkProductSchema>
124
+
125
+ export type GuestFrameworkProvider =
126
+ | { readonly kind: 'package'; readonly targets: readonly string[] }
127
+ | { readonly kind: 'sdk'; readonly product: string }
128
+
129
+ export interface GuestFrameworkRequest {
130
+ readonly object: string | null
131
+ readonly provider: GuestFrameworkProvider
132
+ }
@@ -115,7 +115,7 @@ export async function buildTurboBundle(
115
115
  if (!compiled) return null
116
116
  return {
117
117
  metadata: compiled.metadata,
118
- assets: compiled.artifact ? compiledModuleAssets(compiled.artifact) : [],
118
+ assets: compiled.artifact ? await compiledModuleAssets(compiled.artifact) : [],
119
119
  }
120
120
  }
121
121
 
@@ -54,7 +54,6 @@ const RENDERER_PODS = new Set([
54
54
  'React-FabricComponents',
55
55
  'React-FabricImage',
56
56
  'React-RCTFabric',
57
- 'React-RCTFBReactNativeSpec',
58
57
  'React-graphics',
59
58
  'React-rendererdebug',
60
59
  'React-utils',
@@ -67,7 +66,6 @@ const RENDERER_PODS = new Set([
67
66
  'React-runtimescheduler',
68
67
  'React-ImageManager',
69
68
  'React-performancetimeline',
70
- 'React-jsinspectortracing',
71
69
  'React-jsinspector',
72
70
  'React-cxxreact',
73
71
  'React-jserrorhandler',
@@ -76,6 +74,9 @@ const RENDERER_PODS = new Set([
76
74
 
77
75
  // renderer pods added between releases; compile those installed
78
76
  const RENDERER_PODS_VERSIONED = new Set([
77
+ // added after react-native 0.75
78
+ 'React-RCTFBReactNativeSpec',
79
+ 'React-jsinspectortracing',
79
80
  // missing in 0.78, present in 0.81
80
81
  'React-renderercss',
81
82
  'React-oscompat',
@@ -142,7 +143,13 @@ export function installedFabricSources(
142
143
  path.basename(file, '.podspec'),
143
144
  ),
144
145
  )
145
- if (required.length !== (bridgeOnly ? LEGACY_BRIDGE_PODS : RENDERER_PODS).size)
146
+ const expected = [...(bridgeOnly ? LEGACY_BRIDGE_PODS : RENDERER_PODS)].filter(
147
+ (name) => !RENDERER_PODS_VERSIONED.has(name),
148
+ )
149
+ const present = required.filter(
150
+ (file) => !RENDERER_PODS_VERSIONED.has(path.basename(file, '.podspec')),
151
+ )
152
+ if (present.length !== expected.length)
146
153
  throw new Error(`${reactNativeRoot}: installed renderer podspecs are incomplete`)
147
154
  return specs.map((file) => {
148
155
  const directory = path.dirname(file)
@@ -8,11 +8,11 @@
8
8
  },
9
9
  "compiler": "swift-6.4.0-RELEASE-custom-a560ff35bf882b5c",
10
10
  "sdk": {
11
- "id": "swift-6.4.0-RELEASE_wasm-peach-e210d44b",
12
- "checksum": "02a87a688b4644f23c470433356f23ce90a3e6c95507a787a11d2cd671152c0c"
11
+ "id": "swift-6.4.0-RELEASE_wasm-peach-3b3aa5c2",
12
+ "checksum": "49fcbdbcb340a7ca89db0b8965bea0b1aced4a3f767a86a70b9db00ec55e067b"
13
13
  },
14
14
  "framework": {
15
- "distribution": "70d4c94be0146f9e",
15
+ "distribution": "254fdeb7cac228a5",
16
16
  "wireAbi": "246b8412514b644113e6a26252c8ebd6de49ab4156ac5f5c98bb9e4c2ff2568b"
17
17
  },
18
18
  "archives": [
@@ -20,71 +20,71 @@
20
20
  "headers": {
21
21
  "reactNativeJsi": "0f8c2defbca69a27a848a81ae72363073bf9602fd316e57a75811be1a0528358"
22
22
  },
23
- "sha256": "fa21253dcca4c622d6bc1f5391d85b3cd709ec7370f55643cef0bfee497287bb",
24
- "size": 25390
23
+ "sha256": "3f2bcbcc27b4a1b23dc8f11d5c130e4e314411dc8e4ac217c156c3ae17791886",
24
+ "size": 25401
25
25
  },
26
26
  {
27
27
  "headers": {
28
28
  "reactNativeJsi": "21a624ea24fd17d56bf26832d496fc1177067f89640414c20e6486c7984dfb0a"
29
29
  },
30
- "sha256": "dfa6e7cdb33e5ed08f55e41f6fb2087b5ea3be6012f3745ac6c93c422c1062fc",
31
- "size": 26136
30
+ "sha256": "cdc67be63dfc69343d32a765db173ef2e462e0900ee69177bc4e21e77b94db95",
31
+ "size": 26139
32
32
  },
33
33
  {
34
34
  "headers": {
35
35
  "reactNativeJsi": "324aefd8591d9ce688bce7589c4c2b516cd33ecb95d35c47239a87a8fcf6a8da"
36
36
  },
37
- "sha256": "abbcf4b98778e11fe1fa2b6c0518598e6451dfa790115575043e4ad6ea7857d1",
38
- "size": 25386
37
+ "sha256": "829742f50895fb04aa251d95571be83d6539f732e50cdb165ec538b7b188dc59",
38
+ "size": 25396
39
39
  },
40
40
  {
41
41
  "headers": {
42
42
  "reactNativeJsi": "33596664ee7d7a6623f0796a6feb429543316c3a41b211150acda6e1d835286c"
43
43
  },
44
- "sha256": "25607a392966346080e0051ae7bc469759c543460b2202fac94a4174c65b7308",
45
- "size": 25157
44
+ "sha256": "7891b70a9a80acf9287f8059f42a335c7836ec3e7c29187f4866184f4614354a",
45
+ "size": 25167
46
46
  },
47
47
  {
48
48
  "headers": {
49
49
  "reactNativeJsi": "66b2cd5a38511195207f6c8a76aba735f9b9cc66a52a0d00780ffe5d331623f7"
50
50
  },
51
- "sha256": "edafa2130cca3278594a6fd8e6f6c7a866427442df8c66f6f90a94df6ce565b7",
52
- "size": 25390
51
+ "sha256": "dd475d73cc366f913546f894a56070ceb8f9e451a6a36e0a11422f802e03d946",
52
+ "size": 25400
53
53
  },
54
54
  {
55
55
  "headers": {
56
56
  "reactNativeJsi": "96db4e758dd53e9320cef7cad485e00aa06e7a982cefd920f17007de8a5bd9f9"
57
57
  },
58
- "sha256": "1b5e488f623261cd662a6d97b2071045c747d108cb82f79ace8642cde67b92fa",
59
- "size": 26137
58
+ "sha256": "103ceb90327f7f8ea058756f4dbdb0a022a0d61d5076fea65c487e54b293ec87",
59
+ "size": 26140
60
60
  },
61
61
  {
62
62
  "headers": {
63
63
  "reactNativeJsi": "aeab590ddd1218df963462242d3954ce467b0fa88f70e91429e4ffc74d230893"
64
64
  },
65
- "sha256": "c296909ad8b8492a3652d5897a44651ed9f05d4c048dc29f60d060865cb8ff61",
66
- "size": 26135
65
+ "sha256": "9f5268e469a336e50191d8b2485243ec1ff4bd83157ed12d107fa8f3dc597ae5",
66
+ "size": 26139
67
67
  },
68
68
  {
69
69
  "headers": {
70
70
  "reactNativeJsi": "b5fb260522384dd7ab07d740cdc534b529922446fcec798341c7817d9eaa49f4"
71
71
  },
72
- "sha256": "1619009fd794c373314abb47289ad4995c5e2adac1ef2ea6e125efb968b51649",
73
- "size": 25260
72
+ "sha256": "1c9d8178cfc9f187122ca52dba7ba9a4af531ca09fdde1616d1a3f6b12c01853",
73
+ "size": 25268
74
74
  },
75
75
  {
76
76
  "headers": {
77
77
  "reactNativeJsi": "c6b391a1e870ccf7cdd534be63582862840f8245b99ebd253317deece1e6ffd5"
78
78
  },
79
- "sha256": "a9f4777b1ba8b7724b88d91b66ece10718666e110944fd45ed85bb4a19408e8e",
80
- "size": 26139
79
+ "sha256": "27bf8f75332c3e77cce60eacc9a9aa5ecc8c807ff88829f8f78e1af3282f9fea",
80
+ "size": 26144
81
81
  },
82
82
  {
83
83
  "headers": {
84
84
  "reactNativeJsi": "c8270f1315745ecc204c4209a4f50f58ff6f14b4a385ad6820a69800270b53c6"
85
85
  },
86
- "sha256": "9588c7d3a06cfc4316b6501d8adc1ec104e524c46bbc72544c57a725e6a88277",
87
- "size": 25102
86
+ "sha256": "bc1bd88b6ff5bd7557b66d09825bb90f86a19724caec5264746d7464a5f6c51d",
87
+ "size": 25106
88
88
  }
89
89
  ]
90
90
  }
@@ -22,9 +22,17 @@ const FEATURES = [
22
22
  /** feeds the artifact hash: a new optimizer or flag set is a new artifact. */
23
23
  export const WASM_OPTIMIZE_IDENTITY = `wasm-opt ${BINARYEN_VERSION} -Oz ${FEATURES.join(',')}`
24
24
 
25
- async function runWasmOpt(file: string, output: string): Promise<void> {
25
+ // skipPasses names Binaryen passes to leave out. a guest link with several images
26
+ // skips duplicate-function-elimination, which would merge identical functions
27
+ // that different images must keep separate.
28
+ async function runWasmOpt(
29
+ file: string,
30
+ output: string,
31
+ skipPasses: readonly string[],
32
+ ): Promise<void> {
26
33
  const result = await wasmOpt([
27
34
  '-Oz',
35
+ ...skipPasses.flatMap((pass) => ['--skip-pass', pass]),
28
36
  ...FEATURES.map((feature) => `--enable-${feature}`),
29
37
  file,
30
38
  '-o',
@@ -52,12 +60,16 @@ function installWasmOpt(): void {
52
60
  }
53
61
  }
54
62
 
55
- export async function optimizeWasm(file: string, output: string): Promise<void> {
63
+ export async function optimizeWasm(
64
+ file: string,
65
+ output: string,
66
+ skipPasses: readonly string[] = [],
67
+ ): Promise<void> {
56
68
  try {
57
- await runWasmOpt(file, output)
69
+ await runWasmOpt(file, output, skipPasses)
58
70
  } catch (error) {
59
71
  if (!(error instanceof BinaryNotFoundError)) throw error
60
72
  installWasmOpt()
61
- await runWasmOpt(file, output)
73
+ await runWasmOpt(file, output, skipPasses)
62
74
  }
63
75
  }