You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a mono repo that has NextJS apps and a React Native 0.71.8 app, with a shared @myorg/services package within /packages/services The RN app was bootstrapped with ignite with a custom metro config.
I have to migrate the app to 0.72.3 because of some long-standing issue that had put the upgrade on hold until the new version of RN was stable.
I am in the middle of that migration following this upgrade helper, this PR, and this PR(WIP) on ignite. Unfortunately, these are for stand-alone apps, and much as they have been super helpful to have the iOS build just fine, it breaks when the app imports the mono repo package @myorg/services. i haven't had much luck on Android past compiling.
I have tried the same up with the new config example but it's not working
Here is my previous setup that was working before, but wont work now after packages update
constpath=require('path');// const { getDefaultConfig } = require('metro-config');const{getDefaultConfig: getDefaultExpoConfig,}=require('@expo/metro-config');// const {// // MetroSerializer,// esbuildTransformerConfig,// } = require('@rnx-kit/metro-serializer-esbuild');letmetroConfig;letisExpo=false;// Find the workspace root, this can be replaced with `find-yarn-workspace-root`constworkspaceRoot=path.resolve(__dirname,'../..');constprojectRoot=__dirname;try{constConstants=require('expo-constants');// True if the app is running in an `expo build` app or if it's running in Expo Go.isExpo=Constants.executionEnvironment==='standalone'||Constants.executionEnvironment==='storeClient';}catch{}if(isExpo){/** * Expo metro config * Learn more https://docs.expo.io/guides/customizing-metro * For one idea on how to support symlinks in Expo, see: * https://github.com/infinitered/ignite/issues/1904#issuecomment-1054535068 */metroConfig=getDefaultExpoConfig(__dirname);}else{/** * Vanilla metro config - we're using a custom metro config because we want to support symlinks * out of the box. This allows you to use pnpm and/or play better in a monorepo. * * You can safely delete this file and remove @rnx-kit/metro-* if you're not * using PNPM or monorepo or symlinks at all. * * However, it doesn't hurt to have it either. */const{ makeMetroConfig }=require('@rnx-kit/metro-config');constMetroSymlinksResolver=require('@rnx-kit/metro-resolver-symlinks');metroConfig=(async()=>{constdefaultConfig=awaitgetDefaultConfig();returnmakeMetroConfig({
projectRoot,// 1. Watch all files within the monorepowatchFolders: [workspaceRoot],// for monorepos workspaceRootresolver: {sourceExts: ['jsx','js','ts','tsx','cjs','json'],// add here/** * This custom resolver is for if you're using symlinks. * * You can disable it if you're not using pnpm or a monorepo or symlinks. */resolveRequest: MetroSymlinksResolver(),assetExts: [...defaultConfig.resolver.assetExts,'bin'],// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`disableHierarchicalLookup: true,// 2. Let Metro know where to resolve packages, and in what ordernodeModulesPaths: [// path.resolve(projectRoot, "node_modules"),path.resolve(projectRoot,'node_modules'),path.resolve(workspaceRoot,'node_modules'),],},// serializer: {// customSerializer: MetroSerializer(),// },transformer: {// ...esbuildTransformerConfig,getTransformOptions: async()=>({transform: {experimentalImportSupport: true,inlineRequires: true,},}),},});})();}module.exports=metroConfig;
Question: Has anyone had any success migrating a turbo repo project to React Native 0.72.3?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Good day everyone.
I have a mono repo that has NextJS apps and a React Native
0.71.8
app, with a shared@myorg/services
package within/packages/services
The RN app was bootstrapped with ignite with a custom metro config.I have to migrate the app to
0.72.3
because of some long-standing issue that had put the upgrade on hold until the new version of RN was stable.I am in the middle of that migration following this upgrade helper, this PR, and this PR(WIP) on ignite. Unfortunately, these are for stand-alone apps, and much as they have been super helpful to have the iOS build just fine, it breaks when the app imports the mono repo package
@myorg/services
. i haven't had much luck on Android past compiling.I have tried the same up with the new config example but it's not working
Here is my previous setup that was working before, but wont work now after packages update
Question: Has anyone had any success migrating a turbo repo project to React Native
0.72.3
?Beta Was this translation helpful? Give feedback.
All reactions