-
Notifications
You must be signed in to change notification settings - Fork 292
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
Gruntfile.coffee → Gruntfile.js #885
Conversation
Gruntfile.js
Outdated
|
||
'use strict'; | ||
|
||
module.exports = grunt => { |
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.
Let's stick to consistency:
module.exports = (grunt) => {
instead of
module.exports = grunt => {
Like in line 119.
Gruntfile.js
Outdated
// Test Related | ||
grunt.registerTask('test', () => grunt.task.run(['clean:docs_coverage', 'scripts', 'test_init', 'test_prepare', 'karma:test'])); | ||
|
||
grunt.registerTask('test_prepare', function(test_name) { |
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.
Why not (test_name) =>
?
Gruntfile.js
Outdated
|
||
grunt.registerTask('test_init', ['prepare_dist', 'prepare_test']); | ||
|
||
grunt.registerTask('test_run', test_name => { |
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.
Here also
(test_name) => {
Gruntfile.js
Outdated
if (target === 'prod' || target === 'staging') { | ||
return grunt.task.run(`set_version:${target}`, 'init', `prepare_${target}`, 'aws_prepare'); | ||
} else if (target === 'dev') { | ||
return grunt.task.run("set_version:staging", 'init', "prepare_staging", 'aws_prepare'); |
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.
'
instead of "
Gruntfile.js
Outdated
const app_files = prepare_file_names(scripts.app); | ||
const component_files = prepare_file_names(scripts.component); | ||
const vendor_files = prepare_file_names(scripts.vendor); | ||
const test_files = test_name ? ["../test/js/#{test_name}Spec.js"] : ['../test/**/*Spec.js']; |
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.
'
instead of "
First of all I'm 100% with the team to move away from CoffeeScript, even though I used to be a big supporter of it and the main influencer for this choice in this project. But times have changed and CoffeeScript is keeping us behind, as we can't use the latest and greatest features of JavaScript. Having said that, I'm just a little bit against the timing of it. We should probably update the build scripts as a last step, instead of first. Here is why:
What should we do insteadSince #883 is already merged my vote is to do the following in that order:
|
@lipis, dropping CoffeeScript means dropping CoffeeScript. It doesn't matter with which files we start our "CoffeeScript to JavaScript" movement because by the end of this movement, there will be no more CoffeeScript. To start I just picked a file with little logic (which is 1. prepare_file_names = (file_name_array) =>
return (file_name.replace 'deploy/', '' for file_name in file_name_array) → const prepare_file_names = (file_name_array) => {
return file_name_array.map(file_name => file_name.replace('deploy/', ''));
}; 2. test_files = if test_name then ["../test/js/#{test_name}Spec.js"] else ['../test/**/*Spec.js'] → const test_files = test_name ? ['../test/js/#{test_name}Spec.js'] : ['../test/**/*Spec.js']; Everything else I just throwed into js2.coffee and from there into Lebab. Afterwards I executed P.S. I know that it hurts letting things go. But in the end it's the birth of something new. 🌻 |
Sure and I don't mind letting it go.. It's done, dead, kaput, null. All I'm saying is that we just have to attack it from the other side :) |
🎉 |
Type of change
Screenshot