runtimejs / runtime

[not maintained] Lightweight JavaScript library operating system for the cloud
http://runtimejs.org
Apache License 2.0
1.93k stars 128 forks source link

Update everything to ES6 and adopt a code style #120

Closed facekapow closed 8 years ago

facekapow commented 8 years ago

This PR is a big one, it changes pretty much all of the JavaScript files, since it updates everything to ES6, plus adopts airbnb/javascript as a code style (with a few tweaks, like using require instead of ES6 modules).

Done so far:

vitkarpov commented 8 years ago

Goodbye commit history :)

facekapow commented 8 years ago

Also added guidelines for contributing, plus a list of exceptions to Airbnb's style guide.

RossComputerGuy commented 8 years ago

How do we update runtime with npm.

facekapow commented 8 years ago

This is done and ready for review/merge, the only thing I'm not really confident about is the CONTRIBUTING.md. I've got some more node compatibility fixes, but I'd prefer to add them in another PR after this has been merged to avoid any conflicts.

iefserge commented 8 years ago

This is awesome, I'll do some tests too, to make sure everything works.

facekapow commented 8 years ago

Ok, I've update the code to only use arrow functions for property functions and callbacks and function declarations for everything else, I've run the code through a beautifier, removed the newlines in js/__loader.js, used spaces instead of newlines in js/core/pci/scan.js, readded eslint-plugin-runtime-internal, disabled no-use-before-define for functions, and fixed the other issues you mentioned. And I tested it and it still works.

facekapow commented 8 years ago

Converted IIFE functions to arrow functions, and fixed the minor style issues. Sorry, most of these little things are because of the beautifier I ran it through.

iefserge commented 8 years ago

@facekapow left couple of places where there are a few statements on the single line.

facekapow commented 8 years ago

@iefserge Well, that's the last time I use a beautifier 😄

iefserge commented 8 years ago

LGTM great work 👍

kesla commented 8 years ago

wow. Amazing.

facekapow commented 8 years ago

Great, then I'll just do a quick once-over on the code and merge.

facekapow commented 8 years ago

Everything looks ok, I tried to run the JS tests, but those are definitely broken (more specifically, tape kept complaining about Stream), but I did some manual feature testing and everything looks fine. Merge?

vitkarpov commented 8 years ago

bye-bye history of changes :)

iefserge commented 8 years ago

@facekapow yeah, I've been looking into tests issue, should be fine, going to fix it afterwards. @vitkarpov yeah, but consistent and nice code style is good :)