enforce_local_inference_annotations is now on by default. To migrate your codebase run the following codemod to add the required annotations: flow codemod annotate-lti. More details on the changes are explained in the Requiring More Annotations to Functions and Classes in Flow blog post.
New Features:
Class members can be suggested by autocomplete even if this is not typed explicitly.
Notable bug fixes:
We will now consistently emit object-this-reference errors. Previously these errors were missing when the object is an argument of Object.freeze(), Object.defineProperties() or Object.create().
Fix crash when walking directories that can't be accessed.
Fixed a potential crash when two type identifiers are declared in the same block.
Library Definitions:
Improve fs.readFile type definition when the encoding config option is supplied.
v0.188.2
Bug fixes:
Fix crash during incremental recheck
Performance:
Improve performance of auto-imports index update for large codebases
v0.188.1
Bug fixes:
Fix a crash when querying hg
Misc:
We renamed the codemod command flow codemod annotate-lti to flow codemod annotate-functions-and-classes to clarify that this is not the only codemod necessary for enabling LTI eventually.
v0.188.0
Likely to cause new Flow errors:
Previously we supported a weird JS runtime rule for constructor returns when you call new SomeClass:
If the returned value is primitive, then it's ignored and the instance will be returned instead.
If the returned value is object like, then the return object will be the eval result of new SomeClass.
This is confusing, and we dropped support for this feature in this release. Now we enforce that all class constructors must return void.
Fixed a bug preventing refinements from being invalidated in inline && expressions: examples like typeof x === 'number' && reassignXToString() && (x: number) were passing even if reassignXToString() assigned a a string value to x.
New Features:
flow codemod annotate-lti is now provided to help prepare your codebase to enable the enforce_local_inference_annotations=true flag. In order to eventually enable local type inference, we will require additional annotations in places we can't contextually type your code. You can enable the annotation enforcement now with enforce_local_inference_annotations=true in flowconfig. This flag enables the behaviors of all the following experimental flags, which will be deleted in the next release:
To migrate your codebase, you can run the following codemod to prepare your codebase for the new requirement: flow codemod annotate-lti. Check out an upcoming blog post for more details.
Misc:
Remove the file_watcher.watchman.survive_restarts flowconfig option, which was deprecated in 0.158.0. We will always try to survive Watchman restarts.
Remove the experimental.refactor flowconfig option. It has been true by default since v0.158.0.
enforce_local_inference_annotations is now on by default. To migrate your codebase run the following codemod to add the required annotations: flow codemod annotate-lti. More details on the changes are explained in the Requiring More Annotations to Functions and Classes in Flow blog post.
New Features:
Class members can be suggested by autocomplete even if this is not typed explicitly.
Notable bug fixes:
We will now consistently emit object-this-reference errors. Previously these errors were missing when the object is an argument of Object.freeze(), Object.defineProperties() or Object.create().
Fix crash when walking directories that can't be accessed.
Fixed a potential crash when two type identifiers are declared in the same block.
Library Definitions:
Improve fs.readFile type definition when the encoding config option is supplied.
0.188.2
Bug fixes:
Fix crash during incremental recheck
Performance:
Improve performance of auto-imports index update for large codebases
0.188.1
Bug fixes:
Fix a crash when querying hg
Misc:
We renamed the codemod command flow codemod annotate-lti to flow codemod annotate-functions-and-classes to clarify that this is not the only codemod necessary for enabling LTI eventually.
0.188.0
Likely to cause new Flow errors:
Previously we supported a weird JS runtime rule for constructor returns when you call new SomeClass:
If the returned value is primitive, then it's ignored and the instance will be returned instead.
If the returned value is object like, then the return object will be the eval result of new SomeClass.
This is confusing, and we dropped support for this feature in this release. Now we enforce that all class constructors must return void.
Fixed a bug preventing refinements from being invalidated in inline && expressions: examples like typeof x === 'number' && reassignXToString() && (x: number) were passing even if reassignXToString() assigned a a string value to x.
New Features:
flow codemod annotate-lti is now provided to help prepare your codebase to enable the enforce_local_inference_annotations=true flag. In order to eventually enable local type inference, we will require additional annotations in places we can't contextually type your code. You can enable the annotation enforcement now with enforce_local_inference_annotations=true in flowconfig. This flag enables the behaviors of all the following experimental flags, which will be deleted in the next release:
To migrate your codebase, you can run the following codemod to prepare your codebase for the new requirement: flow codemod annotate-lti. Check out an upcoming blog post for more details.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps flow-parser from 0.166.0 to 0.189.0.
Release notes
Sourced from flow-parser's releases.
... (truncated)
Changelog
Sourced from flow-parser's changelog.
... (truncated)
Commits
434f463
v0.189.012cfe0d
Create tarjan nodes on demand8017d21
[reordered-env] Non-assigning type writes should never be added as dependents60ab3a3
v0.188.27b05879
Speed up reindexingeaca887
Fix incremental crash when removing old dependentsf6431a7
Do not trigger contextual typing whenarray_literal_providers
flag is on bu...1e122a1
Add class members to autocomplete resultsa1f41d4
[lti] Use implicit instantiation pin type machinery to pin the element type f...a744d32
[libdef] Improvefs.readFile
type definition for better overload resolutionDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)