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

Standalone Gradle plugin: Node.js package resolver #42823

Closed
wants to merge 1 commit into from

Conversation

robhogan
Copy link
Contributor

@robhogan robhogan commented Feb 2, 2024

Summary:
This is a tiny new Gradle plugin intended to be published to the Gradle Plugin Portal independently of React Native. It's only function is to resolve node_modules package roots using a sufficient subset of the Node JS resolution algorithm - e.g, we can use it to find react-native itself from a user's project, whatever package manager or workspace setup they're using, in a Gradle-friendly, cacheable manner.

The plugin is both a Settings plugin and a Project plugin, so that it may be used from both settings.gradle (where we need it to resolve react-native) and app/build.gradle (which currently applies from cli-platform-android).

The setup is mostly gradle init with a few modifications (eg, Kotlin JVM version) to stay close to the setup for react-native-gradle-plugin. I think it's easier to reason about this currently as an entirely separate Gradle project, but we may be able to merge the two and reduce some duplication once it's proven.

Changelog:
[General][Added] - Gradle plugin for resolving node_modules packages.

Reviewed By: cortinico

Differential Revision: D52998256

@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 Feb 2, 2024
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

robhogan added a commit to robhogan/react-native that referenced this pull request Feb 2, 2024
Summary:
Pull Request resolved: facebook#42823

This is a tiny new Gradle plugin intended to be published to the Gradle Plugin Portal independently of React Native. It's only function is to resolve `node_modules` package roots using a sufficient subset of the Node JS resolution algorithm - e.g, we can use it to find `react-native` itself from a user's project, whatever package manager or workspace setup they're using, in a Gradle-friendly, cacheable manner.

The plugin is both a `Settings` plugin and a `Project` plugin, so that it may be used from both `settings.gradle` (where we need it to resolve `react-native`) and `app/build.gradle` (which currently applies from `cli-platform-android`).

The setup is mostly `gradle init` with a few modifications (eg, Kotlin JVM version) to stay close to the setup for `react-native-gradle-plugin`. I think it's easier to reason about this currently as an entirely separate Gradle project, but we may be able to merge the two and reduce some duplication once it's proven.

Changelog:
[General][Added] - Gradle plugin for resolving node_modules packages.

Reviewed By: cortinico

Differential Revision: D52998256

fbshipit-source-id: 9e36f4796a2d57015a5fe5dd9616acf2a31a4e03
@facebook-github-bot
Copy link
Contributor

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

robhogan added a commit to robhogan/react-native that referenced this pull request Feb 2, 2024
Summary:
Pull Request resolved: facebook#42823

This is a tiny new Gradle plugin intended to be published to the Gradle Plugin Portal independently of React Native. It's only function is to resolve `node_modules` package roots using a sufficient subset of the Node JS resolution algorithm - e.g, we can use it to find `react-native` itself from a user's project, whatever package manager or workspace setup they're using, in a Gradle-friendly, cacheable manner.

The plugin is both a `Settings` plugin and a `Project` plugin, so that it may be used from both `settings.gradle` (where we need it to resolve `react-native`) and `app/build.gradle` (which currently applies from `cli-platform-android`).

The setup is mostly `gradle init` with a few modifications (eg, Kotlin JVM version) to stay close to the setup for `react-native-gradle-plugin`. I think it's easier to reason about this currently as an entirely separate Gradle project, but we may be able to merge the two and reduce some duplication once it's proven.

Changelog:
[General][Added] - Gradle plugin for resolving node_modules packages.

Reviewed By: cortinico

Differential Revision: D52998256

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

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

robhogan added a commit to robhogan/react-native that referenced this pull request Feb 5, 2024
Summary:
Pull Request resolved: facebook#42823

This is a tiny new Gradle plugin intended to be published to the Gradle Plugin Portal independently of React Native. It's only function is to resolve `node_modules` package roots using a sufficient subset of the Node JS resolution algorithm - e.g, we can use it to find `react-native` itself from a user's project, whatever package manager or workspace setup they're using, in a Gradle-friendly, cacheable manner.

The plugin is both a `Settings` plugin and a `Project` plugin, so that it may be used from both `settings.gradle` (where we need it to resolve `react-native`) and `app/build.gradle` (which currently applies from `cli-platform-android`).

The setup is mostly `gradle init` with a few modifications (eg, Kotlin JVM version) to stay close to the setup for `react-native-gradle-plugin`. I think it's easier to reason about this currently as an entirely separate Gradle project, but we may be able to merge the two and reduce some duplication once it's proven.

Changelog:
[General][Added] - Gradle plugin for resolving node_modules packages.

Reviewed By: cortinico

Differential Revision: D52998256

fbshipit-source-id: 2e09d34a176e66d2e8ad3cc91803cd8669e4d9e4
Summary:
Pull Request resolved: facebook#42823

This is a tiny new Gradle plugin intended to be published to the Gradle Plugin Portal independently of React Native. It's only function is to resolve `node_modules` package roots using a sufficient subset of the Node JS resolution algorithm - e.g, we can use it to find `react-native` itself from a user's project, whatever package manager or workspace setup they're using, in a Gradle-friendly, cacheable manner.

The plugin is both a `Settings` plugin and a `Project` plugin, so that it may be used from both `settings.gradle` (where we need it to resolve `react-native`) and `app/build.gradle` (which currently applies from `cli-platform-android`).

The setup is mostly `gradle init` with a few modifications (eg, Kotlin JVM version) to stay close to the setup for `react-native-gradle-plugin`. I think it's easier to reason about this currently as an entirely separate Gradle project, but we may be able to merge the two and reduce some duplication once it's proven.

Changelog:
[General][Added] - Gradle plugin for resolving node_modules packages.

Reviewed By: cortinico

Differential Revision: D52998256

fbshipit-source-id: 16b9096b21aaaf1ad7bc462423253a126f29b14c
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 8456cca.

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by 48a19d7.

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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner Reverted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants