exact object type annotations for Flow plugin #104
Conversation
Current coverage is 94.13% (diff: 100%)@@ master #104 diff @@
==========================================
Files 19 19
Lines 3130 3068 -62
Methods 320 320
Messages 0 0
Branches 800 802 +2
==========================================
- Hits 3029 2888 -141
+ Misses 101 100 -1
- Partials 0 80 +80
|
} | ||
|
||
case 125: | ||
++this.state.pos; return this.finishToken(tt.braceR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs 2 space indentation.
Thank you for bringing the new feature immediately to babylon. We recently are a little bit behind the flow specs with other features, and I'm really happy to see more help in bringing the new features to babylon. I have two small nitpicks (see comments) but otherwise looks really good. To make the complete chain of babel work with this change there also needs to be a PR to babel that makes babel-generator aware of the |
@danez Sure, will make the requested changes here and in |
@danez Hi Daniel - incorporated your suggestions. Not sure what to do about the coverage numbers, if anything - I'd have thought the new tests would cover the new code paths, but LMK if there's something else to be added. Re |
@danez PR to But I think we may need to bump Babylon's version to reflect the new support, and then specify the new version in |
Coverage looks good and you can create the PR already for babel. The tests will fail there of course but that is okay for features that span over both repos. |
Ah you were faster with your reply ;) yes this is now perfectly fine. We are going to merge the change in babel after babylon gets released. |
@danez ah, ok cool - thank you Daniel! |
case 125: ++this.state.pos; return this.finishToken(tt.braceR); | ||
|
||
case 123: | ||
if (this.hasPlugin("flow") && this.input.charCodeAt(this.state.pos + 1) == 124) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=== 124
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(y)
Looks like the coverage would be for a failing test on https://github.com/babel/babylon/pull/104/files#diff-8ce9de97e7fb2bd7f30e9eee69714584R406 |
@hzoo added test and coverage looks taken care of, I think. Not sure why the build failure though, or how to kick. |
I restarted got the same failure - should be ok |
@hzoo cool, thanks! |
@hzoo - thanks for merging! Would you mind publishing this to npm? Thanks! |
Sorry been busy not doing open source 😄, can do it real quick |
@gabelevi sorry for delay, released now! |
Summary: New rules and fixes. Most noteworhy though is that babylon@6.10.0 is now pulled in. This version has support for "exact object type notation" (see babel/babylon#104), that is `{| |}`. Reviewed By: nmote Differential Revision: D3888815 fbshipit-source-id: 963aa5fcbe920d4380e43d5e93bfc1d0bb7f3be6
Adds support for exact object type annotations in the Flow plugin. Exact object types are delimited by
{|
and|}
, but are otherwise identical in syntax to ordinary object types.Replicates the functionality added to Flow here.