Skip to content

Commit cbca7d4

Browse files
committed
Merge branch 'main' into patch-2
2 parents 39f06cc + fb9c704 commit cbca7d4

File tree

252 files changed

+3319
-1942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+3319
-1942
lines changed

.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ untyped-import
7878
untyped-type-import
7979

8080
[version]
81-
^0.211.0
81+
^0.212.0

.flowconfig.android

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ untyped-import
7878
untyped-type-import
7979

8080
[version]
81-
^0.211.0
81+
^0.212.0

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ body:
3838
- type: textarea
3939
id: extra
4040
attributes:
41-
label: Snack, code example, screenshot, or link to a repository
41+
label: Snack, screenshot, or link to a repository
4242
description: |
43-
Please provide a Snack (https://snack.expo.dev/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.
43+
Please provide a Snack (https://snack.expo.dev/), a link to a repository on GitHub that reproduces the problem.
4444
You may provide a screenshot of the application if you think it is relevant to your bug report.
4545
Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve
4646
Please note that a reproducer is **mandatory**. Issues without reproducer are more likely to stall and will be closed.

.github/workflow-scripts/actOnLabel.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ module.exports = async (github, context, labelWithContext) => {
121121
await addComment(
122122
`| :warning: | Missing Reproducible Example |\n` +
123123
`| --- | --- |\n` +
124-
`| :information_source: | It looks like your issue is missing a reproducible example. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li></ul> |`,
124+
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li></ul> |`,
125125
);
126126
await requestAuthorFeedback();
127127
return;
@@ -133,5 +133,16 @@ module.exports = async (github, context, labelWithContext) => {
133133
);
134134
await requestAuthorFeedback();
135135
return;
136+
case 'Type: Too Old Version':
137+
await addComment(
138+
`| :warning: | Too Old Version of React Native |\n` +
139+
`| --- | --- |\n` +
140+
`| :information_source: | It looks like your issue or the example you provided uses a [**Too Old Version of React Native**](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy).\nDue to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
141+
);
142+
await closeIssue();
143+
return;
144+
default:
145+
// No action needed
146+
return;
136147
}
137148
};
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @format
8+
*/
9+
10+
const NEEDS_REPRO_LABEL = 'Needs: Repro';
11+
const NEEDS_REPRO_HEADER = 'Missing Reproducible Example';
12+
const NEEDS_REPRO_MESSAGE =
13+
`| :warning: | Missing Reproducible Example |\n` +
14+
`| --- | --- |\n` +
15+
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate). A reproducer needs to be in a GitHub repository under your username.</li></ul> |`;
16+
17+
module.exports = async (github, context) => {
18+
const issueData = {
19+
issue_number: context.payload.issue.number,
20+
owner: context.repo.owner,
21+
repo: context.repo.repo,
22+
};
23+
24+
const issue = await github.rest.issues.get(issueData);
25+
const comments = await github.rest.issues.listComments(issueData);
26+
27+
const author = issue.data.user.login;
28+
29+
const maintainerChangedLabel = await hasMaintainerChangedLabel(
30+
github,
31+
issueData,
32+
author,
33+
);
34+
35+
if (maintainerChangedLabel) {
36+
return;
37+
}
38+
39+
const botComment = comments.data.find(comment =>
40+
comment.body.includes(NEEDS_REPRO_HEADER),
41+
);
42+
43+
const entities = [issue.data, ...comments.data];
44+
45+
// Look for Snack or a GH repo associated with the user that added an issue or comment
46+
const hasValidReproducer = entities.some(entity => {
47+
const hasExpoSnackLink = containsPattern(
48+
entity.body,
49+
`https?:\\/\\/snack\\.expo\\.dev\\/[^\\s)\\]]+`,
50+
);
51+
52+
const hasGithubRepoLink = containsPattern(
53+
entity.body,
54+
`https?:\\/\\/github\\.com\\/(${entity.user.login})\\/[^/]+\\/?\\s?`,
55+
);
56+
return hasExpoSnackLink || hasGithubRepoLink;
57+
});
58+
59+
if (hasValidReproducer) {
60+
try {
61+
await github.rest.issues.removeLabel({
62+
...issueData,
63+
name: NEEDS_REPRO_LABEL,
64+
});
65+
} catch (error) {
66+
if (!/Label does not exist/.test(error.message)) {
67+
throw error;
68+
}
69+
}
70+
71+
if (!botComment) return;
72+
73+
await github.rest.issues.deleteComment({
74+
...issueData,
75+
comment_id: botComment.id,
76+
});
77+
} else {
78+
await github.rest.issues.addLabels({
79+
...issueData,
80+
labels: [NEEDS_REPRO_LABEL],
81+
});
82+
83+
if (botComment) return;
84+
85+
await github.rest.issues.createComment({
86+
...issueData,
87+
body: NEEDS_REPRO_MESSAGE,
88+
});
89+
}
90+
};
91+
92+
function containsPattern(body, pattern) {
93+
const regexp = new RegExp(pattern, 'gm');
94+
return body.search(regexp) !== -1;
95+
}
96+
97+
// Prevents the bot from responding when maintainer has changed Needs: Repro the label
98+
async function hasMaintainerChangedLabel(github, issueData, author) {
99+
const timeline = await github.rest.issues.listEventsForTimeline(issueData);
100+
101+
const labeledEvents = timeline.data.filter(
102+
event => event.event === 'labeled' || event.event === 'unlabeled',
103+
);
104+
const userEvents = labeledEvents.filter(event => event.actor.type !== 'Bot');
105+
106+
return userEvents.some(
107+
event =>
108+
event.actor.login !== author && event.label.name === NEEDS_REPRO_LABEL,
109+
);
110+
}

.github/workflow-scripts/verifyVersion.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ module.exports = async (github, context) => {
4242
).data;
4343
const latestVersion = parseVersionFromString(latestRelease.name);
4444

45+
// We want to "insta-close" an issue if RN version provided is too old. And encourage users to upgrade.
46+
if (isVersionTooOld(issueVersion, latestVersion)) {
47+
return {label: 'Type: Too Old Version'};
48+
}
49+
4550
if (!isVersionSupported(issueVersion, latestVersion)) {
4651
return {label: 'Type: Unsupported Version'};
4752
}
@@ -59,14 +64,34 @@ module.exports = async (github, context) => {
5964
}
6065
};
6166

62-
// We support N-2 minor versions, and the latest major.
67+
/**
68+
* Check if the RN version provided in an issue is supported.
69+
*
70+
* "We support `N-2` minor versions, and the `latest` major".
71+
*/
6372
function isVersionSupported(actualVersion, latestVersion) {
6473
return (
6574
actualVersion.major >= latestVersion.major &&
6675
actualVersion.minor >= latestVersion.minor - 2
6776
);
6877
}
6978

79+
/**
80+
* Check if the RN version provided in an issue is too old.
81+
* "We support `N-2` minor versions, and the `latest` major".
82+
*
83+
* A RN version is *too old* if it's:
84+
* - `1` or more *major* behind the *latest major*.
85+
* - `5` or more *minor* behind the *latest minor* in the *same major*. Less aggressive.
86+
* (e.g. If `0.72.0` is the current latest then `0.67.0` and lower is too old for `0.72.0`)
87+
*/
88+
function isVersionTooOld(actualVersion, latestVersion) {
89+
return (
90+
latestVersion.major - actualVersion.major >= 1 ||
91+
latestVersion.minor - actualVersion.minor >= 5
92+
);
93+
}
94+
7095
// Assumes that releases are sorted in the order of recency (i.e. most recent releases are earlier in the list)
7196
// This enables us to stop looking as soon as we find the first release with a matching major/minor version, since
7297
// we know it's the most recent release, therefore the highest patch available.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check for reproducer
2+
# This workflow is triggered when issue is created or edited.
3+
# Also, when a comment is added, edited or deleted.
4+
on:
5+
issues:
6+
types: [opened, edited]
7+
issue_comment:
8+
types: [created, edited, deleted]
9+
10+
jobs:
11+
check-for-reproducer:
12+
runs-on: ubuntu-latest
13+
if: github.repository == 'facebook/react-native' && github.event.issue.pull_request == null && github.event.issue.state == 'open'
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/github-script@v6
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
script: |
20+
const checkForReproducer = require('./.github/workflow-scripts/checkForReproducer.js')
21+
await checkForReproducer(github, context)

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,49 @@
22

33
This file contains all changelogs for latest releases, from 0.70.0 onward. Please check out the other `CHANGELOG-*.md` files for previous versions.
44

5+
## v0.72.3
6+
7+
### Fixed
8+
9+
#### iOS specific
10+
11+
- Revert "Fix pod install for swift libs using new arch (#38121)" to fix [build error with Xcode lower than Xcode 14.3](https://github.com/facebook/react-native/issues/38294) ([8f41f25](https://github.com/facebook/react-native/commit/8f41f25c214f995073e90b786c805eb45ff7dee5) by [@kelset](https://github.com/kelset))
12+
13+
## v0.72.2
14+
15+
### Changed
16+
17+
- Remove deprecated stub types `@types/metro-config` from template ([63f78ea8de](https://github.com/facebook/react-native/commit/63f78ea8de68688005e7f48c6849bdf9f95e26ff) by [@kelset](https://github.com/kelset))
18+
- Bump CLI to 11.3.5 and Metro do 0.76.7 ([ba5fa9c394](https://github.com/facebook/react-native/commit/ba5fa9c394e7cd127e3ee543e0716c37912b0b40) by [@kelset](https://github.com/kelset))
19+
- Bump `@react-native/metro-config` to `0.72.9` ([21daa6e790](https://github.com/facebook/react-native/commit/21daa6e79030574ce41665ea13c39316eac8c305), [f37386176](https://github.com/facebook/react-native/commit/f37386176cb081e7b38fad8b5442099598bf1968) by [@kelset](https://github.com/kelset))
20+
21+
#### Android specific
22+
23+
- Remove okhttp3 internal util usage ([3e3032636d](https://github.com/facebook/react-native/commit/3e3032636dc90a21a499492dcb88f819bcf4f003) by [@adrianha](https://github.com/adrianha))
24+
25+
#### iOS specific
26+
27+
- Update logic to add and remove views in the view registry for the interop layer. ([8d2eec367d](https://github.com/facebook/react-native/commit/8d2eec367dd6fbd60792ca1bde12b875a8261fa6) by [@cipolleschi](https://github.com/cipolleschi))
28+
- Disable NSTextStorage caching in OSS ([5bda54c1f1](https://github.com/facebook/react-native/commit/5bda54c1f183fbc51dc7264b0ab94d5bbcc3f172) by [@sammy-SC](https://github.com/sammy-SC))
29+
30+
### Fixed
31+
32+
- `global.performance` in undefined when starting metro from Expo CLI ([0ccbd65581](https://github.com/facebook/react-native/commit/0ccbd65581304faa286b452f75058b6292a6240f) by [@Kudo](https://github.com/Kudo))
33+
- Re-enabled debugging for debug builds ([41477c898c](https://github.com/facebook/react-native/commit/41477c898cf5726eae9edbb1596366a6eea2b01e) by Matt Blagden)
34+
- Add global hook to assert that base Metro config is called ([29f2602ff9](https://github.com/facebook/react-native/commit/29f2602ff9c3c9a9999c54a6004c99d6fd15ebc3) by [@huntie](https://github.com/huntie))
35+
36+
#### Android specific
37+
38+
- Do not create RuntimeExecutor on non-JSI executors (#38125) ([d73b61c7c7](https://github.com/facebook/react-native/commit/d73b61c7c7dae23630b51b00048eafe5fcb47bd3) by [@lunaleaps](https://github.com/lunaleaps))
39+
- Prevent crash on OnePlus/Oppo devices in runAnimationStep ([a46a7cd1](https://github.com/facebook/react-native/commit/a46a7cd1f613d6eaea1d1cd07751f17cdc07c21b) by [@hsource](https://github.com/hsource))
40+
41+
#### iOS specific
42+
43+
- Fix build error when there are multiple EXTRA_COMPILER_ARGS ([28f4ebab8a](https://github.com/facebook/react-native/commit/28f4ebab8ab4b0f337699e6a135e2aa983866f42) by [@fergusean](https://github.com/fergusean))
44+
- Build failure with pnpm and use_frameworks! due to incorrect header paths ([58adc5e4b9](https://github.com/facebook/react-native/commit/58adc5e4b9ab74b67b4af04d1e72c387af848ea7) by evelant)
45+
- Fix onChangeText not firing when clearing the value of TextInput with multiline=true on iOS ([0c9c57a9f7](https://github.com/facebook/react-native/commit/0c9c57a9f73294414d92428c5d2472dc1e1e5e96) by [@kkoudev](https://github.com/kkoudev))
46+
- Fix pod install for libraries using Swift code when the new architecture is enabled ([a4a0655496](https://github.com/facebook/react-native/commit/a4a065549677c61eb91bf587032976ed48c75821) by [@louiszawadzki](https://github.com/louiszawadzki))
47+
548
## v0.72.1
649

750
### Added

flow-typed/npm/babel-traverse_v7.x.x.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ declare module '@babel/traverse' {
324324

325325
parentKey: string;
326326
scope: Scope;
327-
type: null | $PropertyType<BabelNode, 'type'>;
327+
type: null | BabelNode['type'];
328328
inList: boolean;
329329
typeAnnotation?: BabelNodeTypeAnnotation;
330330

@@ -429,7 +429,7 @@ declare module '@babel/traverse' {
429429
*/
430430
isDescendant(maybeAncestor: NodePath<>): boolean;
431431

432-
inType(...candidateTypes: Array<$PropertyType<BabelNode, 'type'>>): boolean;
432+
inType(...candidateTypes: Array<BabelNode['type']>): boolean;
433433

434434
// _inference
435435

@@ -585,7 +585,7 @@ declare module '@babel/traverse' {
585585
* Check the type against our stored internal type of the node. This is handy when a node has
586586
* been removed yet we still internally know the type and need it to calculate node replacement.
587587
*/
588-
isNodeType(type: $PropertyType<BabelNode, 'type'>): boolean;
588+
isNodeType(type: BabelNode['type']): boolean;
589589

590590
/**
591591
* This checks whether or not we're in one of the following positions:

flow-typed/npm/babel_v7.x.x.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
'use strict';
1212

13-
declare type BabelNode_DEPRECATED = any;
14-
1513
type _BabelSourceMap = $ReadOnly<{
1614
file?: string,
1715
mappings: string,
@@ -833,7 +831,7 @@ declare module '@babel/core' {
833831
*/
834832
wrapPluginVisitorMethod?: (
835833
key: string,
836-
nodeType: $PropertyType<BabelNode, 'type'>,
834+
nodeType: BabelNode['type'],
837835
fn: Function,
838836
) => Function,
839837

0 commit comments

Comments
 (0)