Skip to content

Commit

Permalink
feat(rn, ios): build fixes and metro-config updates (#14251)
Browse files Browse the repository at this point in the history
feat(rn, ios): build fixes and metro-config updates
  • Loading branch information
Calinteodor authored Jan 18, 2024
1 parent 9273022 commit cf1f97f
Show file tree
Hide file tree
Showing 7 changed files with 954 additions and 41 deletions.
2 changes: 2 additions & 0 deletions ios/.xcode.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export NODE_BINARY=$(command -v node)
export ENTRY_FILE="${PROJECT_DIR}/../../index.ios.js"
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ SPEC CHECKSUMS:
Amplitude: 834c7332dfb9640a751e21c13efb22a07c0c12d4
amplitude-react-native: 0ed8cab759aafaa94961b82122bf56297da607ad
AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
boost: a7c83b31436843459a1961bfd74b96033dc77234
boost: 7dcd2de282d72e344012f7d6564d024930a6a440
CocoaLumberjack: b7e05132ff94f6ae4dfa9d5bce9141893a21d9da
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: dc178b8748748c036ef9493a5d59d6d1f91a36ce
Expand Down Expand Up @@ -855,7 +855,7 @@ SPEC CHECKSUMS:
ObjectiveDropboxOfficial: fe206ce8c0bc49976c249d472db7fdbc53ebbd53
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
PromisesSwift: 28dca69a9c40779916ac2d6985a0192a5cb4a265
RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: f30c3213569b1dc43659ecc549a6536e1e11139e
RCTTypeSafety: e1ed3137728804fa98bce30b70e3da0b8e23054e
React: 54070abee263d5773486987f1cf3a3616710ed52
Expand Down
14 changes: 4 additions & 10 deletions ios/app/app.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1024,15 +1024,12 @@
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
);
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -1088,14 +1085,11 @@
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
);
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
4 changes: 2 additions & 2 deletions ios/sdk/sdk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
Expand Down Expand Up @@ -841,7 +841,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
Expand Down
48 changes: 21 additions & 27 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
/* eslint-disable */

const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');

/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
* Metro configuration
* https://reactnative.dev/docs/metro
*
* @format
* @type {import('metro-config').MetroConfig}
*/

const { getDefaultConfig } = require('metro-config');

module.exports = (async () => {
const {
resolver: {
sourceExts,
assetExts
}
} = await getDefaultConfig();
const {
resolver: {
sourceExts,
assetExts
}
} = getDefaultConfig();

return {
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer'),
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg']
}
const config = {
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer')
},
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [ ...sourceExts, 'svg' ]
}
})();
};

module.exports = mergeConfig(getDefaultConfig(__dirname), config);
Loading

0 comments on commit cf1f97f

Please sign in to comment.