angular/packages/compiler-cli/ngcc/test
Pete Bacon Darwin 83868be713 fix(ngcc): handle UMD factories that do not use all params (#34660)
In some cases, where a module imports a dependency
but does not actually use it, UMD bundlers may remove
the dependency parameter from the UMD factory function
definition.

For example:

```
import * as x from 'x';
import * as z from 'z';
export const y = x;
```

may result in a UMD bundle including:

```
(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ?
        factory(exports, require('x'), require('z')) :
    typeof define === 'function' && define.amd ?
        define(['exports', 'x', 'z'], factory) :
    (global = global || self, factory(global.myBundle = {}, global.x));
}(this, (function (exports, x) { 'use strict';
...
})));
```

Note that while the `z` dependency is provide in the call,
the factory itself only accepts `exports` and `x` as parameters.

Previously ngcc appended new dependencies to the end of the factory
function, but this breaks in the above scenario. Now the new
dependencies are prefixed at the front of parameters/arguments
already in place.

Fixes #34653

PR Close #34660
2020-01-08 15:07:37 -08:00
..
analysis refactor(ngcc): remove private declaration aliases (#34254) 2019-12-18 11:25:03 -08:00
dependencies fix(ngcc): avoid error due to circular dependency in EsmDependencyHost (#34512) 2020-01-08 15:00:51 -08:00
entry_point_finder fix(ngcc): avoid error due to circular dependency in EsmDependencyHost (#34512) 2020-01-08 15:00:51 -08:00
execution refactor(ngcc): add debug messages to help with debugging in parallel mode (#34437) 2019-12-17 11:39:19 -08:00
helpers refactor(ngcc): store whether to render legacy i18n message ids in the bundle (#34135) 2019-12-03 10:15:54 -08:00
host fix(ngcc): recognize re-exports with require() calls in UMD (#34512) 2020-01-08 15:00:50 -08:00
integration refactor(ngcc): slightly improve the info in error messages (#34254) 2019-12-18 11:25:03 -08:00
logging feat(compiler-cli): ngcc - make logging more configurable (#29591) 2019-04-01 11:53:28 -07:00
migrations feat(ivy): error in ivy when inheriting a ctor from an undecorated base (#34460) 2019-12-18 15:04:51 -08:00
packages test(ngcc): cleanup entry-point bundle testcases (#34415) 2019-12-16 07:45:38 -08:00
rendering fix(ngcc): handle UMD factories that do not use all params (#34660) 2020-01-08 15:07:37 -08:00
writing refactor(ngcc): abstract updating package.json files behind an interface (#32427) 2019-09-09 15:55:13 -04:00
BUILD.bazel fix(ngcc): do not emit ES2015 code in ES5 files (#33514) 2019-11-13 13:49:31 -08:00
utils_spec.ts refactor(ngcc): use a special map for memoizing expensive-to-compute values (#34512) 2020-01-08 15:00:51 -08:00