fix(core): adhere to bootstrap options for JIT compiled components (#35534)
When using `platformBrowserDynamic().bootstrapModule()`, it is possible to set `defaultEncapsulation` and `preserveWhitespaces` as default configuration to influence how components are compiled. When compiling components in JIT with Ivy, these options were not taken into account. This commit publishes the options to be globally available, so that the lazy compilation of JIT components has access to the configured bootstrap options. Note that this approach does not allow changing the options once they have been set, as Ivy's compilation model does not allow for multiple compilations to exist at the same time. For applications that bootstrap multiple modules, it is now required to provide the exact same bootstrap options. An error is logged if incompatible bootstrap options are provided, in which case the updated options will be ignored. Fixes #35230 Resolved FW-1838 PR Close #35534
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
* 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 {ɵresetJitOptions as resetJitOptions} from '@angular/core';
|
||||
|
||||
/**
|
||||
* Wraps a function in a new function which sets up document and HTML for running a test.
|
||||
@ -120,3 +121,5 @@ export function cleanupDocument(): void {
|
||||
|
||||
if (typeof beforeEach == 'function') beforeEach(ensureDocument);
|
||||
if (typeof afterEach == 'function') afterEach(cleanupDocument);
|
||||
|
||||
if (typeof afterEach === 'function') afterEach(resetJitOptions);
|
||||
|
Reference in New Issue
Block a user