Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Decaffeinate event-kit#38

Merged
wbinnssmith merged 5 commits intoatom:masterfrom
wbinnssmith:wbinnssmith/decaffeinate
Sep 11, 2018
Merged

Decaffeinate event-kit#38
wbinnssmith merged 5 commits intoatom:masterfrom
wbinnssmith:wbinnssmith/decaffeinate

Conversation

@wbinnssmith
Copy link
Copy Markdown
Contributor

@wbinnssmith wbinnssmith commented Sep 11, 2018

This:

  • Runs eventkit through decaffeinate
  • Manually cleans up unnecessary code from decaffeinate
  • Removes coffeelint and coffee-script build steps
  • Removed lib from .gitignore as lib is now the source files (no build steps!)
  • Converts the Gruntfile to js
  • Formats the js to roughly comply with other Atom packages

Notes:

  • event-kit now requires a modern version of Node/Electron. Let me know if we need this compatible with older environments (e.g. browsers) and I can add a build step through babel.
  • In Emitter, Disposable, and CompositeDisposable, I removed declaring disposed = false from the respective prototype to the constructors for each instance. This feels like more idiomatic js, but if this was placed on the prototype as an optimization, please let me know.
  • In a few places, I cleaned things up to be more readable and idiomatic js rather than preserving a strict interpretation of the CoffeeScript behavior. e.g.
    const handlers =
      this.handlersByEventName && this.handlersByEventName[eventName]

...instead of a ternary handling the null case, this short circuits on the falsey case, as this.handlersByEventName should only ever be a nullable object. Happy to tighten this up if desired.

Test Plan: npm test and linked this package with Atom and Nuclide and smoke tested superficial features

@wbinnssmith wbinnssmith force-pushed the wbinnssmith/decaffeinate branch 3 times, most recently from a5889ae to 9799b2a Compare September 11, 2018 21:51
@wbinnssmith wbinnssmith force-pushed the wbinnssmith/decaffeinate branch from 9799b2a to 42676fc Compare September 11, 2018 22:12
Gruntfile.js Outdated
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@wbinnssmith wbinnssmith force-pushed the wbinnssmith/decaffeinate branch from 42676fc to a255ad1 Compare September 11, 2018 22:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants