Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable pnpm symlinks without hoisting #3

Closed
ProchaLu opened this issue Jul 2, 2024 · 7 comments
Closed

Enable pnpm symlinks without hoisting #3

ProchaLu opened this issue Jul 2, 2024 · 7 comments

Comments

@ProchaLu
Copy link
Member

ProchaLu commented Jul 2, 2024

Takeover from hola-soy-milk/upleveled-react-native-expo#6

Wonder if this new @rnx-kit/metro-resolver-symlinks could be used also with an Expo project... 🤔 (to avoid the node-linker=hoist in pnpm)

facebook/metro#1 (comment)

Looks like this kitchen-sink Expo app is using it 👀

https://github.com/tamagui/tamagui/blob/fd7105ebf1ce6feb362dcad5da64f205e6b71b69/apps/kitchen-sink/metro.config.js#L2-L9

@ProchaLu
Copy link
Member Author

ProchaLu commented Jul 2, 2024

React Native 0.72 with symlink support was just released:

https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks

As soon as Expo upgrades and supports this version, we can try it out

@ProchaLu
Copy link
Member Author

ProchaLu commented Jul 2, 2024

Expo SDK 50 is out, which uses React Native 0.73 internally.

React 0.73 has made symlink support stable.

If it doesn't work out of the box (without node-linker=hoisted or any other workarounds), maybe the details in this issue would be helpful:

facebook/metro#1042
Specifically, maybe this workaround is helpful (although unstable_enableSymlinks no longer needed for RN 0.73):

const path = require('path');

const config = {
  watchFolders: [path.join(__dirname, '..', '..')],
  resolver: {
    unstable_enableSymlinks: true,
    unstable_enablePackageExports: true,
  },
};

@ProchaLu
Copy link
Member Author

ProchaLu commented Jul 2, 2024

Seems like Expo SDK 50 with RN 0.73 is still a problem for pnpm without hoisting config, at least for now:

expo/expo#22413 (comment)

@ProchaLu
Copy link
Member Author

ProchaLu commented Jul 2, 2024

Also asked Expo and pnpm maintainers over here in the open pnpm issue about whether it would be possible to get symlinks support out of the box:

pnpm/pnpm#4286 (comment)

@ProchaLu
Copy link
Member Author

ProchaLu commented Jul 2, 2024

By default, a project created with create-expo-app and pnpm uses node-linker with its value set to hoisted to install dependencies.

https://docs.expo.dev/more/create-expo/#pnpm

@ProchaLu
Copy link
Member Author

ProchaLu commented Jul 2, 2024

@ProchaLu ProchaLu closed this as completed Jul 2, 2024
@Zn4rK
Copy link

Zn4rK commented Jul 9, 2024

No hoisting in my solution please give it a try if still applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants