angular-cn/packages
Alex Rickabaugh d4cee514f6 refactor(ivy): obviate the Bazel component of the ivy_switch (#26550)
Originally, the ivy_switch mechanism used Bazel genrules to conditionally
compile one TS file or another depending on whether ngc or ngtsc was the
selected compiler. This was done because we wanted to avoid importing
certain modules (and thus pulling them into the build) if Ivy was on or
off. This mechanism had a major drawback: ivy_switch became a bottleneck
in the import graph, as it both imports from many places in the codebase
and is imported by many modules in the codebase. This frequently resulted
in cyclic imports which caused issues both with TS and Closure compilation.

It turns out ngcc needs both code paths in the bundle to perform the switch
during its operation anyway, so import switching was later abandoned. This
means that there's no real reason why the ivy_switch mechanism needed to
operate at the Bazel level, and for the ivy_switch file to be a bottleneck.

This commit removes the Bazel-level ivy_switch mechanism, and introduces
an additional TypeScript transform in ngtsc (and the pass-through tsc
compiler used for testing JIT) to perform the same operation that ngcc
does, and flip the switch during ngtsc compilation. This allows the
ivy_switch file to be removed, and the individual switches to be located
directly next to their consumers in the codebase, greatly mitigating the
circular import issues and making the mechanism much easier to use.

As part of this commit, the tag for marking switched variables was changed
from __PRE_NGCC__ to __PRE_R3__, since it's no longer just ngcc which
flips these tags. Most variables were renamed from R3_* to SWITCH_* as well,
since they're referenced mostly in render2 code.

Test strategy: existing test coverage is more than sufficient - if this
didn't work correctly it would break the hello world and todo apps.

PR Close #26550
2018-10-19 09:23:05 -07:00
..
animations test(ivy): enable unit tests for @angular/animations (#26470) 2018-10-16 20:31:56 -07:00
bazel feat: add support for TypeScript 3.1 (#26151) 2018-09-28 09:34:51 -07:00
benchpress fix(benchpress): Use performance.mark() instead of console.time() (#24114) 2018-08-30 21:33:40 -07:00
common docs: clarify CurrencyPipe display property (#25852) 2018-10-05 15:42:57 -07:00
compiler feat(ivy): i18n compiler support for i18nStart and i18nEnd instructions (#26442) 2018-10-17 11:03:52 -07:00
compiler-cli refactor(ivy): obviate the Bazel component of the ivy_switch (#26550) 2018-10-19 09:23:05 -07:00
core refactor(ivy): obviate the Bazel component of the ivy_switch (#26550) 2018-10-19 09:23:05 -07:00
docs refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
elements docs: add package doc files (#26047) 2018-10-05 15:42:14 -07:00
examples build: upgrade `@types/jasminewd2` to 2.0.4 (#26139) 2018-10-12 14:11:11 -07:00
forms docs: more form overview edits (#25663) 2018-09-25 18:48:15 -07:00
http docs: add package doc files (#26047) 2018-10-05 15:42:14 -07:00
language-service refactor: fix return type of `tryCall` (#25481) 2018-09-27 12:07:38 -07:00
platform-browser refactor(platform-browser): remove type assertion on console.profileEnd (#26303) 2018-10-11 14:12:23 -07:00
platform-browser-dynamic build(bazel): update to rules_typescript 0.17.0 & rules_nodejs 0.13.4 (#25920) 2018-09-18 13:05:38 -07:00
platform-server feat: add support for TypeScript 3.1 (#26151) 2018-09-28 09:34:51 -07:00
platform-webworker build(bazel): update to rules_typescript 0.17.0 & rules_nodejs 0.13.4 (#25920) 2018-09-18 13:05:38 -07:00
platform-webworker-dynamic ci(ivy): configure CI environments for Ivy JIT and AOT (#24309) 2018-06-08 13:34:27 -07:00
private/testing build: refactor ambient node & jasmine types so they are only included where needed (#25491) 2018-08-16 13:46:43 -07:00
router feat(router): add prioritizedGuardValue operator optimization and allowing UrlTree return from guard (#26478) 2018-10-16 20:31:32 -07:00
service-worker fix(service-worker): clean up caches from old SW versions (#26319) 2018-10-16 14:12:07 -07:00
upgrade fix(upgrade): properly destroy upgraded component elements and descendants (#26209) 2018-10-11 21:07:48 -07:00
BUILD.bazel build: refactor ambient node & jasmine types so they are only included where needed (#25491) 2018-08-16 13:46:43 -07: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
es6-subset.d.ts build: switch from npm to yarn (#19328) 2017-09-22 13:20:52 -07:00
goog.d.ts fix(compiler): add typings for `COMPILED`. 2017-09-29 09:26:38 -07:00
license-banner.txt docs(common): update copyright years (#21232) 2018-01-04 17:45:36 -05:00
rollup.config.js refactor: make all rollup config ES5 compatible (#20028) 2017-10-30 23:09:17 -04: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-metadata.json fix(compiler): Fix look up of entryComponents in AOT Summaries (#24892) 2018-09-11 16:23:17 -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 fix(compiler): Fix look up of entryComponents in AOT Summaries (#24892) 2018-09-11 16:23:17 -07:00
types.d.ts build: refactor ambient node & jasmine types so they are only included where needed (#25491) 2018-08-16 13:46:43 -07: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