fix(ivy): platform module bootstrap does not resolve resources (#29083)
Currently with ViewEngine, if someone runs the platform's `bootstrapModule` method in order to boostrap a module in JIT mode, external component resources are properly resolved *automatically*. Currently with Ivy, the developer would need to manually call `resolveComponentResources` in order to asynchronously fetch the determined external component resources. In order to make this backwards compatible with ViewEngine, and also since platforms can already specify a `ResourceLoader` compiler provider, we need to automatically resolve all external component resources on module bootstrap. -- Since the `ResourceLoader` is part of the `@angular/compiler`, because ViewEngine performed the factory creation in the compiler, we can't access the `ResourceLoader` token from within core. In order to workaround this without introducing a breaking change, we just proxy the `ResourceLoader` token to `core` through the compiler facade. In the future, we should be able to move the `ResourceLoader` to core when ViewEngine code no longer exists in the `@angular/compiler`. PR Close #29083
This commit is contained in:

committed by
Kara Erickson

parent
7315a68ac6
commit
6085f335e8
@ -23,10 +23,12 @@ import {R3Reference} from './render3/util';
|
||||
import {R3DirectiveMetadata, R3QueryMetadata} from './render3/view/api';
|
||||
import {ParsedHostBindings, compileComponentFromMetadata, compileDirectiveFromMetadata, parseHostBindings, verifyHostBindings} from './render3/view/compiler';
|
||||
import {makeBindingParser, parseTemplate} from './render3/view/template';
|
||||
import {ResourceLoader} from './resource_loader';
|
||||
import {DomElementSchemaRegistry} from './schema/dom_element_schema_registry';
|
||||
|
||||
export class CompilerFacadeImpl implements CompilerFacade {
|
||||
R3ResolvedDependencyType = R3ResolvedDependencyType as any;
|
||||
ResourceLoader = ResourceLoader;
|
||||
private elementSchemaRegistry = new DomElementSchemaRegistry();
|
||||
|
||||
constructor(private jitEvaluator = new JitEvaluator()) {}
|
||||
|
Reference in New Issue
Block a user