Skip to content

Commit bb44fe7

Browse files
committed
Merge branch 'master' into react-18-deprecation-fixes
2 parents ea8a286 + 80a72c3 commit bb44fe7

File tree

18 files changed

+186
-120
lines changed

18 files changed

+186
-120
lines changed

.github/CONTRIBUTING.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,13 @@ Please open an issue with a proposal for a new feature or refactoring before sta
9999
3. If you've changed APIs, update the documentation.
100100
4. Ensure the tests pass (`npm run test`).
101101

102-
You should see a pre-commit hook run before each commit. If it does not, you may need to reset you Git hookspath:
103-
104-
```
105-
git config --unset core.hookspath
106-
```
102+
You should see a pre-commit hook run before each commit.
107103

108104
You can now submit a pull request, referencing any issues it addresses.
109105

110106
Please try to keep your pull request focused in scope and avoid including unrelated commits.
111107

112-
After you have submitted your pull request, we'll try to get back to you as soon as possible. We may suggest some changes or improvements.
108+
After you have submitted your pull request, it's recommended that **you** perform the first code review. We'll try to get back to you as soon as possible and may suggest changes.
113109

114110
Thank you for contributing!
115111

@@ -118,7 +114,7 @@ Thank you for contributing!
118114
To commit, publish, and push a final version:
119115

120116
```
121-
npm run release -- <version>
117+
npm run release -- <version> --opt=<opt-code>
122118
```
123119

124120
Release candidates or versions that you'd like to publish to npm, but do not want to produce a commit and push it to GitHub:

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ body:
1616
- type: textarea
1717
attributes:
1818
label: Describe the issue
19-
description: A concise description of what you're experiencing. Providing screenshots is also helpful.
19+
description: Please provide a concise description of what you're experiencing. Providing screenshots is also helpful.
2020
validations:
2121
required: true
2222
- type: textarea
2323
attributes:
2424
label: Expected behavior
25-
description: A concise description of what you expected to happen.
25+
description: Please provide a concise description of what you expected to happen.
2626
validations:
2727
required: true
2828
- type: textarea
2929
attributes:
3030
label: Steps to reproduce
31-
description: Steps to reproduce the behavior.
31+
description: Please describe the precise steps needed to reproduce the behavior.
3232
placeholder: |
3333
Mention package versions and environment (browser, etc)...
3434
1. ...
@@ -38,7 +38,11 @@ body:
3838
- type: input
3939
attributes:
4040
label: Test case
41-
description: Please provide a link to a test case reproducing the issue
41+
description: Please provide a link to a reduced test case that reproduces the issue.
4242
placeholder: "https://codesandbox.io/s/6lx6ql1w5r"
4343
validations:
4444
required: true
45+
- type: textarea
46+
attributes:
47+
label: Additional comments
48+
description: You're welcome to provide additional context and proposed solutions.

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ body:
55
- type: markdown
66
attributes:
77
value: |
8-
Thank you for reporting suggesting a feature!
8+
Thank you for suggesting a feature!
99
- type: checkboxes
1010
attributes:
1111
label: Is there an existing request?
@@ -16,6 +16,6 @@ body:
1616
- type: textarea
1717
attributes:
1818
label: Describe the feature request
19-
description: A concise description of the request, potential solutions, and addtional context.
19+
description: Please provide a concise description of the request, potential solutions, and addtional context.
2020
validations:
2121
required: true

