Commit Graph

25 Commits

Author SHA1 Message Date
Alex Rickabaugh 48fec08c95 perf(compiler-cli): refactor the performance tracing infrastructure ()
ngtsc has an internal performance tracing package, which previously has not
really seen much use. It used to track performance statistics on a very
granular basis (microseconds per actual class analysis, for example). This
had two problems:

* it produced voluminous amounts of data, complicating the analysis of such
  results and providing dubious value.
* it added nontrivial overhead to compilation when used (which also affected
  the very performance of the operations being measured).

This commit replaces the old system with a streamlined performance tracing
setup which is lightweight and designed to be always-on. The new system
tracks 3 metrics:

* time taken by various phases and operations within the compiler
* events (counters) which measure the shape and size of the compilation
* memory usage measured at various points of the compilation process

If the compiler option `tracePerformance` is set, the compiler will
serialize these metrics to a JSON file at that location after compilation is
complete.

PR Close 
2021-03-24 13:42:24 -07:00
Joey Perrott d1ea1f4c7f build: update license headers to reference Google LLC ()
Update the license headers throughout the repository to reference Google LLC
rather than Google Inc, for the required license headers.

PR Close 
2020-05-26 14:26:58 -04:00
Keen Yee Liau 9935aa43ad refactor(compiler-cli): Move diagnostics files to language service ()
The following files are consumed only by the language service and do not
have to be in compiler-cli:

1. expression_diagnostics.ts
2. expression_type.ts
3. typescript_symbols.ts
4. symbols.ts

PR Close 
2019-11-14 09:29:07 -08:00
Charles Lyding fc8eecad3f fix(compiler-cli): remove unused CLI private exports ()
These exports are no longer used by the CLI since 7.1.0.  Since major versions of the CLI are now locked to major versions of the framework, a CLI user will not be able to use FW 9.0+ on an outdated version (<7.1.0) of the CLI that uses these old APIs.

PR Close 
2019-11-01 17:43:47 +00:00
Pete Bacon Darwin 7186f9c016 refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc ()
To improve cross platform support, all file access (and path manipulation)
is now done through a well known interface (`FileSystem`).

For testing a number of `MockFileSystem` implementations are provided.
These provide an in-memory file-system which emulates operating systems
like OS/X, Unix and Windows.

The current file system is always available via the static method,
`FileSystem.getFileSystem()`. This is also used by a number of static
methods on `AbsoluteFsPath` and `PathSegment`, to avoid having to pass
`FileSystem` objects around all the time. The result of this is that one
must be careful to ensure that the file-system has been initialized before
using any of these static methods. To prevent this happening accidentally
the current file system always starts out as an instance of `InvalidFileSystem`,
which will throw an error if any of its methods are called.

You can set the current file-system by calling `FileSystem.setFileSystem()`.
During testing you can call the helper function `initMockFileSystem(os)`
which takes a string name of the OS to emulate, and will also monkey-patch
aspects of the TypeScript library to ensure that TS is also using the
current file-system.

Finally there is the `NgtscCompilerHost` to be used for any TypeScript
compilation, which uses a given file-system.

All tests that interact with the file-system should be tested against each
of the mock file-systems. A series of helpers have been provided to support
such tests:

* `runInEachFileSystem()` - wrap your tests in this helper to run all the
wrapped tests in each of the mock file-systems.
* `addTestFilesToFileSystem()` - use this to add files and their contents
to the mock file system for testing.
* `loadTestFilesFromDisk()` - use this to load a mirror image of files on
disk into the in-memory mock file-system.
* `loadFakeCore()` - use this to load a fake version of `@angular/core`
into the mock file-system.

All ngcc and ngtsc source and tests now use this virtual file-system setup.

PR Close 
2019-06-25 16:25:24 -07:00
Filipe Silva e1f51eaa55 feat(compiler-cli): export tooling definitions ()
PR Close 
2019-04-17 17:23:01 -07:00
Alex Eagle a227c528ca feat(compiler-cli): expose ngtsc as a TscPlugin ()
This lets us run ngtsc under the tsc_wrapped custom compiler (Used in Bazel)
It also allows others to simply wire ngtsc into an existing typescript compilation binary

PR Close 
2019-01-29 16:41:59 -08:00
Jason Aden 227f7e44d6 Revert "feat(compiler-cli): expose ngtsc as a TscPlugin" ()
This reverts commit df2221c6476df1f2d2478b949702f3270c3a4565.

