You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems as though there's a breaking change in thrift2flow 0.11.0 where maps become exact width maps in the js files:
3: optional map<string,string> myStringMap
Used to be this in 0.9.0
myStringMap?: ?{ [string]: string }
Is now this in 0.11.0
myStringMap?: ?{| [string]: string |}
This is a breaking change if flowtype was checking the types of assigned objects before. Afterward it produces this error:
Cannot assign Object.freeze(...) to pizza because property minSpend is missing in object type [1] but exists in object
literal [2] in property someVariable.myStringMap.
The text was updated successfully, but these errors were encountered:
ajbogh
changed the title
Map types changed from 0.9.0 to 0.11.0 to become exact matches
Map types changed from 0.9.0 to 0.11.0 to become exact width matches
Feb 8, 2021
I've discovered that if you upgrade to Flow 0.126.0 or higher then the error will disappear.
This is a breaking change for anybody running Flow 0.125.1 or lower, and should be a major version bump for thrift2flow instead of a minor version update. It's possible that nobody knew about the error, so perhaps there's a way to change the code to be compatible with old Flow versions, or delete the incompatible version from npm and republish as a major version with higher Flow version prerequisites.
Here's a tryflow example that allows you to switch the versions. On 0.125.1 it will error, but 0.126.0 it doesn't.
It seems as though there's a breaking change in thrift2flow 0.11.0 where maps become exact width maps in the js files:
Used to be this in 0.9.0
Is now this in 0.11.0
This is a breaking change if flowtype was checking the types of assigned objects before. Afterward it produces this error:
The text was updated successfully, but these errors were encountered: