-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
Also simplifies. It doesn't need to be a class since it is never initialized.
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. |
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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
?
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:
views/
directory)