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 Version Package to JS #6494

Merged
merged 7 commits into from
Mar 29, 2017
Merged

Convert Version Package to JS #6494

merged 7 commits into from
Mar 29, 2017

Conversation

MartinSchoeler
Copy link
Contributor

@RocketChat/core

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6494 March 27, 2017 14:59 Inactive
Copy link
Member

@rodrigok rodrigok left a comment

Choose a reason for hiding this comment

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

I'll finish the review after the function to class conversion.

@@ -0,0 +1,76 @@
//let Future, VersionCompiler, async, exec, os;
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove this?

//let Future, VersionCompiler, async, exec, os;

let VersionCompiler = undefined;
const exec = Npm.require('child_process').exec;
Copy link
Member

Choose a reason for hiding this comment

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

Here you can improve with const {exec} = Npm.require('child_process');

const exec = Npm.require('child_process').exec;
const os = Npm.require('os');
const Future = Npm.require('fibers/future');
const async = Npm.require('async');
Copy link
Member

Choose a reason for hiding this comment

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

You probably can use imports here:

import {exec} from 'child_process';
import os from 'os';
import Future from 'fibers/future';
import async from 'async');

Can you test this?

VersionCompiler = (function() {
function VersionCompiler() {}

VersionCompiler.prototype.processFilesForTarget = function(files) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you change this to the ES6 class format?

import Future from 'fibers/future';
import async from 'async';

Plugin.registerCompiler({
Copy link
Member

Choose a reason for hiding this comment

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

Move this to after the class declaration

return new VersionCompiler();
});

VersionCompiler = (class {
Copy link
Member

Choose a reason for hiding this comment

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

Use class VersionCompiler {

});

VersionCompiler = (class {
constructor() {}
Copy link
Member

Choose a reason for hiding this comment

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

Remove this non used constructor

@engelgabriel engelgabriel added this to the 0.55.0 milestone Mar 29, 2017
@engelgabriel engelgabriel merged commit f379571 into develop Mar 29, 2017
@engelgabriel engelgabriel deleted the version-to-js branch March 29, 2017 18:26
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.

4 participants