Skip to content

Transpile to ES6 #2268

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

Merged
merged 1 commit into from
Nov 30, 2016
Merged

Transpile to ES6 #2268

merged 1 commit into from
Nov 30, 2016

Conversation

rosen-vladimirov
Copy link
Contributor

@rosen-vladimirov rosen-vladimirov commented Nov 27, 2016

NOTE: Merge only after telerik/mobile-cli-lib#843 is merged

Add support for ES6 transpilation. Change dependency injection in order to match the class and constructor keywords.
Update istanbul to latest version as its previous versions do not support ES6.

Remove bluebird.d.ts as it conflicts with Promises from TypeScript's ES6 d.ts.
Remove bluebird as dependency - we will use native Promises from now on.

Add support for Node.js 4 and 5 - both versions have limited support for ES6 features, so in order to support them we have to:

  • pass --harmony flag to Node.js
  • do not use some features like default values of method arguments.
  • do not use spread operator - it's implementation in Node.js 4 is limited only to arrays. Even this implementation has issues. So use .apply instead of using spread operator. Remove all other usages of spread operator (for objects).

Add tests scripts for istanbul and mocha, as they both will need the --harmony flag as well, so we cannot execute them directly with Node.js 4 and 5. Instead we'll execute a custom script, that will start a new node process.

Introduce test-scripts directory with JavaScript executables to start the tests. Set them in package.json. They are required as when Node 4 or Node 5 is used, the tests will need --harmony flag as well.
Exclude test-scripts directory from npm package (add it to .npmignore) - users do not need these files.

Exclude .vscode/launch.json from .gitignore and add predefined launch configurations. They can be used for debugging CLI process and unit tests.

nativescript_launch_configs_2

Part of #2204

@rosen-vladimirov rosen-vladimirov added this to the 2.5.0 milestone Nov 27, 2016
@rosen-vladimirov rosen-vladimirov self-assigned this Nov 27, 2016
@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/es6 branch 2 times, most recently from 1c26c66 to bfa6fc1 Compare November 28, 2016 10:48
Add support for ES6 transpilation. Change dependency injection in order to match the `class` and `constructor` keywords.
Update istanbul to latest version as its previous versions do not support ES6.

Remove bluebird.d.ts as it conflicts with Promises from TypeScript's ES6 d.ts.
Remove bluebird as dependency - we will use native Promises from now on.

Add support for Node.js 4 and 5 - both versions have limited support for ES6 features, so in order to support them we have to:
 - pass --harmony flag to Node.js
 - do not use some features like default values of method arguments.
 - do not use spread operator - it's implementation in Node.js 4 is limited only to arrays. Even this implementation has issues. So use `.apply` instead of using spread operator. Remove all other usages of spread operator (for objects).

Add tests scripts for istanbul and mocha, as they both will need the `--harmony` flag as well, so we cannot execute them directly with Node.js 4 and 5. Instead we'll execute a custom script, that will start a new node process.

Introduce `test-scripts` directory with JavaScript executables to start the tests. Set them in package.json. They are required as when Node 4 or Node 5 is used, the tests will need `--harmony` flag as well.
Exclude `test-scripts` directory from npm package (add it to `.npmignore`) - users do not need these files.

Exclude `.vscode/launch.json` from `.gitignore` and add predefined launch configurations. They can be used for debugging CLI process and unit tests.
@dtopuzov dtopuzov merged commit 60f842b into master Nov 30, 2016
@enchev enchev deleted the vladimirov/es6 branch November 30, 2016 09:23
@dtopuzov dtopuzov restored the vladimirov/es6 branch November 30, 2016 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants