Skip to content
Permalink
Branch: master
Commits on Apr 25, 2019
  1. feat(compiler): support skipping leading trivia in template source-ma…

    petebacondarwin authored and AndrewKushnir committed Apr 24, 2019
    …ps (#30095)
    
    Leading trivia, such as whitespace or comments, is
    confusing for developers looking at source-mapped
    templates, since they expect the source-map segment
    to start after the trivia.
    
    This commit adds skipping trivial characters to the lexer;
    and then implements that in the template parser.
    
    PR Close #30095
Commits on Apr 24, 2019
  1. refactor(ivy): ngcc - simplify `NewEntryPointFileWriter` code (#30085)

    petebacondarwin authored and AndrewKushnir committed Apr 24, 2019
    The lines that compute the paths for this writer were confusing.
    This commit simplifies and clarifies what is being computed.
    
    PR Close #30085
  2. fix(ivy): ngcc - do not copy external files when writing bundles (#30085

    petebacondarwin authored and AndrewKushnir committed Apr 24, 2019
    )
    
    Only the JS files that are actually part of the entry-point
    should be copied to the new entry-point folder in the
    `NewEntryPointFileWriter`.
    
    Previously some typings and external JS files were
    being copied which was messing up the node_modules
    structure.
    
    Fixes angular/angular-cli#14193
    
    PR Close #30085
Commits on Apr 8, 2019
  1. perf(ivy): ngcc - exit early if the targeted package has been compiled (

    petebacondarwin authored and IgorMinar committed Apr 6, 2019
    #29740)
    
    Previously we always walked the whole folder tree looking for
    entry-points before we tested whether a target package had been
    processed already. This could take >10secs!
    
    This commit does a quick check of the target package before doing
    the full walk which brings down the execution time for ngcc in this
    case dramatically.
    
    ```
    $ time ./node_modules/.bin/ivy-ngcc -t @angular/common/http/testing
    Compiling @angular/core : fesm2015 as esm2015
    Compiling @angular/core : fesm5 as esm5
    Compiling @angular/core : esm2015 as esm2015
    Compiling @angular/core : esm5 as esm5
    Compiling @angular/common/http : fesm2015 as esm2015
    Compiling @angular/common/http : fesm5 as esm5
    Compiling @angular/common/http : esm2015 as esm2015
    Compiling @angular/common/http : esm5 as esm5
    Compiling @angular/common/http/testing : fesm2015 as esm2015
    Compiling @angular/common/http/testing : fesm5 as esm5
    Compiling @angular/common/http/testing : esm2015 as esm2015
    Compiling @angular/common/http/testing : esm5 as esm5
    
    real	0m19.766s
    user	0m28.533s
    sys	0m2.262s
    ```
    
    ```
    $ time ./node_modules/.bin/ivy-ngcc -t @angular/common/http/testing
    The target entry-point has already been processed
    
    real	0m0.666s
    user	0m0.605s
    sys	0m0.113s
    ```
    
    PR Close #29740
  2. test(ivy): ngcc - improve and use the `MockLogger` (#29740)

    petebacondarwin authored and IgorMinar committed Apr 6, 2019
    Previously the console logger was being used in integration tests
    leading to lots of output during test runs.
    
    PR Close #29740
  3. fix(compiler-cli): ensure LogicalProjectPaths always start with a sla…

    petebacondarwin authored and IgorMinar committed Apr 1, 2019
    …sh (#29627)
    
    Previously, if a matching rootDir ended with a slash then the path
    returned from `logicalPathOfFile()` would not start with a slash,
    which is inconsistent.
    
    PR Close #29627
Commits on Apr 4, 2019
  1. test(docs-infra): fix eslint warnings (#29673)

    petebacondarwin authored and jasonaden committed Apr 3, 2019
    ```
    warning  An "it" that uses an async method should handle failure (use "done.fail")  jasmine/no-promise-without-done-fail
    ```
    
    PR Close #29673
  2. build(docs-infra): support doc aliases via `@alias` dgeni tag (#29673)

    petebacondarwin authored and jasonaden committed Apr 2, 2019
    Now, one can add an `@alias` tag to API docs, which tells dgeni that this
    API element (usually a `const`) is really just an alias for some API element
    defined elsewhere.
    
    Dgeni will then look up this API element and copy over the properties from
    the alias to the current doc.
    
    For example, we would like to privately export an Enum from `@angular/core`
    but then publicly export this from `@angular/common`:
    
    **packages/core/private_exports.ts**
    
    ```ts
    /**
     * Description of this document.
     */
    export enum ɵSomeEnum { ... }
    ```
    
    **packages/common/public_api.ts**
    
    ```ts
    import {ɵSomeEnum} from '@angular/core';
    
     /**
     * @alias core/ɵSomeEnum
     */
    export const SomeEnum = ɵSomeEnum;
    ```
    
    In the generated docs there will be a page for `common/SomeEnum`, which
    will be rendered as an enum, rather than a const, showing the description
    extracted from the `core/ɵSomeEnum`.
    
    ---
    
    The implementation of this feature required some refactoring of the other
    processing:
    
    1. Previously `ɵ` prefixed exports were not even considered.
    2. Due to 1. some processors needed to have guards added to ignore such
       private exports (`addMetadataAliases` and `checkContentRules`).
    3. The processing of package pages had to be reworked (and split) so that
       it picked up the aliased export docs after their alias proeprties had
       been copied.
    
    See FW-1207, FW-632, #29249
    
    PR Close #29673
  3. style(docs-infra): fix typo (#29673)

    petebacondarwin authored and jasonaden committed Apr 2, 2019
    PR Close #29673
Commits on Apr 3, 2019
  1. fix(ivy): ngcc - show logging via CLI by default (#29686)

    petebacondarwin authored and jasonaden committed Apr 3, 2019
    The new logger implementation caused a regression where
    by default the ngcc CLI did not output any logging messages.
    
    PR Close #29686
Commits on Apr 2, 2019
  1. fix(compiler-cli): ngcc - cope with processing entry-points multiple …

    petebacondarwin authored and jasonaden committed Apr 2, 2019
    …times (#29657)
    
    With the new API, where you can choose to only process the first
    matching format, it is possible to process an entry-point multiple
    times, if you pass in a different format each time.
    
    Previously, ngcc would always try to process the typings files for
    the entry-point along with processing the first format of the current
    execution of ngcc. But this meant that it would be trying to process
    the typings a second time.
    
    Now we only process the typings if they have not already been
    processed as part of processing another format in another
    even if it was in a different execution of ngcc.
    
    PR Close #29657
  2. refactor(upgrade): use Bazel packages to avoid symlinks in the source (

    petebacondarwin authored and jasonaden committed Mar 22, 2019
    …#29466)
    
    Previously we had to share code between upgrade/dynamic and upgrade/static
    by symlinking the `src` folder, which allowed both packages to access
    the upgrade/common files.
    
    These symlinks are always problematic on Windows, where we had to run
    a script to re-link them, and restore them.
    
    This change uses Bazel packages to share the `upgrade/common` code,
    which avoids the need for symlinking the `src` folder.
    
    Also, the Windows specific scripts that fixup the symlinks have also
    been removed as there is no more need for them.
    
    PR Close #29466
Commits on Apr 1, 2019
  1. fix(ivy): support finding the import of namespace-imported identifiers (

    petebacondarwin authored and jasonaden committed Dec 11, 2018
    #27675)
    
    Currently there is no support in ngtsc for imports of the form:
    
    ```
    import * as core from `@angular/core`
    
    export function forRoot(): core.ModuleWithProviders;
    ```
    
    This commit modifies the `ReflectionHost.getImportOfIdentifier(id)`
    method, so that it supports this kind of return type.
    
    PR Close #27675
  2. feat(compiler-cli): ngcc - make logging more configurable (#29591)

    petebacondarwin authored and jasonaden committed Mar 29, 2019
    This allows CLI usage to filter excessive log messages
    and integrations like webpack plugins to provide their own logger.
    
    // FW-1198
    
    PR Close #29591
  3. style(compiler-cli): ensure FFR type is implemented correctly (#29539)

    petebacondarwin authored and jasonaden committed Mar 26, 2019
    PR Close #29539
Commits on Mar 28, 2019
  1. fix(ivy): ngcc - write `.d.ts.map` files to the correct folder (#29556)

    petebacondarwin authored and jasonaden committed Mar 27, 2019
    Previously we were writing `.d.ts` and `.d.ts.map` to different
    folders.
    
    PR Close #29556
  2. fix(ivy): ngcc - ensure generated source map paths are correct (#29556)

    petebacondarwin authored and jasonaden committed Mar 27, 2019
    Previously we were using absolute paths, but since at rendering time
    we do not know exactly where the file will be written it is more correct
    to  change to using relative paths. This is actually better all round
    since it allows the folders to be portable to different machines, etc.
    
    PR Close #29556
  3. refactor(ivy): ngcc - remove the `targetPath` properties of Transform…

    petebacondarwin authored and jasonaden committed Mar 27, 2019
    …er and Renderer (#29556)
    
    We have already removed this concept from the public API. This just cleans it out altogether.
    
    The `targetPath` was an alternative output path to the original `basePath`.
    This is not really a very useful concept, since the actual target path
    of each output file is more complex and not consistently relative to the `basePath`.
    
    PR Close #29556
Commits on Mar 25, 2019
  1. test(ivy): add tests for component factory projectable node corner ca…

    petebacondarwin authored and mhevery committed Dec 21, 2018
    …ses (#27791)
    
    In some cases ivy expects projectable nodes to be passed in a different order
    to ViewEngine. Specifically, ivy expects the catch-all ("*") to be at index
    0, whereas ViewEngine expects it to be at its position at which it was parsed
    in the template.
    
    This commit adds one test that breaks under ivy and others that just describe
    more accurately what happens in corner cases.
    
    PR Close #27791
Commits on Mar 20, 2019
  1. feat(ivy): ngcc - support creating a new copy of the entry-point form…

    petebacondarwin authored and matsko committed Mar 20, 2019
    …at (#29092)
    
    This commit adds a `NewEntryPointFileWriter` that will be used in
    webpack integration. Instead of overwriting files in-place, this `FileWriter`
    will make a copy of the TS program files and write the transformed files
    there. It also updates the package.json with new properties that can be
    used to access the new entry-point format.
    
    FW-1121
    
    PR Close #29092
  2. refactor(ivy): ngcc - extract file writing out into a class (#29092)

    petebacondarwin authored and matsko committed Mar 20, 2019
    This is in preparation of having different file writing strategies.
    
    PR Close #29092
  3. refactor(ivy): ngcc - mark target entry-point as processed even if ng…

    petebacondarwin authored and matsko committed Mar 20, 2019
    …cc was a noop (#29092)
    
    If `targetEntryPointPath` is provided to `mainNgcc` then we will now mark all
    the `propertiesToConsider` for that entry-point if we determine that
    it does not contain code that was compiled by Angular (for instance it has
    no `...metadata.json` file).
    
    The commit also renames `__modified_by_ngcc__` to `__processed_by_ivy_ngcc__`, since
    there may be entry-points that are marked despite ngcc not actually compiling anything.
    
    PR Close #29092
  4. fix(ivy): ngcc - fail build-marker check if any formats were compiled…

    petebacondarwin authored and matsko committed Mar 20, 2019
    … with different ngcc (#29092)
    
    Now we check the build-marker version for all the formats
    rather than just the one we are going to compile.
    
    This way we don't get into the situation where one format was
    built with one version of ngcc and another format was built with
    another version.
    
    PR Close #29092
  5. refactor(ivy): ngcc - clean up the public API and export `hasBeenProc…

    petebacondarwin authored and matsko committed Mar 20, 2019
    …essed` helper (#29092)
    
    Now the public API does not contain internal types, such as `AbsoluteFsPath` and
    `EntryPointJsonProperty`. Instead we just accept strings and then guard them in
    `mainNgcc` as appropriate.
    
    A new public API function (`hasBeenProcessed`) has been exported to allow programmatic
    checking of the build marker when the package.json contents are already known.
    
    PR Close #29092
  6. refactor(ivy): ngcc - use a fixed set of properties to compile if non…

    petebacondarwin authored and matsko committed Mar 20, 2019
    …e provided (#29092)
    
    Previously we always considered all the properties in the package.json
    if no `propertiesToConsidere` were provided.
    But this results in computing a new set of properties for each entry-point
    plus iterating through many of the package.json properties that are
    not related to bundle-format paths.
    
    PR Close #29092
  7. fix(ivy): ngcc - teach Esm5ReflectionHost about aliased variables (#2…

    petebacondarwin authored and matsko committed Mar 20, 2019
    …9092)
    
    Sometimes, in ESM5 code, aliases to exported variables are used internally
    to refer to the exported value. This prevented some analysis from being
    able to match up a reference to an export to the actual export itself.
    
    For example in the following code:
    
    ```
    var HttpClientXsrfModule = /** @Class */ (function () {
      function HttpClientXsrfModule() {
      }
      HttpClientXsrfModule_1 = HttpClientXsrfModule;
      HttpClientXsrfModule.withOptions = function (options) {
          if (options === void 0) { options = {}; }
          return {
              ngModule: HttpClientXsrfModule_1,
              providers: [],
          };
      };
      var HttpClientXsrfModule_1;
      HttpClientXsrfModule = HttpClientXsrfModule_1 = tslib_1.__decorate([
          NgModule({
              providers: [],
          })
      ], HttpClientXsrfModule);
      return HttpClientXsrfModule;
    }());
    ```
    
    We were not able to tell that the `ngModule: HttpClientXsrfModule_1` property
    assignment was actually meant to refer to the `function HttpClientXrsfModule()`
    declaration.  This caused the `ModuleWithProviders` processing to fail.
    
    This commit ensures that we can compile typings files using the ESM5
    format, so we can now update the examples boilerplate tool so that it
    does not need to compile the ESM2015 format at all.
    
    PR Close #29092
  8. fix(ivy): ngcc - empower `Esm5ReflectionHost` to analyze `ModuleWithP…

    petebacondarwin authored and matsko committed Mar 20, 2019
    …roviders` functions (#29092)
    
    In ESM5 code, static methods appear as property assignments onto the constructor
    function. For example:
    
    ```
    var MyClass = (function() {
      function MyClass () {}
      MyClass.staticMethod = function() {};
      return MyClass;
    })();
    ```
    
    This commit teaches ngcc how to process these forms when searching
    for `ModuleWithProviders` functions that need to be updated in the typings
    files.
    
    PR Close #29092
  9. build(ivy): ngcc - only test under `no-ivy-aot` mode (#29092)

    petebacondarwin authored and matsko committed Mar 20, 2019
    We want ngcc to test non-AOT builds of the Angular packages,
    so we filter the tests in using the `no-ivy-aot` tag.
    
    PR Close #29092
  10. feat(ivy): ngcc - support only compiling the first format property to…

    petebacondarwin authored and matsko committed Mar 20, 2019
    … match (#29092)
    
    By default ngcc will compile all the format properties specified. With this
    change you can configure ngcc so that it will stop compiling an entry-point
    after the first property that matches the `propertiesToConsider`.
    
    PR Close #29092
  11. refactor(ivy): ngcc - simplify `Transformer.transform` API (#29092)

    petebacondarwin authored and matsko committed Mar 20, 2019
    By ensuring that EntryPointBundle contains everything that `Transformer.transform()`
    needs to do its work, we can simplify its signature.
    
    PR Close #29092
  12. refactor(ivy): ngcc - remove flat-format and use AbsoluteFsPath (#29092)

    petebacondarwin authored and matsko committed Mar 20, 2019
    Now that we are using package.json properties to indicate which
    entry-point format to compile, it turns out that we don't really
    need to distinguish between flat and non-flat formats, unless we
    are compiling `@angular/core`.
    
    PR Close #29092
  13. feat(ivy): ngcc - compile only specified package.json format properti…

    petebacondarwin authored and matsko committed Mar 20, 2019
    …es (#29092)
    
    You can now specify a list of properties in the package.json that
    should be considered (in order) to find the path to the format to compile.
    
    The build marker system has been updated to store the markers in
    the package.json rather than an additional external file.
    Also instead of tracking the underlying bundle format that was compiled,
    it now tracks the package.json property.
    
    BREAKING CHANGE:
    
    The `proertiesToConsider` option replaces the previous `formats` option,
    which specified the final bundle format, rather than the property in the
    package.json.
    If you were using this option to compile only specific bundle formats,
    you must now modify your usage to pass in the properties in the package.json
    that map to the format that you wish to compile.
    
    In the CLI, the `--formats` is no longer available. Instead use the
    `--properties` option.
    
    FW-1120
    
    PR Close #29092
  14. feat(ivy): ngcc - support targeting a start entry-point (#29092)

    petebacondarwin authored and matsko committed Mar 20, 2019
    You can now, programmatically, specify an entry-point where
    the ngcc compilation will occur.
    Only this entry-point and its dependencies will be compiled.
    
    FW-1119
    
    PR Close #29092
Older
You can’t perform that action at this time.