Skip to content

Commit

Permalink
Flow: use implicit exact object types
Browse files Browse the repository at this point in the history
Flow standard is now to use `{ }` for strict objects and `{ key: value, ... }` for open objects, see: facebook/relay@6fa0b0d and facebook/react-native@00cfb0f

This change should be without any problems as longs as users of our NPM libraries are using Flow with `exact_by_default=true` (which is now pretty standard I'd say).

Here is how object types behave before this change:

```
type A = { x: number }; // already "exact" type but disallowed because it would be confusing to mix different syntaxes
type B = { x: number, ... }; // this is inexact
type C = {| x: number |}; // this is explicitly exact and the only allowed way how to describe type "exactness"
```

Here is how object types behave _after_ this change:

```
type A = { x: number }; // this is the only allowed syntax for "exact" type
type B = { x: number, ... }; // this is still inexact
type C = {| x: number |}; // this is also exact but no longer allowed (so it's not confusing)
```

Some related (non-blocking) issues:

- gajus/eslint-plugin-flowtype#467
- facebook/flow#8612

adeira-source-id: 5f0c905ae627f670804581f78c1b570f3f71a1e6
  • Loading branch information
mrtnzlml authored and adeira-github-bot committed Jul 6, 2021
1 parent 5c42adb commit dd20601
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Unreleased

Note for all Flow users: all projects in [`adeira/universe`](https://github.com/adeira/universe) now use implicit exact Flow types (`{}` for strict objects and `{ ... }` for open objects, syntax `{||}` is deprecated). We do not expect any issues as long as you are using `exact_by_default=true` Flow option.

# 1.0.0

Initial release.

0 comments on commit dd20601

Please sign in to comment.