Go to file
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
.circleci ci(docs-infra): re-use env variable (#26138) 2018-10-08 12:01:02 -07:00
.github docs: fix formatting of PULL_REQUEST_TEMPLATE.md (#26512) 2018-10-17 13:09:45 -07:00
aio feat(docs-infra): add v6 to the aio version picker 2018-10-18 12:38:29 -07:00
docs refactor(ivy): obviate the Bazel component of the ivy_switch (#26550) 2018-10-19 09:23:05 -07:00
integration refactor(ivy): obviate the Bazel component of the ivy_switch (#26550) 2018-10-19 09:23:05 -07:00
modules build: upgrade `@types/jasminewd2` to 2.0.4 (#26139) 2018-10-12 14:11:11 -07:00
packages refactor(ivy): obviate the Bazel component of the ivy_switch (#26550) 2018-10-19 09:23:05 -07:00
scripts build: add more labels to review-pr script (#26493) 2018-10-16 14:36:28 -07:00
tools build: fix deps for running modules/benchmarks/src/largetable/render3:perf (#26482) 2018-10-16 14:10:55 -07:00
.bowerrc chore(dgeni): clean up legacy typings bundle creation 2015-10-29 21:19:59 +00:00
.clang-format feat(tooling): Add a .clang-format for automated JavaScript formatting. 2015-04-02 08:44:34 -07:00
.editorconfig chore(.editorconfig): include markdown config 2015-01-27 00:14:48 -08:00
.gitattributes chore: force lf EOL for ts files (#11143) 2016-08-29 12:41:58 -07:00
.gitignore build: update Bazel dependency to 0.11.1 (#23297) 2018-04-10 23:01:30 -07:00
.mailmap build: add a Git .mailmap with my new name (#19550) 2017-10-09 14:35:30 -07:00
.nvmrc build: update .nvmrc file to correct node version (#25992) 2018-09-18 13:11:58 -07:00
.pullapprove.yml ci: add forms-overview guide to forms approval list (#26549) 2018-10-18 12:01:15 -07:00
.travis.yml ci(docs-infra): allow `aio_local` builds to fail on Travis (#26366) 2018-10-11 13:38:59 -07:00
BUILD.bazel test(upgrade): run tests against AngularJS v1.7.x as well (#25231) 2018-08-01 14:10:21 -07:00
CHANGELOG.md docs: add release announcement URL 2018-10-18 13:29:04 -07:00
CODE_OF_CONDUCT.md docs: fix community tab in GitHub by copying CoC 2018-02-27 19:02:30 -08:00
CONTRIBUTING.md docs: Indicate that PRs should have an associated issue (#25436) 2018-10-15 16:51:46 -07:00
LICENSE docs(common): update copyright years (#21232) 2018-01-04 17:45:36 -05:00
README.md docs: improve the GitHub README.md, update links, etc 2018-05-03 13:26:12 -07:00
WORKSPACE build: RxJS updated to 6.3 (#26087) 2018-09-26 17:01:15 -07:00
bower.json docs: branding fixes (#14132) 2017-01-27 15:03:11 -06:00
browser-providers.conf.js feat(elements): enable Shadow DOM v1 and slots (#24861) 2018-08-30 21:33:14 -07:00
build.sh feat(ivy): implement TestBed (#25369) 2018-08-14 11:58:47 -07:00
gulpfile.js style: update gulp task to format untracked and diff files separately (#24969) 2018-09-27 12:09:08 -07:00
index.bzl style: format .bzl files with buildifier (#23544) 2018-08-08 13:12:07 -07:00
karma-js.conf.js fix(router): take base uri into account in `setUpLocationSync()` (#20244) 2018-08-06 11:11:07 -07:00
package.json release: cut the v7.0.0 release 2018-10-18 10:51:21 -07:00
protractor-e2e.conf.js refactor: add license header to JS files & format files (#12081) 2016-10-04 20:39:20 -07:00
protractor-examples-e2e.conf.js refactor: format and lint code 2016-12-12 11:30:25 -08:00
protractor-perf.conf.js build(bazel): fix broken travis CI (#24788) 2018-07-24 08:26:16 -07:00
shims_for_IE.js Revert "refactor: add license header to JS files & format files (#12035)" 2016-10-04 14:06:41 -07:00
test-events.js fix(platform-browser): run BLACK_LISTED_EVENTS outside of ngZone (#18993) 2017-09-05 15:33:22 -05:00
test-main.js refactor(core): remove withBody from public testing API (#25171) 2018-07-31 15:09:32 -07:00
test.sh feat: typescript 2.9 support (#24652) 2018-07-03 13:32:06 -07:00
tslint.json style: tslint enforces no debugger statements left behind (#25532) 2018-08-16 16:00:22 -07:00
yarn.lock build: upgrade `@types/jasminewd2` to 2.0.4 (#26139) 2018-10-12 14:11:11 -07:00
yarn.lock.readme.md docs: replace npm with yarn in lockfile readme (#25309) 2018-08-06 13:38:13 -07:00

README.md

Build Status CircleCI BrowserStack Status Join the chat at https://gitter.im/angular/angular npm version

Angular

Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages.

Quickstart

Get started in 5 minutes.

Changelog

Learn about the latest improvements.

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.