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

Support PNPM and workspace setups with pod install #36485

Closed
wants to merge 1 commit into from

Conversation

robhogan
Copy link
Contributor

Summary

With Metro symlink support coming soon, users will expect isolated node_modules resolution and hoisted react-native to work. Currently, we make some fragile assumptions in Ruby scripts about the location of node_modules packages - in particular react-native and @react-native-community/cli-platform-ios.

This change invokes node to resolve those paths, which should allow these scripts to work in any Node JS-compliant setup.

There's a small (sub-second) performance penalty involved in invoking node, but two of these in the context of pod install seems reasonable. Also, these scripts already invoke node, so this isn't an additional dependency or point of failure.

This is probably the first Ruby I've written in >10 years, review suggestions welcome!

Changelog

[ios][fixed] - Support workspace setups with pod install

Test Plan

pod install succeeds on a PNPM workspace setup where @react-native-community/cli was not at the path previously expected by this script.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Mar 15, 2023
@facebook-github-bot
Copy link
Contributor

@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D44097440

robhogan added a commit to robhogan/react-native that referenced this pull request Mar 19, 2023
Summary:
With Metro symlink support coming soon, users will expect isolated `node_modules` resolution and hoisted `react-native` to work. Currently, we make some fragile assumptions in Ruby scripts about the location of `node_modules` packages - in particular `react-native` and `react-native-community/cli-platform-ios`.

This change invokes `node` to resolve those paths, which should allow these scripts to work in any Node JS-compliant setup.

There's a small (sub-second) performance penalty involved in invoking node, but two of these in the context of `pod install` seems reasonable. Also, these scripts [already invoke `node`](https://github.com/react-native-community/cli/blob/fb78fe8ea2fabe8e6d43f5042ecbb92e8e484e12/packages/cli-platform-ios/native_modules.rb#L26), so this isn't an additional dependency or point of failure.

*This is probably the first Ruby I've written in >10 years, review suggestions welcome!*

## Changelog

[ios][fixed] - Support workspace setups with pod install

Pull Request resolved: facebook#36485

Test Plan: `pod install` succeeds on a PNPM workspace setup where `react-native-community/cli` was not at the path previously expected by this script.

Reviewed By: cipolleschi

Differential Revision: D44097440

Pulled By: robhogan

fbshipit-source-id: ee038c874997ee503238960cafc05b2c7a815316
Summary:
With Metro symlink support coming soon, users will expect isolated `node_modules` resolution and hoisted `react-native` to work. Currently, we make some fragile assumptions in Ruby scripts about the location of `node_modules` packages - in particular `react-native` and `react-native-community/cli-platform-ios`.

This change invokes `node` to resolve those paths, which should allow these scripts to work in any Node JS-compliant setup.

There's a small (sub-second) performance penalty involved in invoking node, but two of these in the context of `pod install` seems reasonable. Also, these scripts [already invoke `node`](https://github.com/react-native-community/cli/blob/fb78fe8ea2fabe8e6d43f5042ecbb92e8e484e12/packages/cli-platform-ios/native_modules.rb#L26), so this isn't an additional dependency or point of failure.

*This is probably the first Ruby I've written in >10 years, review suggestions welcome!*

Changelog:
[iOS][Added] - Support workspace and isolated setups with `pod install`

Pull Request resolved: facebook#36485

Test Plan: `pod install` succeeds on a PNPM workspace setup where `react-native-community/cli` was not at the path previously expected by this script.

Reviewed By: cipolleschi

Differential Revision: D44097440

Pulled By: robhogan

fbshipit-source-id: 656b87720971b824ac17ff02f20ed4546d34b76f
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D44097440

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 20, 2023
@facebook-github-bot
Copy link
Contributor

@robhogan merged this pull request in 0eff8d6.

@robhogan robhogan deleted the feat/pnpm-friendly-pods branch March 20, 2023 10:34
jeongshin pushed a commit to jeongshin/react-native that referenced this pull request May 7, 2023
Summary:
With Metro symlink support coming soon, users will expect isolated `node_modules` resolution and hoisted `react-native` to work. Currently, we make some fragile assumptions in Ruby scripts about the location of `node_modules` packages - in particular `react-native` and `react-native-community/cli-platform-ios`.

This change invokes `node` to resolve those paths, which should allow these scripts to work in any Node JS-compliant setup.

There's a small (sub-second) performance penalty involved in invoking node, but two of these in the context of `pod install` seems reasonable. Also, these scripts [already invoke `node`](https://github.com/react-native-community/cli/blob/fb78fe8ea2fabe8e6d43f5042ecbb92e8e484e12/packages/cli-platform-ios/native_modules.rb#L26), so this isn't an additional dependency or point of failure.

*This is probably the first Ruby I've written in >10 years, review suggestions welcome!*

Changelog:
[iOS][Added] - Support workspace and isolated setups with `pod install`

Pull Request resolved: facebook#36485

Test Plan: `pod install` succeeds on a PNPM workspace setup where `react-native-community/cli` was not at the path previously expected by this script.

Reviewed By: cipolleschi

Differential Revision: D44097440

Pulled By: robhogan

fbshipit-source-id: 8300144888d8da019451b3f792b30eabc3a568cf
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
With Metro symlink support coming soon, users will expect isolated `node_modules` resolution and hoisted `react-native` to work. Currently, we make some fragile assumptions in Ruby scripts about the location of `node_modules` packages - in particular `react-native` and `react-native-community/cli-platform-ios`.

