-
-
Notifications
You must be signed in to change notification settings - Fork 198
Closed
Description
CLI uses fibers in order to use sync code instead of callbacks. Fibers are great, but most of the people are not familiar with them. Also Promises are more popular now and they are integrated in Node.js.
TypeScript allows using async/await for getting Promises results instead of chaining .then.
Here are the steps to be taken when fibers are removed and async/await is used instead:
- Drop support for Node.js 0.12 (Deprecated in 2.4) PRs: Break CLI process when Node is not supported telerik/mobile-cli-lib#851 , Break CLI process when Node is not supported #2320
- Transpile to ES6 instead of ES5. TypeScript's async/await support is available when transpiling to ES6. PRs: Transpile to ES6 telerik/mobile-cli-lib#843 , Transpile to ES6 #2323
- Use sync API for Node core modules, like
fsandchild_process. Currently CLI uses async versions of the methods and wraps them with futures. In case they are replaced with Promises, each method that uses such method will have to be marked as async. However in case we use the sync versions of the methods (for example usefs.existsSyncinstead offs.existsin CLI's file-system.ts). This way some of methods, which should be marked asasync, will become absolutely synchronous and we'll not have toawaitthem. PRs: Use sync api of fs telerik/mobile-cli-lib#853, Use sync api of fs #2347 - Fix hooks which use $fs, $childProcess, etc. as the code of the methods is changed.
- Replace fibers with async/await in mobile-cli-lib: PR: Remove fibers and use async/await telerik/mobile-cli-lib#865 ,
- Replace fibers with async/await in nativescript-cli: Remove fibers #2411
- Replace fibers with async/await in ios-sim-portable: Remove fibers ios-sim-portable#83
- Test with Node.js 4
- Test with Node.js 6
- Test with Node.js 7
Plamen5kov and slavchevpetekanev, dtopuzov and hdeshev