PR Close 
2019-01-29 11:29:48 -08:00
Alex Eagle 22f76df8f2 feat(compiler-cli): expose ngtsc as a TscPlugin ()
This lets us run ngtsc under the tsc_wrapped custom compiler (Used in Bazel)
It also allows others to simply wire ngtsc into an existing typescript compilation binary

PR Close 
2019-01-29 09:44:58 -08:00
Jason Aden e18a52e24a Revert "feat(compiler-cli): expose ngtsc as a TscPlugin" ()
This reverts commit cf4edbce40a3a65fdefe90760a93e43bc45b7d19.

PR Close 
2019-01-28 22:39:56 -08:00
Alex Eagle 59cc724e3b feat(compiler-cli): expose ngtsc as a TscPlugin ()
This lets us run ngtsc under the tsc_wrapped custom compiler (Used in Bazel)
It also allows others to simply wire ngtsc into an existing typescript compilation binary

PR Close 
2019-01-28 20:16:47 -08:00
Alex Eagle 5b16ce9302 fix(compiler-cli): don't report emit diagnostics when --noEmitOnError is off () 2017-11-02 14:49:38 -07:00
Tobias Bosch 8d45fefc31 refactor(compiler): remove old ngtools api and add listLazyRoutes to new api ()
Usages of `NgTools_InternalApi_NG_2` from `@angular/compiler-cli` will now
throw an error.

Adds `listLazyRoutes` to `@angular/compiler-cli/ngtools2.ts` for getting
the lazy routes of a `ng.Program`.
PR Close 
2017-10-23 18:46:04 -04:00
Chuck Jazdzewski a75040d0a1 refactor(compiler): bump metadata version to 4 ()
Also adds auto upgrade from lower version based
on the .d.ts file (e.g. from version 3 to 4).

This is needed as we are now also capturing type aliases
in metadata files (and we rely on this),
see 6e3498ca8e.
2017-09-26 13:31:59 -07:00
Matias Niemelä 4695c69cf1 refactor(compiler): remove all source-level traces to tsc-wrapped ()
- temporarily keeps the old sources under packages/tsc-wrapped
  until the build scripts are changed to use compiler-cli everywhere.
- removes the compiler options `disableTransformerPipeline` that was introduced
  in a previous beta of Angular 5, i.e. the transformer based compiler
  is now always enabled.

PR Close 
2017-09-13 20:47:37 -04:00
Tobias Bosch a69172f6ce fix(compiler): fix bazel integration and make `perform-compile` more flexible
Needed to allow custom checking for diagnostics.
2017-09-07 19:30:04 -04:00
Chuck Jazdzewski cf7d47dda0 feat(compiler-cli): add watch mode to `ngc` ()
With this change ngc now accepts a `-w` or a `--watch`
command-line option that will automatically perform a
recompile whenever any source files change on disk.

PR Close 
2017-08-31 09:46:24 -07:00
Jason Aden 3a6d270bb8 Revert "feat(compiler-cli): add watch mode to `ngc` ()"
This reverts commit 06d01b2287.
2017-08-30 19:02:03 -07:00
Chuck Jazdzewski 06d01b2287 feat(compiler-cli): add watch mode to `ngc` ()
With this change ngc now accepts a `-w` or a `--watch`
command-line option that will automatically perform a
recompile whenever any source files change on disk.

PR Close 
2017-08-30 18:00:52 -07:00
Tobias Bosch 27d901a51d refactor(compiler-cli): cleanup API for transformer based ngc
This is in preparation for watch mode.
2017-08-11 13:20:45 -07:00
Chuck Jazdzewski 5b7432b6ea fix(compiler-cli): remove minimist dependency of compiler-cli/index ()
Indirectly removes the minimist dependency in the language service
package was added with the addition of `ngc.ts`.
2017-08-07 14:30:35 -07:00
Abhimanyu Deora 205abe8140 build: fix broken bazel build () 2017-07-26 09:40:33 -07:00
Chuck Jazdzewski 3097083277 feat(compiler-cli): new compiler api and command-line using TypeScript transformers 2017-06-23 16:18:44 -07:00
Chuck Jazdzewski bb0902c592 refactor(compiler-cli): move the expression expression type checker ()
The expression type checker moved from the language service
to the compiler-cli in preparation to using it to check
template expressions.
2017-05-09 16:16:50 -07:00
Jason Aden 3e51a19983 refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00