Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: WIP: split render3 target from //packages/core #27499

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/BUILD.bazel
Expand Up @@ -12,6 +12,7 @@ ng_module(
),
module_name = "@angular/core",
deps = [
"//packages/core/src/render3",
"//packages:types",
"@ngdeps//zone.js",
"@rxjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/change_detection/change_detector_ref.ts
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {injectChangeDetectorRef as render3InjectChangeDetectorRef} from '../render3/view_engine_compatibility';
import {injectChangeDetectorRef as render3InjectChangeDetectorRef} from '@angular/core/src/render3/view_engine_compatibility';

/**
* Base class for Angular Views, provides change detection functionality.
Expand Down
20 changes: 10 additions & 10 deletions packages/core/src/core_render3_private_export.ts
Expand Up @@ -116,21 +116,21 @@ export {
i18nApply as ɵi18nApply,
i18nPostprocess as ɵi18nPostprocess,
setClassMetadata as ɵsetClassMetadata,
} from './render3/index';
} from '@angular/core/src/render3/index';


export {
compileComponent as ɵcompileComponent,
compileDirective as ɵcompileDirective,
} from './render3/jit/directive';
} from '@angular/core/src/render3/jit/directive';
export {
compileNgModule as ɵcompileNgModule,
compileNgModuleDefs as ɵcompileNgModuleDefs,
patchComponentDefWithScope as ɵpatchComponentDefWithScope,
} from './render3/jit/module';
} from '@angular/core/src/render3/jit/module';
export {
compilePipe as ɵcompilePipe,
} from './render3/jit/pipe';
} from '@angular/core/src/render3/jit/pipe';

export {
NgModuleDef as ɵNgModuleDef,
Expand All @@ -155,27 +155,27 @@ export {

export {
getLContext as ɵgetLContext
} from './render3/context_discovery';
} from '@angular/core/src/render3/context_discovery';

export {
Player as ɵPlayer,
PlayerFactory as ɵPlayerFactory,
PlayState as ɵPlayState,
PlayerHandler as ɵPlayerHandler,
} from './render3/interfaces/player';
} from '@angular/core/src/render3/interfaces/player';

export {
LContext as ɵLContext,
} from './render3/interfaces/context';
} from '@angular/core/src/render3/interfaces/context';

export {
bindPlayerFactory as ɵbindPlayerFactory,
} from './render3/styling/player_factory';
} from '@angular/core/src/render3/styling/player_factory';

export {
addPlayer as ɵaddPlayer,
getPlayers as ɵgetPlayers,
} from './render3/players';
} from '@angular/core/src/render3/players';

// we reexport these symbols just so that they are retained during the dead code elimination
// performed by rollup while it's creating fesm files.
Expand Down Expand Up @@ -217,7 +217,7 @@ export {
export {
publishGlobalUtil as ɵpublishGlobalUtil,
publishDefaultGlobalUtils as ɵpublishDefaultGlobalUtils
} from './render3/global_utils';
} from '@angular/core/src/render3/global_utils';
export {
SWITCH_INJECTOR_FACTORY__POST_R3__ as ɵSWITCH_INJECTOR_FACTORY__POST_R3__,
} from './di/injector';
Expand Down
14 changes: 7 additions & 7 deletions packages/core/src/debug/debug_node.ts
Expand Up @@ -7,13 +7,13 @@
*/

import {Injector} from '../di';
import {assertDomNode} from '../render3/assert';
import {getComponent, getContext, getInjectionTokens, getInjector, getListeners, getLocalRefs, isBrowserEvents, loadLContext, loadLContextFromNode} from '../render3/discovery_utils';
import {TNode} from '../render3/interfaces/node';
import {StylingIndex} from '../render3/interfaces/styling';
import {TVIEW} from '../render3/interfaces/view';
import {getProp, getValue, isClassBased} from '../render3/styling/class_and_style_bindings';
import {getStylingContext} from '../render3/styling/util';
import {assertDomNode} from '@angular/core/src/render3/assert';
import {getComponent, getContext, getInjectionTokens, getInjector, getListeners, getLocalRefs, isBrowserEvents, loadLContext, loadLContextFromNode} from '@angular/core/src/render3/discovery_utils';
import {TNode} from '@angular/core/src/render3/interfaces/node';
import {StylingIndex} from '@angular/core/src/render3/interfaces/styling';
import {TVIEW} from '@angular/core/src/render3/interfaces/view';
import {getProp, getValue, isClassBased} from '@angular/core/src/render3/styling/class_and_style_bindings';
import {getStylingContext} from '@angular/core/src/render3/styling/util';
import {DebugContext} from '../view/index';

export class EventListener {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/di/defs.ts
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {NG_INJECTABLE_DEF, NG_INJECTOR_DEF} from '../render3/fields';
import {NG_INJECTABLE_DEF, NG_INJECTOR_DEF} from '@angular/core/src/render3/fields';
import {Type} from '../type';

import {ClassProvider, ClassSansProvider, ConstructorProvider, ConstructorSansProvider, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, StaticClassProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from './provider';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/di/injectable.ts
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {compileInjectable as render3CompileInjectable} from '../render3/jit/injectable';
import {compileInjectable as render3CompileInjectable} from '@angular/core/src/render3/jit/injectable';
import {Type} from '../type';
import {TypeDecorator, makeDecorator} from '../util/decorators';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/di/injector.ts
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {injectInjector} from '../render3/di';
import {injectInjector} from '@angular/core/src/render3/di';
import {Type} from '../type';
import {stringify} from '../util';
import {noop} from '../util/noop';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/linker/compiler.ts
Expand Up @@ -11,7 +11,7 @@ import {InjectionToken} from '../di/injection_token';
import {StaticProvider} from '../di/provider';
import {MissingTranslationStrategy} from '../i18n/tokens';
import {ViewEncapsulation} from '../metadata';
import {NgModuleFactory as NgModuleFactoryR3} from '../render3/ng_module_ref';
import {NgModuleFactory as NgModuleFactoryR3} from '@angular/core/src/render3/ng_module_ref';
import {Type} from '../type';

import {ComponentFactory} from './component_factory';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/linker/element_ref.ts
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {injectElementRef as render3InjectElementRef} from '../render3/view_engine_compatibility';
import {injectElementRef as render3InjectElementRef} from '@angular/core/src/render3/view_engine_compatibility';
import {noop} from '../util/noop';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/linker/template_ref.ts
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {injectTemplateRef as render3InjectTemplateRef} from '../render3/view_engine_compatibility';
import {injectTemplateRef as render3InjectTemplateRef} from '@angular/core/src/render3/view_engine_compatibility';
import {noop} from '../util/noop';

import {ElementRef} from './element_ref';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/linker/view_container_ref.ts
Expand Up @@ -7,7 +7,7 @@
*/

import {Injector} from '../di/injector';
import {injectViewContainerRef as render3InjectViewContainerRef} from '../render3/view_engine_compatibility';
import {injectViewContainerRef as render3InjectViewContainerRef} from '@angular/core/src/render3/view_engine_compatibility';
import {noop} from '../util/noop';

import {ComponentFactory, ComponentRef} from './component_factory';
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/metadata/directives.ts
Expand Up @@ -8,9 +8,9 @@

import {ChangeDetectionStrategy} from '../change_detection/constants';
import {Provider} from '../di';
import {NG_BASE_DEF} from '../render3/fields';
import {compileComponent as render3CompileComponent, compileDirective as render3CompileDirective} from '../render3/jit/directive';
import {compilePipe as render3CompilePipe} from '../render3/jit/pipe';
import {NG_BASE_DEF} from '@angular/core/src/render3/fields';
import {compileComponent as render3CompileComponent, compileDirective as render3CompileDirective} from '@angular/core/src/render3/jit/directive';
import {compilePipe as render3CompilePipe} from '@angular/core/src/render3/jit/pipe';
import {Type} from '../type';
import {TypeDecorator, makeDecorator, makePropDecorator} from '../util/decorators';
import {noop} from '../util/noop';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/metadata/ng_module.ts
Expand Up @@ -10,7 +10,7 @@ import {ApplicationRef} from '../application_ref';
import {InjectorType, defineInjector} from '../di/defs';
import {Provider} from '../di/provider';
import {convertInjectableProviderToFactory} from '../di/util';
import {compileNgModule as render3CompileNgModule} from '../render3/jit/module';
import {compileNgModule as render3CompileNgModule} from '@angular/core/src/render3/jit/module';
import {Type} from '../type';
import {TypeDecorator, makeDecorator} from '../util/decorators';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/render/api.ts
Expand Up @@ -9,7 +9,7 @@
import {InjectionToken} from '../di/injection_token';
import {Injector} from '../di/injector';
import {ViewEncapsulation} from '../metadata/view';
import {injectRenderer2 as render3InjectRenderer2} from '../render3/view_engine_compatibility';
import {injectRenderer2 as render3InjectRenderer2} from '@angular/core/src/render3/view_engine_compatibility';
import {noop} from '../util/noop';


Expand Down
18 changes: 18 additions & 0 deletions packages/core/src/render3/BUILD.bazel
@@ -0,0 +1,18 @@
load("//tools:defaults.bzl", "ng_module", "ts_library")

ts_library(
name = "render3",
srcs = glob(
[
"**/*.ts",
],
),
module_name = "@angular/core/src/render3",
deps = [
#"//packages:types",
#"@ngdeps//zone.js",
#"@rxjs",
#"@rxjs//operators",
],
visibility = ["//packages/core:__subpackages__"],
)
6 changes: 3 additions & 3 deletions packages/core/src/sanitization/sanitization.ts
Expand Up @@ -6,9 +6,9 @@
* found in the LICENSE file at https://angular.io/license
*/

import {SANITIZER} from '../render3/interfaces/view';
import {getLView} from '../render3/state';
import {stringify} from '../render3/util';
import {SANITIZER} from '@angular/core/src/render3/interfaces/view';
import {getLView} from '@angular/core/src/render3/state';
import {stringify} from '@angular/core/src/render3/util';

import {BypassType, allowSanitizationBypass} from './bypass';
import {_sanitizeHtml as _sanitizeHtml} from './html_sanitizer';
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/metadata/resource_loading_spec.ts
Expand Up @@ -8,8 +8,8 @@

import {Component} from '../../src/core';
import {clearResolutionOfComponentResourcesQueue, resolveComponentResources} from '../../src/metadata/resource_loading';
import {ComponentType} from '../../src/render3/interfaces/definition';
import {compileComponent} from '../../src/render3/jit/directive';
import {ComponentType} from '@angular/core/src/render3/interfaces/definition';
import {compileComponent} from '@angular/core/src/render3/jit/directive';

describe('resource_loading', () => {
describe('error handling', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/render3/integration_spec.ts
Expand Up @@ -21,8 +21,8 @@ import {Sanitizer, SecurityContext} from '../../src/sanitization/security';

import {NgIf} from './common_with_def';
import {ComponentFixture, TemplateFixture, createComponent, renderToHtml} from './render_util';
import {getLContext} from '../../src/render3/context_discovery';
import {StylingIndex} from '../../src/render3/interfaces/styling';
import {getLContext} from '@angular/core/src/render3/context_discovery';
import {StylingIndex} from '@angular/core/src/render3/interfaces/styling';
import {MONKEY_PATCH_KEY_NAME} from '../../src/render3/interfaces/context';

describe('render3 integration test', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/render3/jit/directive_spec.ts
Expand Up @@ -7,7 +7,7 @@
*/

import {WrappedNodeExpr} from '@angular/compiler';
import {convertToR3QueryMetadata, extendsDirectlyFromObject} from '../../../src/render3/jit/directive';
import {convertToR3QueryMetadata, extendsDirectlyFromObject} from '@angular/core/src/render3/jit/directive';

describe('jit directive helper functions', () => {

Expand Down
20 changes: 10 additions & 10 deletions packages/core/test/render3/render_util.ts
Expand Up @@ -20,16 +20,16 @@ import {SWITCH_ELEMENT_REF_FACTORY__POST_R3__ as R3_ELEMENT_REF_FACTORY} from '.
import {SWITCH_TEMPLATE_REF_FACTORY__POST_R3__ as R3_TEMPLATE_REF_FACTORY} from '../../src/linker/template_ref';
import {SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__ as R3_VIEW_CONTAINER_REF_FACTORY} from '../../src/linker/view_container_ref';
import {SWITCH_RENDERER2_FACTORY__POST_R3__ as R3_RENDERER2_FACTORY} from '../../src/render/api';
import {CreateComponentOptions} from '../../src/render3/component';
import {getDirectivesAtNodeIndex, getLContext, isComponentInstance} from '../../src/render3/context_discovery';
import {extractDirectiveDef, extractPipeDef} from '../../src/render3/definition';
import {NG_ELEMENT_ID} from '../../src/render3/fields';
import {ComponentTemplate, ComponentType, DirectiveDef, DirectiveType, RenderFlags, defineComponent, defineDirective, renderComponent as _renderComponent, tick} from '../../src/render3/index';
import {renderTemplate} from '../../src/render3/instructions';
import {DirectiveDefList, DirectiveTypesOrFactory, PipeDef, PipeDefList, PipeTypesOrFactory} from '../../src/render3/interfaces/definition';
import {PlayerHandler} from '../../src/render3/interfaces/player';
import {RElement, RText, Renderer3, RendererFactory3, domRendererFactory3} from '../../src/render3/interfaces/renderer';
import {HEADER_OFFSET, LView} from '../../src/render3/interfaces/view';
import {CreateComponentOptions} from '@angular/core/src/render3/component';
import {getDirectivesAtNodeIndex, getLContext, isComponentInstance} from '@angular/core/src/render3/context_discovery';
import {extractDirectiveDef, extractPipeDef} from '@angular/core/src/render3/definition';
import {NG_ELEMENT_ID} from '@angular/core/src/render3/fields';
import {ComponentTemplate, ComponentType, DirectiveDef, DirectiveType, RenderFlags, defineComponent, defineDirective, renderComponent as _renderComponent, tick} from '@angular/core/src/render3/index';
import {renderTemplate} from '@angular/core/src/render3/instructions';
import {DirectiveDefList, DirectiveTypesOrFactory, PipeDef, PipeDefList, PipeTypesOrFactory} from '@angular/core/src/render3/interfaces/definition';
import {PlayerHandler} from '@angular/core/src/render3/interfaces/player';
import {RElement, RText, Renderer3, RendererFactory3, domRendererFactory3} from '@angular/core/src/render3/interfaces/renderer';
import {HEADER_OFFSET, LView} from '@angular/core/src/render3/interfaces/view';
import {Sanitizer} from '../../src/sanitization/security';
import {Type} from '../../src/type';

Expand Down
28 changes: 14 additions & 14 deletions packages/core/test/render3/styling/class_and_style_bindings_spec.ts
Expand Up @@ -5,20 +5,20 @@
* 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
*/
import {createRootContext} from '../../../src/render3/component';
import {getLContext} from '../../../src/render3/context_discovery';
import {defineComponent} from '../../../src/render3/index';
import {createLView, createTView, elementClassProp, elementEnd, elementStart, elementStyleProp, elementStyling, elementStylingApply, elementStylingMap} from '../../../src/render3/instructions';
import {InitialStylingFlags, RenderFlags} from '../../../src/render3/interfaces/definition';
import {BindingStore, BindingType, PlayState, Player, PlayerFactory, PlayerHandler} from '../../../src/render3/interfaces/player';
import {RElement, Renderer3, domRendererFactory3} from '../../../src/render3/interfaces/renderer';
import {StylingContext, StylingFlags, StylingIndex} from '../../../src/render3/interfaces/styling';
import {CONTEXT, LView, LViewFlags, RootContext} from '../../../src/render3/interfaces/view';
import {addPlayer, getPlayers} from '../../../src/render3/players';
import {ClassAndStylePlayerBuilder, createStylingContextTemplate, isContextDirty, renderStyleAndClassBindings as _renderStyling, setContextDirty, updateClassProp, updateStyleProp, updateStylingMap} from '../../../src/render3/styling/class_and_style_bindings';
import {CorePlayerHandler} from '../../../src/render3/styling/core_player_handler';
import {BoundPlayerFactory, bindPlayerFactory} from '../../../src/render3/styling/player_factory';
import {allocStylingContext} from '../../../src/render3/styling/util';
import {createRootContext} from '@angular/core/src/render3/component';
import {getLContext} from '@angular/core/src/render3/context_discovery';
import {defineComponent} from '@angular/core/src/render3/index';
import {createLView, createTView, elementClassProp, elementEnd, elementStart, elementStyleProp, elementStyling, elementStylingApply, elementStylingMap} from '@angular/core/src/render3/instructions';
import {InitialStylingFlags, RenderFlags} from '@angular/core/src/render3/interfaces/definition';
import {BindingStore, BindingType, PlayState, Player, PlayerFactory, PlayerHandler} from '@angular/core/src/render3/interfaces/player';
import {RElement, Renderer3, domRendererFactory3} from '@angular/core/src/render3/interfaces/renderer';
import {StylingContext, StylingFlags, StylingIndex} from '@angular/core/src/render3/interfaces/styling';
import {CONTEXT, LView, LViewFlags, RootContext} from '@angular/core/src/render3/interfaces/view';
import {addPlayer, getPlayers} from '@angular/core/src/render3/players';
import {ClassAndStylePlayerBuilder, createStylingContextTemplate, isContextDirty, renderStyleAndClassBindings as _renderStyling, setContextDirty, updateClassProp, updateStyleProp, updateStylingMap} from '@angular/core/src/render3/styling/class_and_style_bindings';
import {CorePlayerHandler} from '@angular/core/src/render3/styling/core_player_handler';
import {BoundPlayerFactory, bindPlayerFactory} from '@angular/core/src/render3/styling/player_factory';
import {allocStylingContext} from '@angular/core/src/render3/styling/util';
import {defaultStyleSanitizer} from '../../../src/sanitization/sanitization';
import {StyleSanitizeFn} from '../../../src/sanitization/style_sanitizer';
import {ComponentFixture, renderToHtml} from '../render_util';
Expand Down