jvilk / BrowserFS

BrowserFS is an in-browser filesystem that emulates the Node JS filesystem API and supports storing and retrieving files from various backends.
Other
3.07k stars 218 forks source link

Convert to TypeScript #33

Closed jvilk closed 10 years ago

jvilk commented 11 years ago

After experimenting with TypeScript with Doppio, I have determined that it is very suitable for projects such as this one.

As a result, sometime later in the summer I will likely move to TypeScript. I do not anticipate that it will take longer than a week of work, and the payments for switching over will be worth the amount of churn required to perform the conversion.

List of benefits:

jvilk commented 10 years ago

Current checklist (for typed branch):

Functionality:

Other:

Git:

perimosocordiae commented 10 years ago

I was thinking today that it might be worthwhile to write a post-mortem of our Coffeescript -> Typescript conversion efforts for Doppio and BrowserFS. I have a feeling that's the sort of thing HN/Proggit would enjoy.

jvilk commented 10 years ago

Yeah, I'd be willing to contribute to something like that; we should sketch out how we'd want to go about it.

Some things I'm noticing from the code-generation standpoint:

try
  # Code
catch error
  # Catch block
var error;
try {
  // Code
} catch (_error) {
  error = _error;
}
for i in [0...3]
  # Body
var i, _i;
for (i = _i = 0; _i <= 3; i = ++_i) {
  // Loop body
}

And then there are the other benefits of using TypeScript:

Some downsides:

jvilk commented 10 years ago

And I guess describing the classes of bugs we've found...