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

Flow: inference_mode=constrain_writes #25422

Closed
wants to merge 3 commits into from

Conversation

kassens
Copy link
Member

@kassens kassens commented Oct 4, 2022

Stack from ghstack (oldest at bottom):

This mode is going to be the new default in Flow going forward.
There was an unfortuante large number of suppressions in this update.

More on the changes can be found in this Flow blog post.

Added some of the required annotations using the provided codemod:

node_modules/.bin/flow codemod annotate-declarations --write .

This mode is going to be the new default in Flow going forward.
There was an unfortuante large number of suppressions in this update.

More on the changes can be found in this [Flow blog post](https://medium.com/flow-type/new-flow-language-rule-constrained-writes-4c70e375d190).

Added some of the required annotations using the provided codemod:

```sh
node_modules/.bin/flow codemod annotate-declarations --write .
```

[ghstack-poisoned]
@kassens kassens mentioned this pull request Oct 4, 2022
kassens added a commit to kassens/react that referenced this pull request Oct 4, 2022
This mode is going to be the new default in Flow going forward.
There was an unfortuante large number of suppressions in this update.

More on the changes can be found in this [Flow blog post](https://medium.com/flow-type/new-flow-language-rule-constrained-writes-4c70e375d190).

Added some of the required annotations using the provided codemod:

```sh
node_modules/.bin/flow codemod annotate-declarations --write .
```

ghstack-source-id: 3372061ebb4f16f32aa93c0215a3f446adb8298b
Pull Request resolved: facebook#25422
@facebook-github-bot facebook-github-bot added the React Core Team Opened by a member of the React Core Team label Oct 4, 2022
This mode is going to be the new default in Flow going forward.
There was an unfortuante large number of suppressions in this update.

More on the changes can be found in this [Flow blog post](https://medium.com/flow-type/new-flow-language-rule-constrained-writes-4c70e375d190).

Added some of the required annotations using the provided codemod:

```sh
node_modules/.bin/flow codemod annotate-declarations --write .
```

[ghstack-poisoned]
kassens added a commit to kassens/react that referenced this pull request Oct 4, 2022
This mode is going to be the new default in Flow going forward.
There was an unfortuante large number of suppressions in this update.

More on the changes can be found in this [Flow blog post](https://medium.com/flow-type/new-flow-language-rule-constrained-writes-4c70e375d190).

Added some of the required annotations using the provided codemod:

```sh
node_modules/.bin/flow codemod annotate-declarations --write .
```

ghstack-source-id: a9f908c0062f03fef8b4e6056f9dc83ec6428db5
Pull Request resolved: facebook#25422
@sizebot
Copy link

sizebot commented Oct 4, 2022

Comparing: af9afe9...adfc69d

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 135.46 kB 135.46 kB = 43.41 kB 43.41 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 147.72 kB 147.72 kB = 47.17 kB 47.17 kB
facebook-www/ReactDOM-prod.classic.js = 491.70 kB 491.70 kB = 87.49 kB 87.49 kB
facebook-www/ReactDOM-prod.modern.js = 477.00 kB 477.00 kB = 85.24 kB 85.24 kB
facebook-www/ReactDOMForked-prod.classic.js = 491.70 kB 491.70 kB = 87.49 kB 87.49 kB
oss-experimental/react-fs/cjs/react-fs.node.development.server.js +2.88% 10.41 kB 10.71 kB +0.24% 2.52 kB 2.52 kB
oss-stable-semver/react-fs/cjs/react-fs.node.development.server.js +2.88% 10.41 kB 10.71 kB +0.24% 2.52 kB 2.52 kB
oss-stable/react-fs/cjs/react-fs.node.development.server.js +2.88% 10.41 kB 10.71 kB +0.24% 2.52 kB 2.52 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-fs/cjs/react-fs.node.development.server.js +2.88% 10.41 kB 10.71 kB +0.24% 2.52 kB 2.52 kB
oss-stable-semver/react-fs/cjs/react-fs.node.development.server.js +2.88% 10.41 kB 10.71 kB +0.24% 2.52 kB 2.52 kB
oss-stable/react-fs/cjs/react-fs.node.development.server.js +2.88% 10.41 kB 10.71 kB +0.24% 2.52 kB 2.52 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-plugin.js +0.68% 9.55 kB 9.62 kB +0.33% 3.02 kB 3.03 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-plugin.js +0.68% 9.55 kB 9.62 kB +0.33% 3.02 kB 3.03 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-plugin.js +0.68% 9.55 kB 9.62 kB +0.33% 3.02 kB 3.03 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler-reflection.development.js +0.36% 18.04 kB 18.11 kB +0.75% 5.20 kB 5.24 kB
oss-stable/react-reconciler/cjs/react-reconciler-reflection.development.js +0.36% 18.04 kB 18.11 kB +0.75% 5.20 kB 5.24 kB
oss-experimental/react-reconciler/cjs/react-reconciler-reflection.development.js +0.35% 18.44 kB 18.51 kB +0.70% 5.28 kB 5.32 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.development.js +0.27% 689.84 kB 691.68 kB +0.20% 149.91 kB 150.22 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js +0.27% 689.86 kB 691.70 kB +0.20% 149.93 kB 150.24 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.development.js +0.27% 784.53 kB 786.61 kB +0.18% 166.98 kB 167.28 kB
oss-stable/react-reconciler/cjs/react-reconciler.development.js +0.27% 784.56 kB 786.64 kB +0.18% 167.00 kB 167.30 kB
oss-experimental/react-debug-tools/cjs/react-debug-tools.development.js +0.26% 22.65 kB 22.71 kB +0.56% 6.03 kB 6.06 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.development.js +0.26% 22.65 kB 22.71 kB +0.56% 6.03 kB 6.06 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.development.js +0.26% 22.65 kB 22.71 kB +0.56% 6.03 kB 6.06 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.development.js +0.26% 722.58 kB 724.44 kB +0.19% 151.49 kB 151.77 kB
oss-stable/react-test-renderer/umd/react-test-renderer.development.js +0.26% 722.61 kB 724.47 kB +0.19% 151.51 kB 151.80 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.development.js +0.26% 718.71 kB 720.55 kB +0.24% 155.56 kB 155.93 kB
react-native/implementations/ReactFabric-dev.js +0.25% 810.89 kB 812.96 kB +0.16% 176.02 kB 176.30 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js +0.25% 828.94 kB 831.02 kB +0.19% 175.58 kB 175.92 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.development.js +0.25% 752.90 kB 754.76 kB +0.21% 157.20 kB 157.53 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-dev.js +0.25% 732.80 kB 734.61 kB +0.21% 157.12 kB 157.44 kB
react-native/implementations/ReactFabric-dev.fb.js +0.24% 848.32 kB 850.39 kB +0.16% 182.69 kB 182.98 kB
facebook-www/ReactTestRenderer-dev.modern.js +0.24% 754.79 kB 756.60 kB +0.19% 161.20 kB 161.51 kB
facebook-www/ReactTestRenderer-dev.classic.js +0.24% 754.79 kB 756.60 kB +0.19% 161.20 kB 161.51 kB
oss-stable-semver/react-art/cjs/react-art.development.js +0.24% 717.15 kB 718.86 kB +0.17% 154.78 kB 155.04 kB
oss-stable/react-art/cjs/react-art.development.js +0.24% 717.17 kB 718.89 kB +0.17% 154.80 kB 155.06 kB
react-native/implementations/ReactNativeRenderer-dev.js +0.24% 820.39 kB 822.33 kB +0.14% 178.55 kB 178.80 kB
react-native/implementations/ReactNativeRenderer-dev.fb.js +0.23% 857.80 kB 859.74 kB +0.16% 185.25 kB 185.54 kB
oss-experimental/react-art/cjs/react-art.development.js +0.23% 758.49 kB 760.20 kB +0.18% 163.07 kB 163.36 kB
oss-stable-semver/react-server/cjs/react-server.development.js +0.22% 137.80 kB 138.11 kB +0.12% 34.51 kB 34.55 kB
oss-stable/react-server/cjs/react-server.development.js +0.22% 137.80 kB 138.11 kB +0.12% 34.51 kB 34.55 kB
oss-experimental/react-server/cjs/react-server.development.js +0.22% 143.99 kB 144.30 kB +0.07% 35.91 kB 35.93 kB
oss-stable-semver/react-art/umd/react-art.development.js +0.21% 822.10 kB 823.83 kB +0.18% 172.89 kB 173.21 kB
oss-stable/react-art/umd/react-art.development.js +0.21% 822.12 kB 823.85 kB +0.18% 172.91 kB 173.23 kB
oss-experimental/react-art/umd/react-art.development.js +0.20% 865.56 kB 867.29 kB +0.18% 181.23 kB 181.55 kB

Generated by 🚫 dangerJS against adfc69d

@@ -7,7 +7,7 @@
* @flow
*/

import * as React from 'react';
import type { Element } from './types';import * as React from 'react';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

This mode is going to be the new default in Flow going forward.
There was an unfortuante large number of suppressions in this update.

More on the changes can be found in this [Flow blog post](https://medium.com/flow-type/new-flow-language-rule-constrained-writes-4c70e375d190).

Added some of the required annotations using the provided codemod:

```sh
node_modules/.bin/flow codemod annotate-declarations --write .
```

[ghstack-poisoned]
@@ -316,6 +316,7 @@ function findCurrentUnmaskedContext(fiber: Fiber): Object {
break;
}
}
// $FlowFixMe[incompatible-type] we bail out when we get a null
node = node.return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the behavior before? It looks like the FlowFixMe would now hide assignments from something that's not Fiber or null. But maybe that wasn't caught before either?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think generally a variable seems to have a more "fixed" type now. We might want to dig into the cases separetly, but I think the do { ... } while (node != null); style isn't very easy to type right.

@kassens kassens deleted the branch gh/kassens/1/base October 4, 2022 19:49
@kassens kassens closed this Oct 4, 2022
kassens added a commit that referenced this pull request Oct 4, 2022
This mode is going to be the new default in Flow going forward.
There was an unfortuante large number of suppressions in this update.

More on the changes can be found in this [Flow blog post](https://medium.com/flow-type/new-flow-language-rule-constrained-writes-4c70e375d190).

Added some of the required annotations using the provided codemod:

```sh
node_modules/.bin/flow codemod annotate-declarations --write .
```

ghstack-source-id: 0b168e1b23f1305083e71d0b931b732e94705c73
Pull Request resolved: #25422
@kassens kassens deleted the gh/kassens/1/head branch October 4, 2022 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants