Skip to content

Commit 662143b

Browse files
0362665 refactor(core): move more host directive matching logic into feature (#60452)
1 parent 777ff6f commit 662143b

File tree

8 files changed

+33
-89
lines changed

8 files changed

+33
-89
lines changed

BUILD_INFO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Wed Mar 19 17:46:37 UTC 2025
2-
c7cacbf523c71c29c0ef3671df49ca785407b454
1+
Wed Mar 19 18:18:19 UTC 2025
2+
0362665c54d10c2d13565a2ffabd65bc3cb8890d

fesm2022/platform-browser-dynamic.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Angular v20.0.0-next.2+sha-c7cacbf
2+
* @license Angular v20.0.0-next.2+sha-0362665
33
* (c) 2010-2025 Google LLC. https://angular.io/
44
* License: MIT
55
*/
@@ -113,10 +113,10 @@ class ResourceLoaderImpl extends ResourceLoader {
113113
xhr.send();
114114
return promise;
115115
}
116-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-c7cacbf", ngImport: i0, type: ResourceLoaderImpl, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
117-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-c7cacbf", ngImport: i0, type: ResourceLoaderImpl });
116+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-0362665", ngImport: i0, type: ResourceLoaderImpl, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
117+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-0362665", ngImport: i0, type: ResourceLoaderImpl });
118118
}
119-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-c7cacbf", ngImport: i0, type: ResourceLoaderImpl, decorators: [{
119+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-0362665", ngImport: i0, type: ResourceLoaderImpl, decorators: [{
120120
type: Injectable
121121
}] });
122122

@@ -141,7 +141,7 @@ const INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = [
141141
/**
142142
* @publicApi
143143
*/
144-
const VERSION = new Version('20.0.0-next.2+sha-c7cacbf');
144+
const VERSION = new Version('20.0.0-next.2+sha-0362665');
145145

146146
/**
147147
* @publicApi

fesm2022/platform-browser-dynamic.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fesm2022/testing.mjs

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,14 @@
11
/**
2-
* @license Angular v20.0.0-next.2+sha-c7cacbf
2+
* @license Angular v20.0.0-next.2+sha-0362665
33
* (c) 2010-2025 Google LLC. https://angular.io/
44
* License: MIT
55
*/
66

77
import * as i0 from '@angular/core';
8-
import { Inject, Injectable, createPlatformFactory, NgModule } from '@angular/core';
9-
import { TestComponentRenderer } from '@angular/core/testing';
8+
import { createPlatformFactory, NgModule } from '@angular/core';
109
import { ɵplatformCoreDynamic as _platformCoreDynamic, ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS as _INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS } from '@angular/platform-browser-dynamic';
1110
import { BrowserTestingModule } from '@angular/platform-browser/testing';
12-
import { ɵgetDOM as _getDOM, DOCUMENT } from '@angular/common';
13-
14-
/**
15-
* A DOM based implementation of the TestComponentRenderer.
16-
*/
17-
class DOMTestComponentRenderer extends TestComponentRenderer {
18-
_doc;
19-
constructor(_doc) {
20-
super();
21-
this._doc = _doc;
22-
}
23-
insertRootElement(rootElId) {
24-
this.removeAllRootElementsImpl();
25-
const rootElement = _getDOM().getDefaultDocument().createElement('div');
26-
rootElement.setAttribute('id', rootElId);
27-
this._doc.body.appendChild(rootElement);
28-
}
29-
removeAllRootElements() {
30-
// Check whether the `DOCUMENT` instance retrieved from DI contains
31-
// the necessary function to complete the cleanup. In tests that don't
32-
// interact with DOM, the `DOCUMENT` might be mocked and some functions
33-
// might be missing. For such tests, DOM cleanup is not required and
34-
// we skip the logic if there are missing functions.
35-
if (typeof this._doc.querySelectorAll === 'function') {
36-
this.removeAllRootElementsImpl();
37-
}
38-
}
39-
removeAllRootElementsImpl() {
40-
const oldRoots = this._doc.querySelectorAll('[id^=root]');
41-
for (let i = 0; i < oldRoots.length; i++) {
42-
_getDOM().remove(oldRoots[i]);
43-
}
44-
}
45-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-c7cacbf", ngImport: i0, type: DOMTestComponentRenderer, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
46-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-c7cacbf", ngImport: i0, type: DOMTestComponentRenderer });
47-
}
48-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-c7cacbf", ngImport: i0, type: DOMTestComponentRenderer, decorators: [{
49-
type: Injectable
50-
}], ctorParameters: () => [{ type: undefined, decorators: [{
51-
type: Inject,
52-
args: [DOCUMENT]
53-
}] }] });
11+
export { ɵDOMTestComponentRenderer } from '@angular/platform-browser/testing';
5412

5513
/**
5614
* Platform for dynamic tests
@@ -69,17 +27,16 @@ const platformBrowserDynamicTesting = createPlatformFactory(platformCoreDynamicT
6927
* @publicApi
7028
*/
7129
class BrowserDynamicTestingModule {
72-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-c7cacbf", ngImport: i0, type: BrowserDynamicTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
73-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.2+sha-c7cacbf", ngImport: i0, type: BrowserDynamicTestingModule, exports: [BrowserTestingModule] });
74-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-c7cacbf", ngImport: i0, type: BrowserDynamicTestingModule, providers: [{ provide: TestComponentRenderer, useClass: DOMTestComponentRenderer }], imports: [BrowserTestingModule] });
30+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-0362665", ngImport: i0, type: BrowserDynamicTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
31+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.2+sha-0362665", ngImport: i0, type: BrowserDynamicTestingModule, exports: [BrowserTestingModule] });
32+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-0362665", ngImport: i0, type: BrowserDynamicTestingModule, imports: [BrowserTestingModule] });
7533
}
76-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-c7cacbf", ngImport: i0, type: BrowserDynamicTestingModule, decorators: [{
34+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.2+sha-0362665", ngImport: i0, type: BrowserDynamicTestingModule, decorators: [{
7735
type: NgModule,
7836
args: [{
7937
exports: [BrowserTestingModule],
80-
providers: [{ provide: TestComponentRenderer, useClass: DOMTestComponentRenderer }],
8138
}]
8239
}] });
8340

84-
export { BrowserDynamicTestingModule, platformBrowserDynamicTesting, DOMTestComponentRenderer as ɵDOMTestComponentRenderer, platformCoreDynamicTesting as ɵplatformCoreDynamicTesting };
41+
export { BrowserDynamicTestingModule, platformBrowserDynamicTesting, platformCoreDynamicTesting as ɵplatformCoreDynamicTesting };
8542
//# sourceMappingURL=testing.mjs.map

fesm2022/testing.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/**
2-
* @license Angular v20.0.0-next.2+sha-c7cacbf
2+
* @license Angular v20.0.0-next.2+sha-0362665
33
* (c) 2010-2025 Google LLC. https://angular.io/
44
* License: MIT
55
*/
66

7-
import * as i0 from '@angular/core';
7+
import * as _angular_core from '@angular/core';
88
import { StaticProvider, Version, CompilerFactory, CompilerOptions, Compiler } from '@angular/core';
99

1010
/**
1111
* A platform that included corePlatform and the compiler.
1212
*
1313
* @publicApi
1414
*/
15-
declare const platformCoreDynamic: (extraProviders?: i0.StaticProvider[]) => i0.PlatformRef;
15+
declare const platformCoreDynamic: (extraProviders?: _angular_core.StaticProvider[]) => _angular_core.PlatformRef;
1616

1717
/**
1818
* @publicApi
@@ -44,6 +44,6 @@ declare class JitCompilerFactory implements CompilerFactory {
4444
/**
4545
* @publicApi
4646
*/
47-
declare const platformBrowserDynamic: (extraProviders?: i0.StaticProvider[]) => i0.PlatformRef;
47+
declare const platformBrowserDynamic: (extraProviders?: _angular_core.StaticProvider[]) => _angular_core.PlatformRef;
4848

