| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2018-11-15 08:43:56 -08:00
										 |  |  | import {LifecycleHooksFeature, renderComponent, whenRendered} from './component'; | 
					
						
							| 
									
										
										
										
											2019-03-29 21:31:22 +01:00
										 |  |  | import {defineBase, defineComponent, defineDirective, defineNgModule, definePipe, setComponentScope, setNgModuleScope} from './definition'; | 
					
						
							| 
									
										
										
										
											2018-06-18 08:05:06 -07:00
										 |  |  | import {InheritDefinitionFeature} from './features/inherit_definition_feature'; | 
					
						
							| 
									
										
										
										
											2019-01-14 17:39:21 -08:00
										 |  |  | import {NgOnChangesFeature} from './features/ng_onchanges_feature'; | 
					
						
							| 
									
										
										
										
											2018-10-18 09:23:18 +02:00
										 |  |  | import {ProvidersFeature} from './features/providers_feature'; | 
					
						
							| 
									
										
										
										
											2018-09-21 12:12:06 -07:00
										 |  |  | import {BaseDef, ComponentDef, ComponentDefWithMeta, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFlags, DirectiveDefWithMeta, DirectiveType, PipeDef, PipeDefWithMeta} from './interfaces/definition'; | 
					
						
							| 
									
										
										
										
											2019-02-20 14:21:20 -08:00
										 |  |  | import {getComponent, getDirectives, getHostElement, getRenderedText} from './util/discovery_utils'; | 
					
						
							| 
									
										
										
										
											2018-06-18 08:05:06 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-21 21:14:06 -08:00
										 |  |  | export {ComponentFactory, ComponentFactoryResolver, ComponentRef, injectComponentFactoryResolver} from './component_ref'; | 
					
						
							| 
									
										
										
										
											2018-10-18 09:23:18 +02:00
										 |  |  | export {getFactoryOf, getInheritedFactory} from './di'; | 
					
						
							| 
									
										
										
										
											2018-04-10 20:57:09 -07:00
										 |  |  | export {RenderFlags} from './interfaces/definition'; | 
					
						
							| 
									
										
										
										
											2018-03-29 16:41:45 -07:00
										 |  |  | export {CssSelectorList} from './interfaces/projection'; | 
					
						
							| 
									
										
										
										
											2018-02-03 20:34:30 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-15 08:43:56 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | // clang-format off
 | 
					
						
							|  |  |  | export { | 
					
						
							| 
									
										
										
										
											2018-11-27 12:05:26 -08:00
										 |  |  |   allocHostVars, | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   bind, | 
					
						
							|  |  |  |   interpolation1, | 
					
						
							|  |  |  |   interpolation2, | 
					
						
							|  |  |  |   interpolation3, | 
					
						
							|  |  |  |   interpolation4, | 
					
						
							|  |  |  |   interpolation5, | 
					
						
							|  |  |  |   interpolation6, | 
					
						
							|  |  |  |   interpolation7, | 
					
						
							|  |  |  |   interpolation8, | 
					
						
							|  |  |  |   interpolationV, | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   container, | 
					
						
							|  |  |  |   containerRefreshStart, | 
					
						
							|  |  |  |   containerRefreshEnd, | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   nextContext, | 
					
						
							| 
									
										
										
										
											2018-07-25 17:25:22 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   element, | 
					
						
							|  |  |  |   elementAttribute, | 
					
						
							|  |  |  |   elementClassProp, | 
					
						
							|  |  |  |   elementEnd, | 
					
						
							|  |  |  |   elementProperty, | 
					
						
							| 
									
										
										
										
											2019-01-03 18:24:21 -08:00
										 |  |  |   componentHostSyntheticProperty, | 
					
						
							| 
									
										
										
										
											2019-01-17 11:09:13 -08:00
										 |  |  |   componentHostSyntheticListener, | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   elementStart, | 
					
						
							| 
									
										
										
										
											2018-06-19 12:45:00 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   elementContainerStart, | 
					
						
							|  |  |  |   elementContainerEnd, | 
					
						
							|  |  |  |   elementStyling, | 
					
						
							|  |  |  |   elementStylingMap, | 
					
						
							|  |  |  |   elementStyleProp, | 
					
						
							|  |  |  |   elementStylingApply, | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-15 13:45:08 -07:00
										 |  |  |   elementHostAttrs, | 
					
						
							|  |  |  |   elementHostStyling, | 
					
						
							|  |  |  |   elementHostStylingMap, | 
					
						
							|  |  |  |   elementHostStyleProp, | 
					
						
							|  |  |  |   elementHostClassProp, | 
					
						
							|  |  |  |   elementHostStylingApply, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-26 13:01:29 -07:00
										 |  |  |   select, | 
					
						
							| 
									
										
										
										
											2019-04-01 15:36:43 -07:00
										 |  |  |   property,  | 
					
						
							|  |  |  |    | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   listener, | 
					
						
							|  |  |  |   store, | 
					
						
							|  |  |  |   load, | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   namespaceHTML, | 
					
						
							|  |  |  |   namespaceMathML, | 
					
						
							|  |  |  |   namespaceSVG, | 
					
						
							| 
									
										
										
										
											2018-06-08 09:00:01 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   projection, | 
					
						
							|  |  |  |   projectionDef, | 
					
						
							| 
									
										
										
										
											2017-12-14 16:26:28 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   text, | 
					
						
							|  |  |  |   textBinding, | 
					
						
							| 
									
										
										
										
											2018-08-15 18:37:03 -07:00
										 |  |  |   template, | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   reference, | 
					
						
							| 
									
										
										
										
											2018-07-18 01:59:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   embeddedViewStart, | 
					
						
							|  |  |  |   embeddedViewEnd, | 
					
						
							| 
									
										
										
										
											2018-02-23 13:17:20 -08:00
										 |  |  |   detectChanges, | 
					
						
							|  |  |  |   markDirty, | 
					
						
							| 
									
										
										
										
											2018-03-13 12:31:21 -07:00
										 |  |  |   tick, | 
					
						
							| 
									
										
										
										
											2018-10-18 09:23:18 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |   directiveInject, | 
					
						
							|  |  |  |   injectAttribute, | 
					
						
							| 
									
										
										
										
											2018-12-13 15:51:47 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-21 21:14:06 -08:00
										 |  |  |   getCurrentView | 
					
						
							| 
									
										
										
										
											2019-03-14 14:15:10 -07:00
										 |  |  | } from './instructions/all'; | 
					
						
							| 
									
										
										
										
											2018-01-17 09:45:40 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-18 09:23:18 +02:00
										 |  |  | export { | 
					
						
							|  |  |  |   restoreView, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   enableBindings, | 
					
						
							|  |  |  |   disableBindings, | 
					
						
							|  |  |  | } from './state'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-18 16:55:43 +02:00
										 |  |  | export { | 
					
						
							| 
									
										
										
										
											2018-10-18 10:08:51 -07:00
										 |  |  |   i18n, | 
					
						
							| 
									
										
										
										
											2018-11-13 09:36:30 +01:00
										 |  |  |   i18nAttributes, | 
					
						
							| 
									
										
										
										
											2018-10-05 14:12:13 -07:00
										 |  |  |   i18nExp, | 
					
						
							|  |  |  |   i18nStart, | 
					
						
							|  |  |  |   i18nEnd, | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   i18nApply, | 
					
						
							| 
									
										
										
										
											2018-10-18 10:08:51 -07:00
										 |  |  |   i18nPostprocess | 
					
						
							| 
									
										
										
										
											2018-06-18 16:55:43 +02:00
										 |  |  | } from './i18n'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-13 14:32:46 -07:00
										 |  |  | export {NgModuleFactory, NgModuleRef, NgModuleType} from './ng_module_ref'; | 
					
						
							| 
									
										
										
										
											2018-05-09 16:49:39 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-04 15:58:42 +02:00
										 |  |  | export { | 
					
						
							| 
									
										
										
										
											2019-02-18 16:12:42 -08:00
										 |  |  |   AttributeMarker | 
					
						
							| 
									
										
										
										
											2018-05-04 15:58:42 +02:00
										 |  |  | } from './interfaces/node'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-30 10:16:52 -07:00
										 |  |  | export { | 
					
						
							|  |  |  |   setClassMetadata, | 
					
						
							|  |  |  | } from './metadata'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-27 13:07:03 -08:00
										 |  |  | export { | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   pipe, | 
					
						
							|  |  |  |   pipeBind1, | 
					
						
							|  |  |  |   pipeBind2, | 
					
						
							|  |  |  |   pipeBind3, | 
					
						
							|  |  |  |   pipeBind4, | 
					
						
							|  |  |  |   pipeBindV, | 
					
						
							| 
									
										
										
										
											2018-01-27 13:07:03 -08:00
										 |  |  | } from './pipe'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-17 09:45:40 -08:00
										 |  |  | export { | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   queryRefresh, | 
					
						
							| 
									
										
										
										
											2019-01-18 18:02:32 -08:00
										 |  |  |   viewQuery, | 
					
						
							| 
									
										
										
										
											2019-02-18 17:33:59 -08:00
										 |  |  |   staticViewQuery, | 
					
						
							| 
									
										
										
										
											2019-01-18 18:02:32 -08:00
										 |  |  |   loadViewQuery, | 
					
						
							| 
									
										
										
										
											2019-01-23 11:54:43 -08:00
										 |  |  |   contentQuery, | 
					
						
							|  |  |  |   loadContentQuery, | 
					
						
							| 
									
										
										
										
											2019-02-18 18:18:56 -08:00
										 |  |  |   staticContentQuery | 
					
						
							| 
									
										
										
										
											2018-01-17 09:45:40 -08:00
										 |  |  | } from './query'; | 
					
						
							| 
									
										
										
										
											2018-07-10 10:43:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-01 12:13:23 -08:00
										 |  |  | export { | 
					
						
							| 
									
										
										
										
											2018-08-14 16:48:58 -07:00
										 |  |  |   pureFunction0, | 
					
						
							|  |  |  |   pureFunction1, | 
					
						
							|  |  |  |   pureFunction2, | 
					
						
							|  |  |  |   pureFunction3, | 
					
						
							|  |  |  |   pureFunction4, | 
					
						
							|  |  |  |   pureFunction5, | 
					
						
							|  |  |  |   pureFunction6, | 
					
						
							|  |  |  |   pureFunction7, | 
					
						
							|  |  |  |   pureFunction8, | 
					
						
							|  |  |  |   pureFunctionV, | 
					
						
							| 
									
										
										
										
											2018-02-13 18:56:52 -08:00
										 |  |  | } from './pure_function'; | 
					
						
							| 
									
										
										
										
											2018-02-01 12:13:23 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-28 17:20:43 -07:00
										 |  |  | export {templateRefExtractor} from './view_engine_compatibility_prebound'; | 
					
						
							| 
									
										
										
										
											2018-09-21 18:38:13 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-20 14:21:20 -08:00
										 |  |  | export {resolveWindow, resolveDocument, resolveBody} from './util/misc_utils'; | 
					
						
							| 
									
										
										
										
											2018-01-22 17:43:52 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | // clang-format on
 | 
					
						
							| 
									
										
										
										
											2018-01-17 09:45:40 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | export { | 
					
						
							| 
									
										
										
										
											2018-08-07 12:04:39 -07:00
										 |  |  |   BaseDef, | 
					
						
							| 
									
										
										
										
											2018-06-26 10:37:45 -07:00
										 |  |  |   ComponentDef, | 
					
						
							| 
									
										
										
										
											2018-09-21 12:12:06 -07:00
										 |  |  |   ComponentDefWithMeta, | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  |   ComponentTemplate, | 
					
						
							|  |  |  |   ComponentType, | 
					
						
							| 
									
										
										
										
											2018-06-26 10:37:45 -07:00
										 |  |  |   DirectiveDef, | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  |   DirectiveDefFlags, | 
					
						
							| 
									
										
										
										
											2018-09-21 12:12:06 -07:00
										 |  |  |   DirectiveDefWithMeta, | 
					
						
							| 
									
										
										
										
											2017-12-19 16:51:42 +01:00
										 |  |  |   DirectiveType, | 
					
						
							| 
									
										
										
										
											2019-01-14 17:39:21 -08:00
										 |  |  |   NgOnChangesFeature, | 
					
						
							| 
									
										
										
										
											2018-06-18 08:05:06 -07:00
										 |  |  |   InheritDefinitionFeature, | 
					
						
							| 
									
										
										
										
											2018-10-18 09:23:18 +02:00
										 |  |  |   ProvidersFeature, | 
					
						
							| 
									
										
										
										
											2018-04-13 23:02:29 -07:00
										 |  |  |   PipeDef, | 
					
						
							| 
									
										
										
										
											2018-09-21 12:12:06 -07:00
										 |  |  |   PipeDefWithMeta, | 
					
						
							| 
									
										
										
										
											2018-03-06 11:58:08 -08:00
										 |  |  |   LifecycleHooksFeature, | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  |   defineComponent, | 
					
						
							|  |  |  |   defineDirective, | 
					
						
							| 
									
										
										
										
											2018-05-31 15:50:02 -07:00
										 |  |  |   defineNgModule, | 
					
						
							| 
									
										
										
										
											2018-07-23 17:01:22 -07:00
										 |  |  |   defineBase, | 
					
						
							| 
									
										
										
										
											2018-01-27 13:07:03 -08:00
										 |  |  |   definePipe, | 
					
						
							| 
									
										
										
										
											2018-02-03 20:34:30 -08:00
										 |  |  |   getHostElement, | 
					
						
							| 
									
										
										
										
											2018-12-03 16:34:25 +01:00
										 |  |  |   getComponent, | 
					
						
							| 
									
										
										
										
											2019-01-20 09:25:15 +01:00
										 |  |  |   getDirectives, | 
					
						
							| 
									
										
										
										
											2018-02-03 20:34:30 -08:00
										 |  |  |   getRenderedText, | 
					
						
							|  |  |  |   renderComponent, | 
					
						
							| 
									
										
											  
											
												feat(ivy): detect cycles and use remote scoping of components if needed (#28169)
By its nature, Ivy alters the import graph of a TS program, adding imports
where template dependencies exist. For example, if ComponentA uses PipeB
in its template, Ivy will insert an import of PipeB into the file in which
ComponentA is declared.
Any insertion of an import into a program has the potential to introduce a
cycle into the import graph. If for some reason the file in which PipeB is
declared imports the file in which ComponentA is declared (maybe it makes
use of a service or utility function that happens to be in the same file as
ComponentA) then this could create an import cycle. This turns out to
happen quite regularly in larger Angular codebases.
TypeScript and the Ivy runtime have no issues with such cycles. However,
other tools are not so accepting. In particular the Closure Compiler is
very anti-cycle.
To mitigate this problem, it's necessary to detect when the insertion of
an import would create a cycle. ngtsc can then use a different strategy,
known as "remote scoping", instead of directly writing a reference from
one component to another. Under remote scoping, a function
'setComponentScope' is called after the declaration of the component's
module, which does not require the addition of new imports.
FW-647 #resolve
PR Close #28169
											
										 
											2019-01-15 12:32:10 -08:00
										 |  |  |   setComponentScope, | 
					
						
							| 
									
										
										
										
											2019-03-29 21:31:22 +01:00
										 |  |  |   setNgModuleScope, | 
					
						
							| 
									
										
										
										
											2018-02-03 20:34:30 -08:00
										 |  |  |   whenRendered, | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2018-10-18 14:47:53 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | export {NO_CHANGE} from './tokens'; |