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

Add declare type and declare interface Flow syntax support to 6.x #3230

Merged
merged 2 commits into from
Jan 5, 2016

Conversation

samwgoldman
Copy link
Contributor

If this looks good, I'll back port to 5.x

This has been a feature in Flow for a long time (couldn't easily find a
specific commit adding this). Interfaces are basically undocumented, though, so
it's easy to see how this was missed.
@codecov-io
Copy link

Current coverage is 85.02%

Merging #3230 into master will decrease coverage by -0.17% as of 26c97c4

@@            master   #3230   diff @@
======================================
  Files          215     215       
  Stmts        15662   15684    +22
  Branches      3353    3355     +2
  Methods          0       0       
======================================
- Hit          13343   13336     -7
- Partial        675     703    +28
- Missed        1644    1645     +1

Review entire Coverage Diff as of 26c97c4

Powered by Codecov. Updated on successful CI builds.

@hzoo
Copy link
Member

hzoo commented Jan 5, 2016

👍 looks good

@hzoo hzoo added the parser label Jan 5, 2016
@amasad
Copy link
Member

amasad commented Jan 5, 2016

Looks good!

amasad added a commit that referenced this pull request Jan 5, 2016
Add `declare type` and `declare interface` Flow syntax support to 6.x
@amasad amasad merged commit 6cc17e4 into babel:master Jan 5, 2016
samwgoldman added a commit to samwgoldman/babel that referenced this pull request Jan 6, 2016
facebook-github-bot pushed a commit to facebook/flow that referenced this pull request Jul 11, 2017
Summary:
adds a `DeclareInterface` ast node to distinguish interfaces with a
`declare` modifier:

```
declare interface Foo {} // DeclareInterface
interface Foo {} // InterfaceDeclaration
```

currently, both are parsed as `InterfaceDeclaration`s, and the locations of both
only include the `interface Foo {}` part. the `declare` is orphaned. this is
bad.

we actually added this node to babel (babel/babel#3230) but didn't do the same for ourselves.

Reviewed By: samwgoldman

Differential Revision: D5394048

fbshipit-source-id: 43cc2f117ff2501ae16041da15848a1ceeea30a7
facebook-github-bot pushed a commit to facebook/flow that referenced this pull request Jul 11, 2017
Summary:
adds a `DeclareTypeAlias` ast node to distinguish type aliases with a
`declare` modifier:

```
declare type x = number // DeclareTypeAlias
type x = number // TypeAlias
```

currently, both are parsed as `TypeAlias`s, and the locations of both
only include the `type x = number` part. the `declare` is orphaned. this is
bad.

we actually added this node to babel (babel/babel#3230) but didn't do the same for ourselves.

Reviewed By: samwgoldman

Differential Revision: D5395003

fbshipit-source-id: a4a84b2ce4384496a03434332fc46de5a0feebea
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants