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
@ -99,6 +99,10 @@ export function clearResolutionOfComponentResourcesQueue() {
|
||||
componentResourceResolutionQueue.clear();
|
||||
}
|
||||
|
||||
export function isComponentResourceResolutionQueueEmpty() {
|
||||
return componentResourceResolutionQueue.size === 0;
|
||||
}
|
||||
|
||||
function unwrapResponse(response: string | {text(): Promise<string>}): string|Promise<string> {
|
||||
return typeof response == 'string' ? response : response.text();
|
||||
}
|
||||
|
Reference in New Issue
Block a user