angular-docs-cn/packages
Paul Gschwendtner 4131715df5 fix(compiler-cli): incorrect bundled metadata for static class member call expressions (#28762)
Currently if developers use call expressions in their static
class members ([like we do in Angular](https://github.com/angular/angular/blob/master/packages/core/src/change_detection/differs/keyvalue_differs.ts#L121)),
the metadata that is generated for flat modules is invalid. This
is because the metadata bundler logic currently does not handle
call expressions in static class members and the symbol references
are not rewritten to avoid relative paths in the bundle.

Static class members using a call expression are not relevant for
the ViewEngine AOT compilation, but it is problematic that the
bundled metadata references modules using their original relative
path. This means that the bundled metadata is no longer encapsulated
and depends on other emitted files to be emitted in the proper place.

These incorrect relative paths can now cause issues where NGC
looks for the referenced symbols in the incorrect path. e.g.

```
src/
 | lib/
    | index.ts -> References the call expression using `../../di`
```

Now the metadata looks like that:

```
node_modules/
  | @angular/
  -- | core/
  -- -- | core.metadata.json -> Says that the call expr. is in `../../di`.
  | di/
```

Now if NGC tries to use the metadata files and create the summary files,
NGC resolves the call expression to the `node_modules/di` module. Since
the "unexpected" module does not contain the desired symbol, NGC will
error out.

We should fix this by ensuring that we don't ship corrupted metadata
to NPM which contains relative references that can cause such
failures (other imports can be affected as well; it depends on what
modules the developer has installed and how we import our call
expressions).

Fixes #28741.

PR Close #28762
2019-02-19 12:53:18 -08:00
..
animations build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
bazel feat(compiler-cli): make enableIvy ngtsc/true equivalent (#28616) 2019-02-19 12:28:44 -08:00
benchpress feat: optionally save complete performance log in chrome benchpress tests (#27551) 2019-02-05 23:35:32 -05:00
common docs: incorporate review feedback (#26827) 2019-02-14 19:33:14 +00:00
compiler fix(ivy): support schemas at runtime (#28637) 2019-02-14 19:31:51 +00:00
compiler-cli fix(compiler-cli): incorrect bundled metadata for static class member call expressions (#28762) 2019-02-19 12:53:18 -08:00
core fix(ivy): allign DebugNode.componentInstance semantics with view engine (#28756) 2019-02-19 12:51:47 -08:00
docs refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
elements build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
examples build(bazel): specify tsconfig-test dependency (#28696) 2019-02-16 20:57:34 -08:00
forms build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
http build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
language-service build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
platform-browser build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
platform-browser-dynamic build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
platform-server build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
platform-webworker build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
platform-webworker-dynamic build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
private/testing build: run playground e2e examples with bazel (#28490) 2019-02-04 16:51:11 -05:00
router build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
service-worker build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
upgrade build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
BUILD.bazel build(bazel): specify tsconfig-test dependency (#28696) 2019-02-16 20:57:34 -08:00
README.md Revert "docs: Remove unneeded file (#18106)" 2017-07-20 16:46:47 -05:00
empty.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
goog.d.ts test(ivy): add bundling test `todo_i18n` (#27420) 2018-12-04 19:59:12 -08:00
license-banner.txt build: bump year (#27880) 2019-01-11 11:15:59 -08:00
system.d.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
tsconfig-build.json build(bazel): Turning on strictPropertyInitialization for Angular. (#24572) 2018-06-25 07:57:13 -07:00
tsconfig-test.json build: refactor ambient node & jasmine types so they are only included where needed (#25491) 2018-08-16 13:46:43 -07:00
tsconfig.json build: switch example e2e tests to bazel (#28402) 2019-01-28 19:21:09 -08:00
types.d.ts build: switch to typescript's es2015 typings (#28570) 2019-02-06 14:17:55 -05:00

README.md

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

License: MIT