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

Investigate removing hard-coded dependency on node_modules #11

Closed
ianthetechie opened this issue Dec 18, 2022 · 4 comments
Closed

Investigate removing hard-coded dependency on node_modules #11

ianthetechie opened this issue Dec 18, 2022 · 4 comments

Comments

@ianthetechie
Copy link
Collaborator

See the yarnrc.yml and Podfile in the example project. It looks like the current approach is to hard-code path dependencies, which feels like a code smell to me, and further assumes that the end user will always be using npm or some other package manager in a legacy compatibility mode, and this is suboptimal at best.

@ianthetechie
Copy link
Collaborator Author

Tagging with help-wanted since I almost assuredly lack the knowledge to know if this is even a reasonable request. It's also pretty baked as an android assumption too.

@jthiard
Copy link
Contributor

jthiard commented Dec 20, 2022

I'm not sure react-native has good support for PNP installs right now. Will take a closer look.

@jthiard
Copy link
Contributor

jthiard commented Dec 21, 2022

See react-native-community/cli#27 for some context. PnP support looks like is not implemented in react-native and not a priority at this time.

I just tried to bootstrap a react native app with react native 0.70.6 and found the same hard-coded references to node_modules in ios Podfile, but also in android build.gradle. See in the example app:

url("$rootDir/../node_modules/react-native/android")

So in my opinion there isn't much we can do to remove it at this time.

@ianthetechie
Copy link
Collaborator Author

Yeah, makes sense. Thanks a bunch for the research on this.

I've been able to bootstrap projects that install the maplibre-react-native package locally (via yalc) just fine, as well as the examples, so it's probably not an issue using pnp for the development of the module itself as it's all packaged the same at the end of the day (IIUC), but it looks like we can't get around the hard dependency on a node_modules folder for actual apps at the end of the day. And I guess that's not a huge issue since nobody except me really cares ;)

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

No branches or pull requests

2 participants