Skip to content

Commit

Permalink
refactor(core): add an empty implementation for getComponentDepsFacto…
Browse files Browse the repository at this point in the history
…ry runtime

An empty runtime is added just to make the local compiled angular files valid to run. A separate PR will implement the runtime in the right way using the deps tracker.
  • Loading branch information
pmvald committed Jul 26, 2023
1 parent 5754796 commit 005121b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/core/src/core_render3_private_export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export {

ɵɵsetComponentScope,
ɵɵsetNgModuleScope,
ɵɵgetComponentDepsFactory,
ɵɵStandaloneFeature,
ɵɵstyleMap,
ɵɵstyleMapInterpolate1,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/render3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export {
export {NO_CHANGE} from './tokens';
export { ɵɵresolveBody, ɵɵresolveDocument,ɵɵresolveWindow} from './util/misc_utils';
export { ɵɵtemplateRefExtractor} from './view_engine_compatibility_prebound';
export {ɵɵgetComponentDepsFactory} from './local_compilation';
// clang-format on

export {
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/render3/interfaces/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {ProcessProvidersFunction} from '../../di/interface/provider';
import {ModuleWithProviders, ProcessProvidersFunction} from '../../di/interface/provider';
import {EnvironmentInjector} from '../../di/r3_injector';
import {Type} from '../../interface/type';
import {SchemaMetadata} from '../../metadata/schema';
Expand Down Expand Up @@ -532,3 +532,6 @@ export interface NgModuleScopeInfoFromDecorator {
*/
exports?: Type<any>[]|(() => Type<any>[]);
}

export type RawScopeInfoFromDecorator =
Type<any>|ModuleWithProviders<any>|(() => Type<any>)|(() => ModuleWithProviders<any>);
1 change: 1 addition & 0 deletions packages/core/src/render3/jit/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export const angularCoreEnv: {[name: string]: Function} =
'ɵɵsetComponentScope': r3.ɵɵsetComponentScope,
'ɵɵsetNgModuleScope': r3.ɵɵsetNgModuleScope,
'ɵɵregisterNgModuleType': registerNgModuleType,
'ɵɵgetComponentDepsFactory': r3.ɵɵgetComponentDepsFactory,

'ɵɵsanitizeHtml': sanitization.ɵɵsanitizeHtml,
'ɵɵsanitizeStyle': sanitization.ɵɵsanitizeStyle,
Expand Down
17 changes: 17 additions & 0 deletions packages/core/src/render3/local_compilation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @license
* Copyright Google LLC 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
*/

import {Type} from '../interface/type';

import {DependencyTypeList, RawScopeInfoFromDecorator} from './interfaces/definition';

export function ɵɵgetComponentDepsFactory(
type: Type<any>, rawImports?: RawScopeInfoFromDecorator): () => DependencyTypeList {
// TODO(pmvald): Implement this runtime using deps tracker.
return () => [];
}

0 comments on commit 005121b

Please sign in to comment.