Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert trivial coffee to plain JS #2546

Merged
merged 13 commits into from
Feb 5, 2018

Conversation

jhawthorn
Copy link
Contributor

This converts many of the remaining CoffeeScript files to plain JS.

This focuses on converting our remaining CoffeeScript files which can be straightforwardly converted to plain JS. These aren't huge files, are reasonably well organized already, and don't heavily use any of CoffeeScript's more powerful features (like classes).

This converts ~200 lines of CoffeeScript into ~280 lines of JS.

After this we are left with 250 lines of coffee in only a few sections, which I will tackle in separate PRs:

  • components/tabs (which is a large class)
  • promotions (which could be better organization)
  • stock_management (which should have views moved into views/ directory)
  • store_credits (which could be better organized)

@kennyadsl
Copy link
Member

Have you used any tool to perform this conversion?

@jhawthorn
Copy link
Contributor Author

Have you used any tool to perform this conversion?

I used coffeescript (1.x version, since 2.0+ emits es6) and manually edited the output.

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Just left a small note, of course not blocking. Thanks!

Spree.ready(function() {
var $gateway_type = $('select.js-gateway-type');
var $preference_source = $('select.js-preference-source');
var original_gtwy_type = $gateway_type.val();
Copy link
Member

Choose a reason for hiding this comment

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

what about taking advantage of this PR to change this variable name to original_gateway_type?

@jhawthorn jhawthorn merged commit 4161b95 into solidusio:master Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants