angular/packages/compiler-cli/ngcc/test
George Kalpakas cfbb1a1e77 fix(ngcc): correctly detect dependencies in CommonJS (#34528)
Previously, `CommonJsDependencyHost.collectDependencies()` would only
find dependencies via imports of the form `var foo = require('...');` or
`var foo = require('...'), bar = require('...');` However, CommonJS
files can have imports in many different forms. By failing to recognize
other forms of imports, the associated dependencies were missed, which
in turn resulted in entry-points being compiled out-of-order and failing
due to that.

While we cannot easily capture all different types of imports, this
commit enhances `CommonJsDependencyHost` to recognize the following
common forms of imports:

- Imports in property assignments. E.g.:
  `exports.foo = require('...');` or
  `module.exports = {foo: require('...')};`

- Imports for side-effects only. E.g.:
  `require('...');`

- Star re-exports (with both emitted and imported heleprs). E.g.:
  `__export(require('...'));` or
  `tslib_1.__exportStar(require('...'), exports);`

PR Close #34528
2020-01-13 09:48:20 -08:00
..
analysis fix(ivy): don't run decorator handlers against declaration files (#34557) 2020-01-10 15:54:51 -08:00
dependencies fix(ngcc): correctly detect dependencies in CommonJS (#34528) 2020-01-13 09:48:20 -08:00
entry_point_finder fix(ngcc): avoid error due to circular dependency in EsmDependencyHost (#34512) 2020-01-08 15:00:50 -08:00
execution refactor(ngcc): add debug messages to help with debugging in parallel mode (#34437) 2019-12-17 11:39:18 -08:00
helpers refactor(ngcc): store whether to render legacy i18n message ids in the bundle (#34135) 2019-12-03 10:15:53 -08:00
host fix(ngcc): recognize re-exports with imported TS helpers in CommonJS and UMD (#34527) 2020-01-10 08:28:50 -08:00
integration refactor(ngcc): slightly improve the info in error messages (#34254) 2019-12-18 11:25:01 -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:49 -08:00
packages test(ngcc): cleanup entry-point bundle testcases (#34415) 2019-12-16 07:45:36 -08:00
rendering fix(ngcc): insert definitions after statement (#34677) 2020-01-08 15:09:24 -08:00
writing refactor(ngcc): abstract updating package.json files behind an interface (#32427) 2019-09-09 15:55:13 -04:00
BUILD.bazel Revert "refactor: handle breaking changes in rules_nodejs 1.0.0 (#34589)" (#34730) 2020-01-10 14:12:15 -08:00
utils_spec.ts refactor(ngcc): use a special map for memoizing expensive-to-compute values (#34512) 2020-01-08 15:00:50 -08:00