angular-cn/packages/core/test/render3
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
..
compiler_canonical refactor(ivy): merge directives into LViewData (#26316) 2018-10-09 16:46:00 -07:00
ivy refactor(ivy): obviate the Bazel component of the ivy_switch (#26550) 2018-10-19 09:23:05 -07:00
jit feat(ivy): Add InheritanceDefinitionFeature to support directive inheritance (#24570) 2018-06-29 06:42:40 -07:00
styling feat(ivy): enhance [style] and [class] bindings to be animation aware (#26096) 2018-10-16 20:39:19 -07:00
BUILD.bazel build(bazel): update to rules_typescript 0.17.0 & rules_nodejs 0.13.4 (#25920) 2018-09-18 13:05:38 -07:00
Inherit_definition_feature_spec.ts fix(ivy): remove metadata from *Def and introduce *DefWithMeta types (#26203) 2018-10-04 10:11:17 -07:00
basic_perf.ts refactor(ivy): generate vars in component defs (#25562) 2018-08-20 11:08:10 -07:00
change_detection_spec.ts refactor(ivy): revert LNode.data into LViewData[HOST] (#26424) 2018-10-15 10:17:12 -07:00
common_integration_spec.ts fix(ivy): wrapper fns arent necessary anymore (#26108) 2018-09-26 00:03:16 -07:00
common_with_def.ts fix(ivy): objects like ElementRef should not use a special injection fn (#26064) 2018-09-25 12:51:29 -07:00
component_spec.ts fix(ivy): remove metadata from *Def and introduce *DefWithMeta types (#26203) 2018-10-04 10:11:17 -07:00
content_spec.ts test(ivy): add testing utility to replace loadDirective (#26316) 2018-10-09 16:46:00 -07:00
control_flow_spec.ts refactor(ivy): generate vars in component defs (#25562) 2018-08-20 11:08:10 -07:00
di_spec.ts refactor(ivy): remove LNode (#26426) 2018-10-15 11:20:32 -07:00
directive_spec.ts fix(ivy): register to directive outputs on ng-template / ng-container (#25698) 2018-08-30 21:22:01 -07:00
discovery_utils_spec.ts feat(ivy): expose node injector as part of debug context (#26210) 2018-10-04 10:12:02 -07:00
domino.d.ts feat(core): Moving Renderer3 into @angular/core (#20855) 2017-12-21 21:40:58 -08:00
exports_spec.ts fix(ivy): create LViewData from blueprint (#25587) 2018-08-22 15:58:42 -04:00
i18n_spec.ts fix(ivy): create LViewData from blueprint (#25587) 2018-08-22 15:58:42 -04:00
imported_renderer2.ts refactor(ivy): misc cleanup (#25369) 2018-08-14 11:58:47 -07:00
instructions_spec.ts refactor(ivy): remove LNode (#26426) 2018-10-15 11:20:32 -07:00
integration_spec.ts refactor(ivy): handle animation metadata normalization in the compiler (#26481) 2018-10-16 20:31:04 -07:00
jit_environment_spec.ts fix(ivy): remove metadata from *Def and introduce *DefWithMeta types (#26203) 2018-10-04 10:11:17 -07:00
lifecycle_spec.ts fix(ivy): create LViewData from blueprint (#25587) 2018-08-22 15:58:42 -04:00
listeners_spec.ts fix(ivy): events should not mark views dirty by default (#25969) 2018-09-17 13:02:39 -07:00
load_domino.ts test(ivy): Add small_app spec for sprint #3 (#22018) 2018-02-18 13:18:54 -08:00
ng_on_changes_feature_spec.ts fix(ivy): remove metadata from *Def and introduce *DefWithMeta types (#26203) 2018-10-04 10:11:17 -07:00
node_selector_matcher_spec.ts refactor(ivy): remove LNode (#26426) 2018-10-15 11:20:32 -07:00
outputs_spec.ts refactor(ivy): generate vars in component defs (#25562) 2018-08-20 11:08:10 -07:00
perfCounter_spec.ts perf(ivy): add performance counters in ngDevMode (#23385) 2018-05-01 10:27:40 -07:00
pipe_spec.ts fix(ivy): removing unnecessary assert in getOrCreateNodeInjector function (#26305) 2018-10-09 16:52:00 -07:00
properties_spec.ts refactor(ivy): merge directives into LViewData (#26316) 2018-10-09 16:46:00 -07:00
pure_function_spec.ts test(ivy): add testing utility to replace loadDirective (#26316) 2018-10-09 16:46:00 -07:00
query_list_spec.ts feat(ivy): implement ViewContainerRef.remove (#24221) 2018-06-05 13:33:40 -07:00
query_spec.ts refactor(ivy): remove LNode (#26426) 2018-10-15 11:20:32 -07:00
render_util.ts refactor(ivy): obviate the Bazel component of the ivy_switch (#26550) 2018-10-19 09:23:05 -07:00
renderer_factory_spec.ts feat(ivy): bridge component styles into the component renderer (#25255) 2018-08-23 16:51:15 -04:00
testing_spec.ts refactor(core): remove withBody from public testing API (#25171) 2018-07-31 15:09:32 -07:00
util_spec.ts fix(ivy): use devModeEqual in no change mode (#25252) 2018-08-02 22:57:28 -07:00
view_container_ref_spec.ts refactor(ivy): merge directives into LViewData (#26316) 2018-10-09 16:46:00 -07:00