plasma-umass / doppio

Breaks the browser language barrier (includes a plugin-free JVM).
http://plasma-umass.github.io/doppio-demo
MIT License
2.17k stars 176 forks source link

Switch to TypeScript #243

Closed jvilk closed 11 years ago

jvilk commented 11 years ago

We have a working TypeScript port of Doppio, but we need to backport a number of items to it.

Here's a comparison view to see all of the lines of code we need to backport: https://github.com/int3/doppio/compare/30c1e99ef1cba1cbbd338043d5881b9f709e1393...master

Here's a list (in order of when it was added to Doppio):

jvilk commented 11 years ago

I'll probably have to update this once we've been Bowerified, but it's a start!

jvilk commented 11 years ago

Updated with more items.

perimosocordiae commented 11 years ago

Files that still need work:

lavelle commented 11 years ago

Is it counterproductive for me to be writing a load of new stuff in CoffeeScript right now? I know the conversion process is pretty simple since TypeScript is a strict JS superset so you can just compile and change the extension, but generated CoffeeScript can be kinda ugly (especially loops and stuff) and it seems like if TypeScript is the future of this project I may as well start using it now, since I'll have to in the long run.

perimosocordiae commented 11 years ago

It's up to you. Your options are:

The porting process really isn't too bad, though it does involve manually un-crappifying the coffee-compiled output.

jvilk commented 11 years ago

@lavelle : If you keep plugging away in CoffeeScript. I'll convert your code for you. :thumbsup:

But if you want to be proactive about the switch, you'll probably want to wait until we fix the browser build process for TypeScript. Right now, it's broken.

lavelle commented 11 years ago

Okay, thanks. I'll stick with CoffeeScript for now and switch as soon as TypeScript is finished and becomes Doppio's official language.

jvilk commented 11 years ago

Adding the few things we've added to master to the checklist. I think it's time for a final push to get this dude building properly.

jvilk commented 11 years ago

Using RequireJS, I have a dev build of typed-doppio 'booting up' (preloading files) in the browser. It's not completely working (for some reason, running ls in the root directory never triggers the callback...), but it's progress!

Here's some build instructions:

It's pretty simple compared to our current shenanigans. And we no longer have to track dependencies (!) in the Makefile or index.mustache. :smile:

This also suggests that we will be able to use RequireJS's 'optimizer' to make a single module for all of Doppio, and that we can simply build release from the development output. For example (Make pseudo-code):

release: dev
  // Recursively run make so it'll see the new files.
  make _release
_release: build/release/*/*.js
  // Run RequireJS's optimizer.
  // Run Uglify on the module.
  // Remove staging directory.
build/release/*/*.js: build/dev/*/*.js
  // Run through Jez's ice-cream, dump into a staging directory.

There are still some issues, though:

...but we're close. :smile:

jvilk commented 11 years ago

Oh. I see. read_dir is broken... shakes fist at @perimosocordiae

I fixed a few things, but I'll need to do some debugging later as it's still returning nothing: https://github.com/int3/doppio/commit/acb9b3ba2c64e43e62847395b43ff979da7d757f

jvilk commented 11 years ago

The dev build is on-par with master Doppio (ignoring Ace editor issues). I'm trying to get a release build working using RequireJS's compiler. When I get this working, we'll have an easy automated method of generating a release build and the library using that compiler. But for now, it's choking on loading the JavaScript dependencies in the release configuration (e.g. underscore).

(Note that I still need to update the Makefile; that's the last thing I plan to do)

jvilk commented 11 years ago

OK. So, apparently the release build issues were caused by me not placing the amd-dependency annotations at the top of the source files. Once that was done, it... worked!

todo:

jvilk commented 11 years ago

Alright! Release/dev/library builds properly work (can someone sanity check me?). We just need to port over comments!

Here's the comments checklist:

jvilk commented 11 years ago

I believe we are ready. There's nothing more to backport, release/release-cli/dev/dev-cli all build properly and pass tests in the same way as master, and I've verified that building from a cleanly cloned repo works.

jvilk commented 11 years ago

I just hit the switch! We're typed now. :smile: