sleepycat / geox

Geocoding meets GraphQL
ISC License
2 stars 0 forks source link

Convert project to Typescript #3

Open DenisCarriere opened 8 years ago

DenisCarriere commented 8 years ago

You can't release code that's not Typescript... ;) come on!

Well you've done a lot of commits prior to this, so it might be a giant mess to merge.

I'll let you tackle that, but this code works as valid Typescript with all the bells and whistles.

I've had to import a graphql.d.ts definition because the one that's hosted isn't compatible with graphql-anywhere.

DenisCarriere commented 8 years ago

@sleepycat By looking at your latest commits, this shouldn't be that much of a hairball to merge, Just delete all those ugly Babel dependencies, that's so early 2016 ;)

sleepycat commented 8 years ago

While I'm interested in type systems for JS generally, I'm a little hesitant to convert this project over to Typescript.

While things like Coffeescript, Haml, Typescript and all these "compile to web" things are great, I feel like they represent a barrier that projects hoping for contributors need to consider. We would be saying that it's no longer enough to only know Javascript, understand the code, navigate deps, setup and testing, but you'd also need to know this other thing too.

When it comes to the type checkers themselves, the little I have read makes me want to understand Typescript and other options like Flowtype better before using them.

A lighter touch option of adding a type definition file would be great though!

DenisCarriere commented 8 years ago

@sleepycat Ops! Just converted you're repo in Typescript.

Well the nice thing with typescript is you can always convert it down to ES6 and eliminate all that Typescript stuff.

I also did a major code overhaul...

DenisCarriere commented 8 years ago

@sleepycat You also have to take into consideration that NOOOO one is going to look at your source code, "unless it's me".

The extent that someone will use your library will be this:

import * as geox from 'geox'
geox.geocode('Ottawa, Canada')
  .then(data => console.log(data)

If this one core function doesn't work properly, then all those other bells and whistles you added won't matter.

DenisCarriere commented 8 years ago

@sleepycat Another thing, you're talking about making it "simple" when you've included 3 GraphQL dependencies... lol! Think about it...

I've seen flow syntax, it's painful to write & to look at, the ideal Typescript + JSDocs.