This change invokes `node` to resolve those paths, which should allow these scripts to work in any Node JS-compliant setup.

There's a small (sub-second) performance penalty involved in invoking node, but two of these in the context of `pod install` seems reasonable. Also, these scripts [already invoke `node`](https://github.com/react-native-community/cli/blob/fb78fe8ea2fabe8e6d43f5042ecbb92e8e484e12/packages/cli-platform-ios/native_modules.rb#L26), so this isn't an additional dependency or point of failure.

*This is probably the first Ruby I've written in >10 years, review suggestions welcome!*

Changelog:
[iOS][Added] - Support workspace and isolated setups with `pod install`

Pull Request resolved: facebook#36485

Test Plan: `pod install` succeeds on a PNPM workspace setup where `react-native-community/cli` was not at the path previously expected by this script.

Reviewed By: cipolleschi

Differential Revision: D44097440

Pulled By: robhogan

fbshipit-source-id: 8300144888d8da019451b3f792b30eabc3a568cf
blakef pushed a commit to blakef/template that referenced this pull request Feb 28, 2024
Summary:
With Metro symlink support coming soon, users will expect isolated `node_modules` resolution and hoisted `react-native` to work. Currently, we make some fragile assumptions in Ruby scripts about the location of `node_modules` packages - in particular `react-native` and `react-native-community/cli-platform-ios`.

This change invokes `node` to resolve those paths, which should allow these scripts to work in any Node JS-compliant setup.

There's a small (sub-second) performance penalty involved in invoking node, but two of these in the context of `pod install` seems reasonable. Also, these scripts [already invoke `node`](https://github.com/react-native-community/cli/blob/fb78fe8ea2fabe8e6d43f5042ecbb92e8e484e12/packages/cli-platform-ios/native_modules.rb#L26), so this isn't an additional dependency or point of failure.

*This is probably the first Ruby I've written in >10 years, review suggestions welcome!*

Changelog:
[iOS][Added] - Support workspace and isolated setups with `pod install`

Pull Request resolved: facebook/react-native#36485

Test Plan: `pod install` succeeds on a PNPM workspace setup where `react-native-community/cli` was not at the path previously expected by this script.

Reviewed By: cipolleschi

Differential Revision: D44097440

Pulled By: robhogan

fbshipit-source-id: 8300144888d8da019451b3f792b30eabc3a568cf

Original: facebook/react-native@0eff8d6
blakef pushed a commit to react-native-community/template that referenced this pull request Feb 29, 2024
Summary:
With Metro symlink support coming soon, users will expect isolated `node_modules` resolution and hoisted `react-native` to work. Currently, we make some fragile assumptions in Ruby scripts about the location of `node_modules` packages - in particular `react-native` and `react-native-community/cli-platform-ios`.

This change invokes `node` to resolve those paths, which should allow these scripts to work in any Node JS-compliant setup.

There's a small (sub-second) performance penalty involved in invoking node, but two of these in the context of `pod install` seems reasonable. Also, these scripts [already invoke `node`](https://github.com/react-native-community/cli/blob/fb78fe8ea2fabe8e6d43f5042ecbb92e8e484e12/packages/cli-platform-ios/native_modules.rb#L26), so this isn't an additional dependency or point of failure.

*This is probably the first Ruby I've written in >10 years, review suggestions welcome!*

Changelog:
[iOS][Added] - Support workspace and isolated setups with `pod install`

Pull Request resolved: facebook/react-native#36485

Test Plan: `pod install` succeeds on a PNPM workspace setup where `react-native-community/cli` was not at the path previously expected by this script.

Reviewed By: cipolleschi

Differential Revision: D44097440

Pulled By: robhogan

fbshipit-source-id: 8300144888d8da019451b3f792b30eabc3a568cf

Original-Commit: facebook/react-native@0eff8d6
blakef pushed a commit to react-native-community/template that referenced this pull request Feb 29, 2024
Summary:
With Metro symlink support coming soon, users will expect isolated `node_modules` resolution and hoisted `react-native` to work. Currently, we make some fragile assumptions in Ruby scripts about the location of `node_modules` packages - in particular `react-native` and `react-native-community/cli-platform-ios`.

This change invokes `node` to resolve those paths, which should allow these scripts to work in any Node JS-compliant setup.

There's a small (sub-second) performance penalty involved in invoking node, but two of these in the context of `pod install` seems reasonable. Also, these scripts [already invoke `node`](https://github.com/react-native-community/cli/blob/fb78fe8ea2fabe8e6d43f5042ecbb92e8e484e12/packages/cli-platform-ios/native_modules.rb#L26), so this isn't an additional dependency or point of failure.

*This is probably the first Ruby I've written in >10 years, review suggestions welcome!*

Changelog:
[iOS][Added] - Support workspace and isolated setups with `pod install`

Pull Request resolved: facebook/react-native#36485

Test Plan: `pod install` succeeds on a PNPM workspace setup where `react-native-community/cli` was not at the path previously expected by this script.

Reviewed By: cipolleschi

Differential Revision: D44097440

Pulled By: robhogan

fbshipit-source-id: 8300144888d8da019451b3f792b30eabc3a568cf

Original-Commit: facebook/react-native@0eff8d6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants