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

Merge more commits + Add NPM Publish Dry Run Job + Refactor Publish pipeline #1767

Merged
merged 522 commits into from
Mar 31, 2023

Conversation

Saadnajmi
Copy link
Collaborator

@Saadnajmi Saadnajmi commented Mar 29, 2023

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

This change refactors our publish release flow to be as close to React Native Core's. We want this because:

  1. We've historically had issues maintaining "two" release flows: Ours and upstreams'. This should help alleviate some of that burden.
  2. Hopefully, this helps future-proof us a little bit for the large "monorepo refactor" change that is coming.

To achieve this, we do roughly 4 things:

  1. Merge up to 5f3c1e1
  • This commit contains the "latest" changes to set-rn-version.js in 0.71-stable (among other scripts) which is used in React Native Core's release flow.
  1. Modify the scripts to not rely on CircleCI, and add -microsoft to the end of our git tags so we can distiguish our forks tagged releases from the upstream-inherited tags.
  2. Add an "NPM Publish Dry Run" CI job to test our new release flow, helpfully using the --dry-run tag that React Native Core has in their scripts
  • I did my best to look at what CircleCI was doing, and copy it to our ADO pipeline
  1. Refactor publish.yml to publish our NPM package using the slightly-modified release flow
  • Again, I did my best to look at what CircleCI was doing, and copy it to our ADO pipeline. We should actively make sure the release is fine after this PR merges.

Once this PR merges, I'll cherry pick the publish refactoring commits to 0.71-stable.

Commits to review

The most important one is the last one.

Changelog

[GENERAL] [ADDED] - Merge more commits + Add NPM Publish Dry Run Job + Refactor Publish pipeline

Test Plan

CI should pass

rshest and others added 30 commits December 2, 2022 17:23
…Entries

Summary:
[Changelog][Internal]

The name corresponds more precisely to what the method does.

Reviewed By: christophpurrer

Differential Revision: D41686205

fbshipit-source-id: 36c47b57fdeb757515cd14b890f38247f7fe8d02
…imes

Summary:
[Changelog][Internal]
Addresses the corresponding TODO in code, to make sure that PerformanceObserver.observe may be called multiple times with different entry types to observe.

Reviewed By: christophpurrer

Differential Revision: D41686237

fbshipit-source-id: 4287f63f7e71e5b1056d30ed616149841ba4f892
Summary:
[Changelog][Internal]

