Skip to content

Commit f8938ec

Browse files
committed
fix: detox ios
1 parent 5a17cdd commit f8938ec

File tree

9 files changed

+1176
-263
lines changed

9 files changed

+1176
-263
lines changed

apps/ledger-live-mobile/android/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ dependencies {
227227
}
228228

229229
androidTestImplementation('com.wix:detox:+')
230+
implementation 'androidx.appcompat:appcompat:1.1.0'
230231
// Needed for Detox getAttributes on Android : https://github.com/wix/Detox/issues/3147
231232
implementation 'com.google.android.material:material:1.6.0'
232233
implementation 'com.facebook.soloader:soloader:0.10.4+'

apps/ledger-live-mobile/babel.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ module.exports = {
1515
"@babel/plugin-transform-class-static-block",
1616
"@babel/plugin-transform-flow-strip-types",
1717
["@babel/plugin-transform-private-methods", { loose: true }],
18-
"babel-plugin-transform-inline-environment-variables",
1918
// only inject collapsable={false} for builds running Detox tests
2019
process.env.DETOX === "1" || process.env.DETOX === "true"
2120
? "./babel-plugin-inject-collapsable.js"

apps/ledger-live-mobile/ios/Podfile.lock

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ PODS:
3434
- BrazeKit (= 13.3.0)
3535
- BVLinearGradient (2.8.3):
3636
- React-Core
37-
- callstack-repack (5.2.2):
37+
- callstack-repack (5.2.3):
3838
- DoubleConversion
3939
- glog
4040
- hermes-engine
@@ -47,9 +47,12 @@ PODS:
4747
- React-Fabric
4848
- React-featureflags
4949
- React-graphics
50+
- React-hermes
5051
- React-ImageManager
52+
- React-jsi
5153
- React-NativeModulesApple
5254
- React-RCTFabric
55+
- React-renderercss
5356
- React-rendererdebug
5457
- React-utils
5558
- ReactCodegen
@@ -248,16 +251,10 @@ PODS:
248251
- GoogleUtilities/UserDefaults (8.1.0):
249252
- GoogleUtilities/Logger
250253
- GoogleUtilities/Privacy
251-
<<<<<<< HEAD
252254
- hermes-engine (0.79.7):
253255
- hermes-engine/Pre-built (= 0.79.7)
254256
- hermes-engine/Pre-built (0.79.7)
255-
=======
256-
- hermes-engine (0.77.3):
257-
- hermes-engine/Pre-built (= 0.77.3)
258-
- hermes-engine/Pre-built (0.77.3)
259257
- JWTDecode (3.0.1)
260-
>>>>>>> 44a545f20e (feat(llm): add Repack)
261258
- libwebp (1.5.0):
262259
- libwebp/demux (= 1.5.0)
263260
- libwebp/mux (= 1.5.0)
@@ -3213,7 +3210,7 @@ SPEC CHECKSUMS:
32133210
BrazeLocation: 47cde4ac51568718b76d4677475c926ea840633b
32143211
BrazeUI: 4de47810a95f225e0199cf6ddc9756f9dab662eb
32153212
BVLinearGradient: cb006ba232a1f3e4f341bb62c42d1098c284da70
3216-
callstack-repack: 883a333715df1dcbac99308e86669a8ad5f62e5e
3213+
callstack-repack: 884dcac7228f72428bc1aadca034ef410e5eae6a
32173214
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
32183215
DatadogCore: 68aee4ffcc3ea17a3b0aa527907757883fc72c84
32193216
DatadogCrashReporting: e6a83b143394e28c9c1cb48c5cfb18eff507b3be
@@ -3250,12 +3247,8 @@ SPEC CHECKSUMS:
32503247
glog: 5683914934d5b6e4240e497e0f4a3b42d1854183
32513248
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
32523249
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
3253-
<<<<<<< HEAD
32543250
hermes-engine: 13c84524b3b6e884b2cf3b3b1e002ffd147d88a3
3255-
=======
3256-
hermes-engine: b2187dbe13edb0db8fcb2a93a69c1987a30d98a4
32573251
JWTDecode: 2eed97c2fa46ccaf3049a787004eedf0be474a87
3258-
>>>>>>> 44a545f20e (feat(llm): add Repack)
32593252
libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8
32603253
lottie-ios: a881093fab623c467d3bce374367755c272bdd59
32613254
lottie-react-native: 825856a41d05a933539ea4fdf384d67c10590547

apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
);
342342
runOnlyForDeploymentPostprocessing = 0;
343343
shellPath = /bin/sh;
344-
shellScript = "export NODE_BINARY=$(command -v node)\n\nset -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\n\nif [[ \"$SKIP_JS_BUNDLING\" == \"true\" ]]; then\n REACT_NATIVE_XCODE=\"\"\n echo \"Skipping JS bundle\"\nelse\n echo \"Not skipping JS bundle\"\n REACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\nfi\n\nBUNDLE_REACT_NATIVE=\"$REACT_NATIVE_XCODE\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT \\\"$BUNDLE_REACT_NATIVE\\\"\"\n";
344+
shellScript = "export NODE_BINARY=$(command -v node)\n\nset -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\n\nif [[ \"$SKIP_JS_BUNDLING\" == \"true\" ]]; then\n REACT_NATIVE_XCODE=\"\"\n echo \"Skipping JS bundle\"\nelse\n echo \"Not skipping JS bundle\"\n REACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\nfi\n\nif [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\nexport CLI_PATH=\"$(\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('@react-native-community/cli/package.json')) + '/build/bin.js'\")\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
345345
};
346346
3B8A85D90BB941F538378AA1 /* [CP-User] [RNFB] Core Configuration */ = {
347347
isa = PBXShellScriptBuildPhase;

apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/xcshareddata/xcschemes/ledgerlivemobile.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
</Testables>
6565
</TestAction>
6666
<LaunchAction
67-
buildConfiguration = "Debug"
67+
buildConfiguration = "Staging"
6868
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
6969
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
7070
launchStyle = "0"

apps/ledger-live-mobile/package.json

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@
3636
"ios:ci:nightly": "bundle exec fastlane ios ci_nightly --env ios.nightly",
3737
"ios:device:add": "bundle exec fastlane ios add_ios_device",
3838
"ios:sync:profiles": "bundle exec fastlane ios sync_ios_profiles",
39-
<<<<<<< HEAD
40-
"ios:bundle-visualizer": "react-native-bundle-visualizer --platform ios --dev false",
41-
=======
4239
"ios:bundle-visualizer": "NODE_OPTIONS=--max-old-space-size=8192 react-native-bundle-visualizer --platform ios --dev false",
43-
"preandroid:apk": "bundle install",
44-
>>>>>>> 2cb21fbf30 (fix: cleanup metro confs)
4540
"android:apk:local": "bundle exec fastlane android apk_local --env android.staging",
4641
"preandroid:apk": "bundle install",
4742
"android:apk": "bundle exec fastlane android apk --env android.staging",
@@ -243,9 +238,9 @@
243238
"@babel/preset-env": "7.28.5",
244239
"@babel/preset-react": "7.28.5",
245240
"@babel/runtime": "7.28.4",
246-
"@callstack/repack": "5.2.2",
247-
"@callstack/repack-plugin-expo-modules": "5.2.2",
248-
"@callstack/repack-plugin-reanimated": "5.2.2",
241+
"@callstack/repack": "5.2.3",
242+
"@callstack/repack-plugin-expo-modules": "5.2.3",
243+
"@callstack/repack-plugin-reanimated": "5.2.3",
249244
"@jest/reporters": "catalog:",
250245
"@features/market-banner": "workspace:^",
251246
"@ledgerhq/live-common": "workspace:^",
@@ -257,12 +252,12 @@
257252
"@react-native/babel-preset": "catalog:",
258253
"@react-native/codegen": "catalog:",
259254
"@react-native/dev-middleware": "catalog:",
260-
"@rozenite/mmkv-plugin": "1.1.0",
261-
"@rozenite/network-activity-plugin": "1.1.0",
262-
"@rozenite/react-navigation-plugin": "1.1.0",
263-
"@rozenite/redux-devtools-plugin": "1.1.0",
264-
"@rozenite/repack": "1.1.0",
265-
"@rspack/core": "1.7.0",
255+
"@rozenite/mmkv-plugin": "1.2.0",
256+
"@rozenite/network-activity-plugin": "1.2.0",
257+
"@rozenite/react-navigation-plugin": "1.2.0",
258+
"@rozenite/redux-devtools-plugin": "1.2.0",
259+
"@rozenite/repack": "1.2.0",
260+
"@rspack/core": "catalog:",
266261
"@swc/helpers": "0.5.17",
267262
"hermes-parser": "0.32.1",
268263
"@testing-library/react-native": "13.3.3",
@@ -310,6 +305,7 @@
310305
"react-native-launch-arguments": "4.0.2",
311306
"react-native-performance": "5.1.2",
312307
"react-test-renderer": "19.0.0",
308+
"react-native-sse": "1.2.1",
313309
"strip-ansi": "6.0.1",
314310
"@swc/jest": "catalog:",
315311
"@swc/core": "catalog:",

apps/ledger-live-mobile/rspack.config.mjs

Lines changed: 105 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -43,109 +43,115 @@ const nodeModulesPaths = [
4343

4444
const hermesParserPath = require.resolve("hermes-parser");
4545

46-
export default withRozenite(
47-
Repack.defineRspackConfig(env => {
48-
const { mode, platform } = env;
46+
const withRozeniteUrlFix = rozeniteConfig => {
47+
return async env => {
48+
const config = await rozeniteConfig(env);
49+
if (!config.devServer?.setupMiddlewares) {
50+
return config;
51+
}
52+
53+
const originalSetupMiddlewares = config.devServer.setupMiddlewares;
54+
4955
return {
50-
mode,
51-
context: __dirname,
52-
entry: "./index.js",
53-
resolve: {
54-
...Repack.getResolveOptions(platform, {
55-
enablePackageExports: true,
56-
preferNativePlatform: true,
57-
}),
58-
fullySpecified: false,
59-
modules: nodeModulesPaths,
60-
extensions: [
61-
`.${platform}.tsx`,
62-
`.${platform}.ts`,
63-
`.${platform}.jsx`,
64-
`.${platform}.js`,
65-
".native.tsx",
66-
".native.ts",
67-
".native.jsx",
68-
".native.js",
69-
".tsx",
70-
".ts",
71-
".jsx",
72-
".js",
73-
".mjs",
74-
".cjs",
75-
".json",
76-
"...",
77-
],
78-
enforceExtension: false,
79-
mainFields: ["react-native", "browser", "main", "module"],
80-
conditionNames: ["require", "react-native", "browser"],
81-
alias: {
82-
...buildTsAlias(tsconfig.compilerOptions.paths),
83-
// Packages with malformed exports field (missing "." subpath) - resolve to browser entry
84-
"@aptos-labs/aptos-client": resolveFromPnpmSubmodule(
85-
"node_modules",
86-
"@aptos-labs",
87-
"aptos-client",
88-
"dist",
89-
"browser",
90-
"index.browser.mjs",
91-
),
92-
"rpc-websockets": resolveFromPnpmSubmodule(
93-
"node_modules",
94-
"rpc-websockets",
95-
"dist",
96-
"index.browser.mjs",
97-
),
98-
},
99-
fallback: {
100-
...require("node-libs-react-native"),
101-
fs: require.resolve("react-native-level-fs"),
102-
net: require.resolve("react-native-tcp-socket"),
103-
tls: false,
104-
child_process: false,
105-
cluster: false,
106-
dgram: false,
107-
dns: false,
108-
readline: false,
109-
module: false,
110-
repl: false,
111-
vm: false,
56+
...config,
57+
devServer: {
58+
...config.devServer,
59+
setupMiddlewares: middlewares => {
60+
const result = originalSetupMiddlewares(middlewares);
61+
result.unshift((req, res, next) => {
62+
if (req.url?.startsWith("/debugger-frontend/")) {
63+
const newUrl = req.url.replace("/debugger-frontend/", "/rozenite/");
64+
res.writeHead(302, { Location: newUrl });
65+
res.end();
66+
return;
67+
}
68+
next();
69+
});
70+
71+
return result;
11272
},
11373
},
114-
module: {
115-
rules: [
116-
{
117-
test: /\.[cm]?[jt]sx?$/,
118-
use: {
119-
loader: "@callstack/repack/babel-loader",
120-
parallel: true,
121-
options: {
122-
hermesParserPath,
74+
};
75+
};
76+
};
77+
78+
export default withRozeniteUrlFix(
79+
withRozenite(
80+
Repack.defineRspackConfig(env => {
81+
const { mode, platform } = env;
82+
return {
83+
mode,
84+
context: __dirname,
85+
entry: "./index.js",
86+
resolve: {
87+
...Repack.getResolveOptions(platform, {
88+
enablePackageExports: true,
89+
preferNativePlatform: true,
90+
}),
91+
modules: nodeModulesPaths,
92+
alias: {
93+
...buildTsAlias(tsconfig.compilerOptions.paths),
94+
// Packages with malformed exports field (missing "." subpath) - resolve to browser entry
95+
"@aptos-labs/aptos-client": resolveFromPnpmSubmodule(
96+
"node_modules",
97+
"@aptos-labs",
98+
"aptos-client",
99+
"dist",
100+
"browser",
101+
"index.browser.mjs",
102+
),
103+
"rpc-websockets": resolveFromPnpmSubmodule(
104+
"node_modules",
105+
"rpc-websockets",
106+
"dist",
107+
"index.browser.mjs",
108+
),
109+
},
110+
fallback: {
111+
...require("node-libs-react-native"),
112+
fs: require.resolve("react-native-level-fs"),
113+
net: require.resolve("react-native-tcp-socket"),
114+
tls: false,
115+
child_process: false,
116+
cluster: false,
117+
dgram: false,
118+
dns: false,
119+
readline: false,
120+
module: false,
121+
repl: false,
122+
vm: false,
123+
},
124+
},
125+
module: {
126+
rules: [
127+
{
128+
test: /\.[cm]?[jt]sx?$/,
129+
use: {
130+
loader: "@callstack/repack/babel-loader",
131+
parallel: true,
132+
options: {
133+
hermesParserPath,
134+
},
123135
},
136+
resolve: {
137+
fullySpecified: false,
138+
},
139+
type: "javascript/auto",
124140
},
125-
resolve: {
126-
fullySpecified: false,
127-
},
128-
type: "javascript/auto",
129-
},
130-
...Repack.getAssetTransformRules(),
141+
...Repack.getAssetTransformRules(),
142+
],
143+
},
144+
plugins: [
145+
new Repack.RepackPlugin(),
146+
new ReanimatedPlugin({
147+
unstable_disableTransform: true,
148+
}),
149+
new ExpoModulesPlugin(),
131150
],
132-
},
133-
plugins: [
134-
new Repack.RepackPlugin(),
135-
new ReanimatedPlugin({
136-
unstable_disableTransform: true,
137-
}),
138-
new ExpoModulesPlugin(),
139-
],
140-
};
141-
}),
142-
{
143-
enabled: process.env.WITH_ROZENITE === "true",
144-
include: [
145-
"@rozenite/network-activity-plugin",
146-
"@rozenite/react-navigation-plugin",
147-
"@rozenite/redux-devtools-plugin",
148-
"@rozenite/mmkv-plugin",
149-
],
150-
},
151+
};
152+
}),
153+
{
154+
enabled: process.env.WITH_ROZENITE === "true",
155+
},
156+
),
151157
);

apps/ledger-live-mobile/src/reducers/accounts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export function exportSelector(state: State): {
151151
* every account sync, so potentially you could avoid many unnessary and
152152
* expensive re-renders.
153153
*/
154-
export const accountsSelector = (s: State): Account[] => s.accounts?.active;
154+
export const accountsSelector = (s: State): Account[] => s.accounts.active;
155155

156156
// NB some components don't need to refresh every time an account is updated, usually it's only
157157
// when the balance/name/length/starred/swapHistory of accounts changes.

0 commit comments

Comments
 (0)