configs/babel.config.js

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
module.exports = function (api) {
2-
if (api) {
3-
api.cache(true);
4-
}
5-
6-
let modules = false;
7-
8-
if (process.env.BABEL_ENV === 'commonjs' || process.env.NODE_ENV === 'test') {
9-
modules = 'commonjs';
10-
}
1+
const createConfig = ({ modules }) => {
2+
const plugins = [
3+
'@babel/plugin-transform-flow-strip-types',
4+
['@babel/plugin-proposal-class-properties', { loose: true }],
5+
['@babel/plugin-proposal-object-rest-spread', { useBuiltIns: true }],
6+
'@babel/plugin-proposal-nullish-coalescing-operator',
7+
[
8+
'@babel/plugin-transform-runtime',
9+
{
10+
version: '7.18.6'
11+
}
12+
]
13+
].concat(modules ? ['babel-plugin-add-module-exports'] : []);
1114

1215
return {
16+
assumptions: {
17+
iterableIsArray: true
18+
},
19+
comments: true,
1320
presets: [
1421
[
1522
'@babel/preset-env',
@@ -19,36 +26,31 @@ module.exports = function (api) {
1926
exclude: ['transform-typeof-symbol'],
2027
targets: {
2128
browsers: [
22-
'chrome 38',
23-
'android 4',
24-
'firefox 40',
25-
'ios_saf 7',
26-
'safari 7',
27-
'ie 10',
28-
'ie_mob 11',
29-
'edge 12',
30-
'opera 16',
31-
'op_mini 12',
32-
'and_uc 9',
33-
'and_chr 38'
29+
'chrome 49',
30+
// https://www.mozilla.org/en-US/firefox/all/#product-desktop-esr
31+
'firefox 91',
32+
'ios_saf 10',
33+
'safari 10',
34+
// https://docs.microsoft.com/en-us/DeployEdge/microsoft-edge-support-lifecycle
35+
'edge 94',
36+
'opera 36'
3437
]
3538
}
3639
}
3740
],
3841
'@babel/preset-react',
3942
'@babel/preset-flow'
4043
],
41-
plugins: [
42-
'@babel/plugin-transform-flow-strip-types',
43-
['@babel/plugin-proposal-class-properties', { loose: true }],
44-
['@babel/plugin-proposal-object-rest-spread', { useBuiltIns: true }],
45-
'@babel/plugin-proposal-nullish-coalescing-operator',
46-
[
47-
'@babel/plugin-transform-runtime',
48-
{
49-
version: '7.18.6'
50-
}
51-
]
52-
].concat(modules ? ['babel-plugin-add-module-exports'] : [])
44+
plugins: plugins
5345
};
5446
};
47+
48+
module.exports = function (api) {
49+
if (api) {
50+
api.cache(true);
51+
}
52+
53+
return process.env.BABEL_ENV === 'commonjs' || process.env.NODE_ENV === 'test'
54+
? createConfig({ modules: 'commonjs' })
55+
: createConfig({ modules: false });
56+
};

packages/babel-plugin-react-native-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"registry": "https://registry.npmjs.org/"
44
},
55
"name": "babel-plugin-react-native-web",
6-
"version": "0.18.4",
6+
"version": "0.18.6",
77
"description": "Babel plugin for React Native for Web",
88
"main": "index.js",
99
"devDependencies": {

packages/react-native-web-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "react-native-web-docs",
4-
"version": "0.18.4",
4+
"version": "0.18.6",
55
"description": "Documentation website for React Native for Web",
66
"scripts": {
77
"dev": "eleventy --serve",

packages/react-native-web-docs/src/pages/docs/apis/appearance.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ eleventyNavigation:
1010
{% import "fragments/macros.html" as macro with context %}
1111

1212
:::lead
13-
The Appearance module exposes information about the user's appearance preferences, such as their preferred color scheme (light or dark).
13+
The Appearance module exposes information about the user's appearance preferences, such as their preferred color scheme (light or dark).
1414
:::
1515

1616
```js
@@ -23,6 +23,10 @@ import { Appearance } from 'react-native';
2323

2424
### Static methods
2525

26+
{% call macro.prop('addChangeListener', '(listener) => { remove: () => void }') %}
27+
Add an event handler that is called with `{colorScheme: "dark" | "light"}` when appearance preferences change. Returns a `remove` method used to remove the change listener.
28+
{% endcall %}
29+
2630
{% call macro.prop('getColorScheme', '() => ("dark" | "light")') %}
2731
You can use the Appearance module to determine if the user prefers a dark color scheme. Although the color scheme is available immediately, this may change (e.g. scheduled color scheme change at sunrise or sunset). Any rendering logic or styles that depend on the user preferred color scheme should try to call this function on every render, rather than caching the value.
2832
{% endcall %}

packages/react-native-web-docs/src/pages/docs/components/scoll-view.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ import { ScrollView } from 'react-native';
3131
All the props supported by [View]({{ '/docs/view' | url }}).
3232
{% endcall %}
3333

34+
{% call macro.prop('centerContent', '?boolean') %}
35+
When `true`, the scroll view automatically centers the content when the content is smaller than the scroll view bounds; when the content is larger than the scroll view, this property has no effect.
36+
{% endcall %}
37+
3438
{% call macro.prop('contentContainerStyle', '?Style') %}
3539
These styles will be applied to the scroll view content container which wraps all of the child views.
3640
{% endcall %}
3741

38-
3942
{% call macro.prop('disableScrollViewPanResponder', '?boolean = false') %}
4043
When `true`, the default `PanResponder` on the `ScrollView` is disabled, and full control over pointers inside the `ScrollView` is left to its child components. This is meant to be used when native "snap-to" scrolling behavior is needed.
4144
{% endcall %}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"private": true,
33
"name": "react-native-web-examples",
4-
"version": "0.18.4",
4+
"version": "0.18.6",
55
"scripts": {
66
"build": "next build",
77
"dev": "next",
88
"start": "next start"
99
},
1010
"dependencies": {
11-
"babel-plugin-react-native-web": "0.18.4",
11+
"babel-plugin-react-native-web": "0.18.6",
1212
"next": "^12.2.0",
1313
"react": "^18.0.0",
1414
"react-dom": "^18.0.0",
15-
"react-native-web": "0.18.4"
15+
"react-native-web": "0.18.6"
1616
},
1717
"license": "MIT"
1818
}

packages/react-native-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"registry": "https://registry.npmjs.org/"
44
},
55
"name": "react-native-web",
6-
"version": "0.18.4",
6+
"version": "0.18.6",
77
"description": "React Native for Web",
88
"module": "dist/index.js",
99
"main": "dist/cjs/index.js",

0 commit comments

Comments
 (0)