The NativePerformance module functionality corresponds to the [timing extensions of the Performance API standard interface](https://www.w3.org/TR/user-timing/#extensions-performance-interface).

As this is logically separate from `PerformanceObserver` (which may exist without it), it makes sense to have it as a different native module, so there is no coupling between both.

Reviewed By: christophpurrer

Differential Revision: D41690145

fbshipit-source-id: 7443f4c51f54cc2fdddbdb2e89f9a1fa457ab280
Summary:
Pull Request resolved: facebook#35549

Upgrades `react-native` to the newly published `deprecated-react-native-prop-types@3.0.1`, which brings prop-types compatibility up-to-speed with React Native 0.71. (This **is** a release blocker for 0.71.)

Changelog:
[General][Changed] Updated Prop Types for 0.71: https://github.com/facebook/react-native-deprecated-modules/blob/main/deprecated-react-native-prop-types/CHANGELOG.md

Reviewed By: rickhanlonii

Differential Revision: D41708199

fbshipit-source-id: 0cbcf294753203d5a35c8602d5585c5f2b604c6e
…e function (facebook#35546)

Summary:
This PR extracts the content of the codegen case `'Array'` and `'ReadOnlyArray'` into a single `emitArrayType` function inside the `parsers-primitives.js` file and uses it in both Flow and TypeScript parsers as requested on facebook#34872. This also adds unit tests to the new `emitArrayType` function.

## Changelog

[Internal] [Changed]  - Extract the content of the case 'Array' and 'ReadOnlyArray'  into a single emitArrayType function

Pull Request resolved: facebook#35546

Test Plan:
Run `yarn jest react-native-codegen` and ensure CI is green

![image](https://user-images.githubusercontent.com/11707729/205375599-3bbf02bf-85b5-41e6-ae77-fc6e12bee538.png)

Reviewed By: christophpurrer

Differential Revision: D41700084

Pulled By: rshest

fbshipit-source-id: 4bfd2d3ab3f1343bb401ba9c278dc0e0e1ea0989
Reviewed By: adamjernst

Differential Revision: D41704378

fbshipit-source-id: 92bcbc8710e75e6eccfb252986ebd7b5f8645ba6
Summary:
D41708199 (facebook@3e91415) updated `deprecated-react-native-prop-types` so we should be able to re-enable this test, which I previously disabled as part of making RN tests fail on `console.error()`/`console.warn()` (i.e. any test unintentionally creating a redbox/yellowbox).

Changelog:
[Internal]

Reviewed By: yungsters

Differential Revision: D41724052

fbshipit-source-id: 4e91809940c4bf9bde416367326167598a4d1354
…PR template (facebook#35541)

Summary:
A few days back leotm pointed out how the dangerfile was disaligned with the docs around the valid changelog entries for categories and types here: facebook#35443 (comment)

I dug a bit deeper into the whole thing and went to the source of truth, which is the changelog generator, in particular here: https://github.com/microsoft/rnx-kit/blob/main/incubator/rn-changelog-generator/src/utils/getChangeDimensions.ts

So I've updated the dangerfile to respect the options listed there. Also did a parallel PR on the website side: facebook/react-native-website#3447

So now all comms will be aligned.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [FIXED] - fix changelog entries for dangerfiles and PR template

Pull Request resolved: facebook#35541

Test Plan: N/A

Reviewed By: sammy-SC

Differential Revision: D41686913

Pulled By: cortinico

fbshipit-source-id: 2297b4a3209188bda4a609b60860de35c5e7e6df
Summary:
A codemod landed which broke our public CI as it added
disable_infer_precompiled_header which is not known to Buck OSS. This ignores the argument like we do for other internal parameter types.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D41729615

fbshipit-source-id: 30601d793b15cca3164d0513882da94064b47996
…ok#35540)

Summary:
Pull Request resolved: facebook#35540

We now don't need to generate .mk files anymore, therefore I'm removing
this logic from the codegen. In RN 0.72 users should be fully migrated
to CMake.

Changelog:
[Android] [Removed] - Remove .mk prebuilt file and .mk file generation from codegen

Reviewed By: rshest

Differential Revision: D41654122

fbshipit-source-id: 3a3c01fa8ab4d48460338e1a9ce2ecbd6df25f47
Summary:
Pull Request resolved: facebook#35539

This file is unused now that we rely on RNGP. We should be able to remove it
in the next stable release 0.72. In 0.71 we shipped it with a removal warning,
and users should not rely on it anymore.

Changelog:
[Android] [Removed] - Remove the react.gradle file as it's unused

Reviewed By: rshest

Differential Revision: D41655709

fbshipit-source-id: 20860da5e596d35738eea5748c791d3d923dc4fb
Summary:
This note was added when upgrading from 0.69x to 0.70.x when `hermes_enabled` is explicitly set to `true`.

<img width="669" alt="Screenshot 2022-12-05 at 11 26 15" src="https://user-images.githubusercontent.com/36528176/205543104-b4a72c1c-57c0-422b-881e-8a0cb9d5c2a1.png">

But on 0.71, we are now using  `get_default_flags` again which makes the note obsolete.

## Changelog

[Internal] [Removed] - removed hermes note

Pull Request resolved: facebook#35555

Test Plan: N/A

Reviewed By: dmytrorykun

Differential Revision: D41731004

Pulled By: cortinico

fbshipit-source-id: d5f377062bf94fa73bc6e73d1f108e37ad68c715
Summary:
Newer versions of Buck (not released open source) support an `oncall` annotation to denote who owns a particular BUCK file. These annotations are useful to support so that if BUCK files are updated with such annotations they don't break.

## Changelog

[Internal] [Changed] - support oncall annotation in BUCK files

Pull Request resolved: facebook#35562

Test Plan: The `test_buck` CI job validates that the file can be evaluated by open-source Buck. I ran this on a CircleCI fork, and it passed.

Reviewed By: motiz88

Differential Revision: D41731925

Pulled By: cortinico

fbshipit-source-id: 7d0ae164c3e6289d4aa76892658d46bbe4faf99c
Summary:
D40660765 (facebook@3982a2c) introduced extra logging for abnormal closes. The websocked 'close' event may not be called with the event argument.

Changelog: [Internal] - Fix for undefined websocket close

Reviewed By: jacdebug, cortinico

Differential Revision: D41731339

fbshipit-source-id: 92b28dcc0d55d0e9e32b4f4321f325fb3471edcd
…ebook#31392)

Summary:
This PR prevents blob data from being prematurely de-allocated in native code when using slice to create views into an existing blob. Currently, whenever a new blob is created via createFromOptions, BlobManager.js creates a new blobCollector object since options.__collector is never provided.

https://github.com/facebook/react-native/blob/dc80b2dcb52fadec6a573a9dd1824393f8c29fdc/Libraries/Blob/BlobManager.js#L115-L123

When the reference to a blobCollector is garbage collected, the corresponding native memory for the blob data is de-allocated.

https://github.com/facebook/react-native/blob/27651720b40cab564a0cbd41be56a02584e0c73a/Libraries/Blob/RCTBlobCollector.mm#L19-L25

Since, `blob.slice()` is supposed to create a new view onto the same binary data as the original blob, we need to re-use the same collector object when slicing so that it is not GC'd until the last reference to the binary data is no longer reachable. Currently, since each blob slice gets a new blobCollector object, the memory is de-allocated when the first blob is GC'd.

Fixes facebook#29970
Fixes facebook#27857

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Fixed] - Blob data is no longer prematurely deallocated when using blob.slice

Pull Request resolved: facebook#31392

Test Plan: I could use help coming up with a test plan here. I could add a referential equality check for the blob.data.__collector in `Blob-test` but it doesn't seem quite right to be testing the implementation detail there.

Reviewed By: javache

Differential Revision: D41730782

Pulled By: cortinico

fbshipit-source-id: 5671ae2c69908f4c9acb5d203ba198b41b421294
Summary:
Color support for AnimatedInterpolation was incomplete with native drivers, as only rgba type strings were supported. There was also an issue where color props instead a StyleAnimatedNode would never get applied. We were also potentially duplicating color parsing support, which is already centralized in normalizeColor / processColor.

Changelog: [iOS][Added] Enable AnimatedInterpolation to interpolate arbitrary color types.

Reviewed By: philIip

Differential Revision: D41649337

fbshipit-source-id: 505ba555b6a79113635fdfb35c6fe69c92d82234
Summary:
Pull Request resolved: facebook#35569

SoLoader should not be used on Android 7+ unless the app is delivered as [Exopackage](https://buck.build/article/exopackage.html), requires [Android Native Library Merging](https://engineering.fb.com/2018/01/23/android/android-native-library-merging/) or uses [Superpack](https://engineering.fb.com/2021/09/13/core-data/superpack/) compression.
The 0.10.5 soloader would direclty use system linker on Android 7+ by default.

you can change this behavior via adding below meta-data in app's manifest file
```
<application ...>
    <meta-data
        tools:replace="android:value"
        android:name="com.facebook.soloader.enabled"
        android:value="true" />
</application>
```
## Changelog

[Android] [Changed] - Bump Soloader to 0.10.5

facebook/SoLoader@v0.10.4...v0.10.5

Reviewed By: cortinico

Differential Revision: D41691125

fbshipit-source-id: 7d63b090de66bc42c0b473b4bf85eb65442549dd
Summary:
Missed while reviewing facebook#34974 that flex gap props in Flow typings were added to ShadowStyle instead of LayoutStyle (directly above). The same issue is not present in the TS typings.

Changelog:
[General][Fixed] - Move flex gap props to the correct type

Reviewed By: yungsters

Differential Revision: D41736652

fbshipit-source-id: de0db1676464fbd962b2c7e7e9ef62b795332f1b
Summary: Changelog: [Internal]

Reviewed By: mvitousek

Differential Revision: D41739285

fbshipit-source-id: 79db8afaad87a2fbba8f6d30d8468a5997c8509d
…polyfills and align version

Summary:
Changelog:
[General][Changed] - renamed react-native/polyfills -> react-native/js-polyfills and align with other packages versions (0.72.0) as a part of migration to monorepo

Reviewed By: motiz88

Differential Revision: D41553157

fbshipit-source-id: eef70c8e7639080acdeb6716d1a915760a85458a
…ted settings

Summary:
@public
* Add support for getting/setting reload-and-profile-related settings in iOS + Android

## Changelog:
[General][Added] - Add support for getting/setting reload-and-profile-related settings in iOS + Android

Reviewed By: NickGerleman

Differential Revision: D41040611

fbshipit-source-id: df99fb0101dfdfc6808708a5a6ecd9cb96a357d5
…oes not exist (facebook#35566)

Summary:
`findPackageJsonFile` always returns a path even though `package.json` does not exist. This causes issues in libraries whose repo setups look like:

```
react-native-webview
├── android
│   └── build.gradle
├── example  <-- Note the lack of `package.json` here
│   └── App.tsx
├── ios
│   └── RNCWebView.xcodeproj
├── macos
│   └── RNCWebView.xcodeproj
├── package.json
└── src
```

When `newArchEnabled=true`, running `yarn android` will fail with the following:

```
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:generateCodegenArtifactsFromSchema'.
> Could not create task ':app:generateCodegenSchemaFromJavaScript'.
   > /~/react-native-webview/example/package.json (No such file or directory)
```

## Changelog

[Android] [Fixed] - `findPackageJsonFile` should return `null` if `package.json` does not exist

Pull Request resolved: facebook#35566

Test Plan:
```
git clone https://github.com/react-native-webview/react-native-webview.git
cd react-native-webview
git checkout new-arch-ios
yarn
cd example/android
./gradlew clean assembleDebug
```

Reviewed By: NickGerleman

Differential Revision: D41739176

Pulled By: cortinico

fbshipit-source-id: cab0f1f717db160df244c9bb2769e345d6e19917
Summary:
changelog: [internal]

Add findShadowNodeByTag_DEPRECATED` to Fabric's UIManager.
This API makes it possible to get ShadowNode reference for given native tag.
We will leverage this API to make UIManager.measure* calls backwards compatible in the new architecture.

Reviewed By: yungsters

Differential Revision: D41550734

fbshipit-source-id: a45b6a76634d034eac70603bad8ac60f9135ff24
Summary:
changelog: Introduce setNativeProps to Fabric

Add support for `setNativeProps` in Fabric for backwards compatibility. It is still recommended to move away from `setNativeProps` because the API will not work with future features.

We can make step [Migrating off setNativeProps](https://reactnative.dev/docs/new-architecture-library-intro#migrating-off-setnativeprops) in migration guide optional.

Reviewed By: yungsters, mdvacca

Differential Revision: D41521523

fbshipit-source-id: 4d9bbd6304b8c5ee24a36b33039ed33ae1fc21f8
Summary:
Followup to D41654962 (facebook@59ee573), it looks like the default parser here is something different, so not all newer JS syntax is correctly recognixed. Set the parser for JSX to babel/eslint-parser explicitly.

Changelog:
[General][Fixed] - Explicitly set parser for jsx in ESLint config

Reviewed By: motiz88

Differential Revision: D41708672

fbshipit-source-id: 362716ab0aadb7c9cf5fc9f1175b69168372df88
Summary:
Pull Request resolved: facebook#35564

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D41614854

fbshipit-source-id: adc5d4459c00b7a9cb95c8d45c02889592e14c90
Summary:
Changelog: [Internal]

As in the title.

allow-large-files

Reviewed By: mdvacca

Differential Revision: D41772898

fbshipit-source-id: be9aa1f3764932c3e091ba7bd91113bc6979f386
Summary:
Changelog: [Internal]

This adds JS side implementation (including the API) for the `Performance.measure` functionality, [as described in the corresponding standard](https://www.w3.org/TR/user-timing/#measure-method).

The JS part is separated from the C++ implementation (further down the stack) to help the review being more focused.

Reviewed By: mdvacca

Differential Revision: D41733190

fbshipit-source-id: 72b69f6bb332aed4b9477a186b0e818b62009220
Summary:
Changelog: [Internal]

This implements the C++ side logic of handling `Performance.measure` calls.

Since measures may refer to earlier logged marks by name, we need to keep track of the former. I also use a fixed size (circular) buffer to prevent the marks from piling forever.

Also adds implementation of clearing marks/measures, as per standard.

Reviewed By: mdvacca

Differential Revision: D41756928

fbshipit-source-id: 19dce28d6af4c5646274e6d5db20b41869282780
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D41788271

fbshipit-source-id: 8e40dc3279ee0283b2845b9559a80862fdf59a17
@Saadnajmi Saadnajmi force-pushed the latest-set-rn-version branch 9 times, most recently from e02b002 to 2f2cf22 Compare March 31, 2023 17:13
@Saadnajmi Saadnajmi changed the title Merge up to 5f3c1e1f6b5eaebf13cd935fab1359159638847d to refactor NPM publish pipeline Merge more commits + Add NPM Publish Dry Run Job + Refactor Publish pipeline Mar 31, 2023
@Saadnajmi Saadnajmi closed this Mar 31, 2023
@github-actions
Copy link

github-actions bot commented Mar 31, 2023

Warnings
⚠️ 🔒 package.json - Changes were made to package.json. This will require a manual import by a Facebook employee.
⚠️

Libraries/ActionSheetIOS/ActionSheetIOS.js#L11 - Libraries/ActionSheetIOS/ActionSheetIOS.js line 11 – Requires should be sorted alphabetically (lint/sort-imports)

⚠️

Libraries/Animated/nodes/AnimatedNode.js#L15 - Libraries/Animated/nodes/AnimatedNode.js line 15 – 'ReactNativeFeatureFlags' is defined but never used. (no-unused-vars)

⚠️

Libraries/Animated/nodes/AnimatedValue.js#L52 - Libraries/Animated/nodes/AnimatedValue.js line 52 – Unexpected whitespace between function name and paren. (func-call-spacing)

⚠️

Libraries/Core/tests/ExceptionsManager-test.js#L13 - Libraries/Core/tests/ExceptionsManager-test.js line 13 – 'LogBox' is defined but never used. (no-unused-vars)

⚠️

Libraries/ReactNative/getNativeComponentAttributes.js#L13 - Libraries/ReactNative/getNativeComponentAttributes.js line 13 – Requires should be sorted alphabetically (lint/sort-imports)

⚠️

Libraries/Share/Share.js#L11 - Libraries/Share/Share.js line 11 – Requires should be sorted alphabetically (lint/sort-imports)

⚠️

packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js#L1561 - packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js line 1561 – 'pressed' is assigned a value but never used. (no-unused-vars)

⚠️

packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js#L1561 - packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js line 1561 – 'setPressed' is assigned a value but never used. (no-unused-vars)

⚠️

packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js#L284 - packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js line 284 – 'react/no-unstable-nested-components' rule is disabled but never reported. (eslint-comments/no-unused-disable)

⚠️

packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js#L286 - packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js line 286 – Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “SectionList_scrollable” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true. (react/no-unstable-nested-components)

⚠️

packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js#L289 - packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js line 289 – 'react/no-unstable-nested-components' rule is disabled but never reported. (eslint-comments/no-unused-disable)

⚠️

packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js#L291 - packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js line 291 – Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “SectionList_scrollable” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true. (react/no-unstable-nested-components)

Generated by 🚫 dangerJS against 53abf91

@Saadnajmi Saadnajmi marked this pull request as ready for review March 31, 2023 18:37
@Saadnajmi Saadnajmi requested a review from a team as a code owner March 31, 2023 18:37
@Saadnajmi Saadnajmi disabled auto-merge March 31, 2023 19:04
auto-merge was automatically disabled March 31, 2023 19:42

Tried to create or update workflow without `workflows` permission

@Saadnajmi Saadnajmi merged commit bce905f into microsoft:main Mar 31, 2023
@Saadnajmi Saadnajmi deleted the latest-set-rn-version branch April 6, 2023 23:28
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

Successfully merging this pull request may close these issues.