Declare new Range and Position interfaces #35

Merged
merged 2 commits into from Feb 14, 2017

Projects

None yet

1 participant

@wincent
Contributor
wincent commented Feb 14, 2017

This is the first step in breaking some circular type dependencies that we have which are preventing us from breaking the language service into separate packages. The goal here is to move all shared types into the types module, which should itself have no dependencies on anything inside the language service.

  • Declare Range and Position as interfaces.
  • Annotate that the Range and Position classes implement the interfaces.
  • Switch to property assignment syntax so that Flow won't complain about covariance vs invariance.
wincent added some commits Feb 14, 2017
@wincent wincent Declare new Range and Position interfaces
This is the first step in breaking some circular type dependencies that
we have which are preventing us from breaking the language service into
separate packages. The goal here is to move all shared types into the
types module, which should itself have no dependencies on anything
inside the language service.

- Declare `Range` and `Position` as interfaces.
- Annotate that the `Range` and `Position` classes implement the
  interfaces.
- Switch to property assignment syntax so that Flow won't complain about
  covariance vs invariance.
1352d08
@wincent wincent Make `lessThanOrEqualTo` more concise
We can just return the expression result directly instead of doing:

```
if (condition) {
  return true;
}
return false;
```
7f71ca4
@wincent wincent merged commit 15e09df into graphql:master Feb 14, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@wincent wincent deleted the wincent:glh/types branch Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment