-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
feat: build codegen on postinstall #46227
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Callstack
Partner: Callstack
Partner
labels
Aug 27, 2024
facebook-github-bot
added
the
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
label
Aug 27, 2024
huntie
approved these changes
Aug 27, 2024
@huntie has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @okwasniewski in 0cb97f0 When will my fix make it into a release? | How to file a pick request? |
Saadnajmi
added a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Sep 10, 2024
This reverts commit 0cb97f0.
Saadnajmi
added a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Sep 10, 2024
This reverts commit 0cb97f0.
facebook-github-bot
pushed a commit
that referenced
this pull request
Sep 16, 2024
Summary: This reverts commit 0cb97f0. Revert this commit that adds a `post install` script for a couple of reasons: 1. (EDIT: This turns out to be unrelated) The `postinstall` script causes `yarn install` to fail on React Native macOS, where we use Yarn 4. I'm not entirely sure why, but I probably won't debug it for the rest of the reasons. 2. `postinstall` scripts (at least inside Microsoft) are viewed as a security risk. Any package in your dependency tree can get compromised, add the phase, and run arbitrary code. This has happened in the past with React Native past if I recall correctly. As such, we disable `postinstall` scripts in many of our repos (including `rnx-kit` and `react-native-test-app`). 3. The issue this is trying to solve is to help newcomers avoid a stale cache when they switch branches in the React Native monorepo and only run `yarn install`. I think it would be sufficient to add some documentation somewhere that it is expected one runs `yarn && yarn build` to use this repo locally? That's a fairly common practice in monorepos, at least ones inside Microsoft. ## Changelog: [INTERNAL] [SECURITY] - Remove post install script phase in the React Native monorepo Pull Request resolved: #46420 Test Plan: CI should pass Reviewed By: christophpurrer, robhogan, cortinico, rshest Differential Revision: D62755022 Pulled By: huntie fbshipit-source-id: bf94ed33e3e451ea337ef7a6984f7ba964d0b212
blakef
pushed a commit
that referenced
this pull request
Sep 23, 2024
Summary: This reverts commit 0cb97f0. Revert this commit that adds a `post install` script for a couple of reasons: 1. (EDIT: This turns out to be unrelated) The `postinstall` script causes `yarn install` to fail on React Native macOS, where we use Yarn 4. I'm not entirely sure why, but I probably won't debug it for the rest of the reasons. 2. `postinstall` scripts (at least inside Microsoft) are viewed as a security risk. Any package in your dependency tree can get compromised, add the phase, and run arbitrary code. This has happened in the past with React Native past if I recall correctly. As such, we disable `postinstall` scripts in many of our repos (including `rnx-kit` and `react-native-test-app`). 3. The issue this is trying to solve is to help newcomers avoid a stale cache when they switch branches in the React Native monorepo and only run `yarn install`. I think it would be sufficient to add some documentation somewhere that it is expected one runs `yarn && yarn build` to use this repo locally? That's a fairly common practice in monorepos, at least ones inside Microsoft. ## Changelog: [INTERNAL] [SECURITY] - Remove post install script phase in the React Native monorepo Pull Request resolved: #46420 Test Plan: CI should pass Reviewed By: christophpurrer, robhogan, cortinico, rshest Differential Revision: D62755022 Pulled By: huntie fbshipit-source-id: bf94ed33e3e451ea337ef7a6984f7ba964d0b212
Saadnajmi
added a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Oct 19, 2024
This reverts commit 0cb97f0.
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: Callstack
Partner: Callstack
Partner
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This PR solves a small issue I've encountered when working with the repo.
When changing branches we often run
yarn
to reinstall dependencies (let's say we change from 0.74-stable to main).There are lots of changes between those two versions in the
react-native-codegen
package. This causes an issue when we install pods inpackages/rn-tester
the old version of codegen is used (the one cached from 0.74-stable) leading to a big error that's hard to solve at first.This PR solves this by building codegen on
postinstall
. I've seen many newcomers blocked by this issue (and rerunningyarn
is the natural thing to do in this situation)Changelog:
[INTERNAL] [ADDED] - Build codegen on postinstall when working with the monorepo
Test Plan:
Run
yarn