Currently, upon execution `ng` will load all description files AND code for all available commands. This requires a large amount of unnecessary file access and processing since only at most one command will be executed. This change limits the loading to only command being executed in the common case and a subset of commands in the event an alias is used. The help command now loads all commands during its execution which is needed to gather command description information. Further improvements are possible by only loading the necessary metadata instead of the execution code (and its dependencies) as well.
This change allows for savings of ~250ms per execution.
Examples:
Before -- `./node_modules/.bin/ng version 0.99s user 0.17s system 113% cpu 1.020 total`
After -- `./node_modules/.bin/ng version 0.70s user 0.13s system 110% cpu 0.749 total`
Before -- `./node_modules/.bin/ng g c a 1.91s user 0.30s system 111% cpu 1.996 total`
After -- `./node_modules/.bin/ng g c a 1.62s user 0.27s system 110% cpu 1.715 total`
This happens if there is no file at all (otherwise it would be undefined). This was
causing an exception and returning false instead of undefined, preventing the
prompt. Now we return undefined in this case.
To be clear, this is because getWorkspace returns null, and the logic makes
analyticsConfig null in this case.
Some commands (like schematics) need to have custom reporting for
analytics. Schematics and Architect commands need to verify if the
schematic/architect builder run is in the safelist, for example.
Node.js 8 is now in maintenance LTS status and will be EOL in December 2019. Node.js 10 is now the active LTS version with Node.js 12 due for arrival in April 2019. Node.js 10+ provides an improved performance baseline as well as access to newer Node.js APIs and Javascript language features which the Angular CLI will now be able to leverage.
Angular 5.0+ has a full peer dependencies setup (with 6.0+ also having a configurable runtime error check) to ensure that an appropriate version of typescript is available for compilation. Angular CLI 8.0+ does not support Angular versions prior to these and therefore the warning is redundant. For the case where the developer wishes to use an unsupported TypeScript version, the developer would need to adjust two similar but differently name settings in two different configuration files.