4949
export { JitCompilerFactory, VERSION, platformBrowserDynamic, INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, platformCoreDynamic as ɵplatformCoreDynamic };

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/platform-browser-dynamic",
3-
"version": "20.0.0-next.2+sha-c7cacbf",
3+
"version": "20.0.0-next.2+sha-0362665",
44
"description": "Angular - library for using Angular in a web browser with JIT compilation",
55
"author": "angular",
66
"license": "MIT",
@@ -11,10 +11,10 @@
1111
"tslib": "^2.3.0"
1212
},
1313
"peerDependencies": {
14-
"@angular/core": "20.0.0-next.2+sha-c7cacbf",
15-
"@angular/common": "20.0.0-next.2+sha-c7cacbf",
16-
"@angular/compiler": "20.0.0-next.2+sha-c7cacbf",
17-
"@angular/platform-browser": "20.0.0-next.2+sha-c7cacbf"
14+
"@angular/core": "20.0.0-next.2+sha-0362665",
15+
"@angular/common": "20.0.0-next.2+sha-0362665",
16+
"@angular/compiler": "20.0.0-next.2+sha-0362665",
17+
"@angular/platform-browser": "20.0.0-next.2+sha-0362665"
1818
},
1919
"repository": {
2020
"type": "git",

testing/index.d.ts

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
11
/**
2-
* @license Angular v20.0.0-next.2+sha-c7cacbf
2+
* @license Angular v20.0.0-next.2+sha-0362665
33
* (c) 2010-2025 Google LLC. https://angular.io/
44
* License: MIT
55
*/
66

7-
import * as i0 from '@angular/core';
7+
import * as _angular_core from '@angular/core';
88
import { PlatformRef, StaticProvider } from '@angular/core';
99
import * as i1 from '@angular/platform-browser/testing';
10-
import { TestComponentRenderer } from '@angular/core/testing';
11-
12-
/**
13-
* A DOM based implementation of the TestComponentRenderer.
14-
*/
15-
declare class DOMTestComponentRenderer extends TestComponentRenderer {
16-
private _doc;
17-
constructor(_doc: any);
18-
insertRootElement(rootElId: string): void;
19-
removeAllRootElements(): void;
20-
private removeAllRootElementsImpl;
21-
static ɵfac: i0.ɵɵFactoryDeclaration<DOMTestComponentRenderer, never>;
22-
static ɵprov: i0.ɵɵInjectableDeclaration<DOMTestComponentRenderer>;
23-
}
10+
export { ɵDOMTestComponentRenderer } from '@angular/platform-browser/testing';
2411

2512
/**
2613
* Platform for dynamic tests
@@ -39,9 +26,9 @@ declare const platformBrowserDynamicTesting: (extraProviders?: StaticProvider[])
3926
* @publicApi
4027
*/
4128
declare class BrowserDynamicTestingModule {
42-
static ɵfac: i0.ɵɵFactoryDeclaration<BrowserDynamicTestingModule, never>;
43-
static ɵmod: i0.ɵɵNgModuleDeclaration<BrowserDynamicTestingModule, never, never, [typeof i1.BrowserTestingModule]>;
44-
static ɵinj: i0.ɵɵInjectorDeclaration<BrowserDynamicTestingModule>;
29+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrowserDynamicTestingModule, never>;
30+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<BrowserDynamicTestingModule, never, never, [typeof i1.BrowserTestingModule]>;
31+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<BrowserDynamicTestingModule>;
4532
}
4633

47-
export { BrowserDynamicTestingModule, platformBrowserDynamicTesting, DOMTestComponentRenderer as ɵDOMTestComponentRenderer, platformCoreDynamicTesting as ɵplatformCoreDynamicTesting };
34+
export { BrowserDynamicTestingModule, platformBrowserDynamicTesting, platformCoreDynamicTesting as ɵplatformCoreDynamicTesting };

0 commit comments

Comments
 (0)