Skip to content

Commit 86fc4d3

Browse files
alan-agius4thePunderWoman
authored andcommitted
refactor(platform-browser): remove internal TRANSITION_ID token (#48253)
This was a mirror copy of the `APP_ID` token. PR Close #48253
1 parent 9165ff2 commit 86fc4d3

File tree

10 files changed

+12
-57
lines changed

10 files changed

+12
-57
lines changed

packages/core/src/render3/definition.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,11 @@ export function ɵɵdefineComponent<T>(componentDefinition: ComponentDefinition<
309309
_: null,
310310
schemas: componentDefinition.schemas || null,
311311
tView: null,
312-
id: getComponentId(def),
312+
id: '',
313313
};
314314

315+
def.id = getComponentId(def);
316+
315317
initFeatures(def);
316318
const dependencies = componentDefinition.dependencies;
317319
def.directiveDefs = extractDefListOrFactory(dependencies, /* pipeDef */ false);

packages/core/test/bundling/cyclic_import/bundle.golden_symbols.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,6 @@
350350
{
351351
"name": "RuntimeError"
352352
},
353-
{
354-
"name": "SERVER_TRANSITION_PROVIDERS"
355-
},
356353
{
357354
"name": "SIMPLE_CHANGES_STORE"
358355
},
@@ -410,9 +407,6 @@
410407
{
411408
"name": "TRACKED_LVIEWS"
412409
},
413-
{
414-
"name": "TRANSITION_ID"
415-
},
416410
{
417411
"name": "TYPE"
418412
},

packages/core/test/bundling/forms_reactive/bundle.golden_symbols.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,6 @@
491491
{
492492
"name": "RuntimeError"
493493
},
494-
{
495-
"name": "SERVER_TRANSITION_PROVIDERS"
496-
},
497494
{
498495
"name": "SIMPLE_CHANGES_STORE"
499496
},
@@ -557,9 +554,6 @@
557554
{
558555
"name": "TRACKED_LVIEWS"
559556
},
560-
{
561-
"name": "TRANSITION_ID"
562-
},
563557
{
564558
"name": "TYPE"
565559
},

packages/core/test/bundling/forms_template_driven/bundle.golden_symbols.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,6 @@
479479
{
480480
"name": "RuntimeError"
481481
},
482-
{
483-
"name": "SERVER_TRANSITION_PROVIDERS"
484-
},
485482
{
486483
"name": "SIMPLE_CHANGES_STORE"
487484
},
@@ -545,9 +542,6 @@
545542
{
546543
"name": "TRACKED_LVIEWS"
547544
},
548-
{
549-
"name": "TRANSITION_ID"
550-
},
551545
{
552546
"name": "TYPE"
553547
},

packages/core/test/bundling/todo/bundle.golden_symbols.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,6 @@
377377
{
378378
"name": "RuntimeError"
379379
},
380-
{
381-
"name": "SERVER_TRANSITION_PROVIDERS"
382-
},
383380
{
384381
"name": "SIMPLE_CHANGES_STORE"
385382
},
@@ -443,16 +440,10 @@
443440
{
444441
"name": "TRACKED_LVIEWS"
445442
},
446-
{
447-
<<<<<<< HEAD
448-
"name": "TRANSITION_ID"
449-
},
450443
{
451444
"name": "TYPE"
452445
},
453446
{
454-
=======
455-
>>>>>>> 0bd0ef957b (fix(core): generate consistent component IDs)
456447
"name": "TemplateRef"
457448
},
458449
{
@@ -1457,4 +1448,4 @@
14571448
{
14581449
"name": "ɵɵtextInterpolate1"
14591450
}
1460-
]
1451+
]

packages/platform-browser/src/browser.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {CommonModule, DOCUMENT, XhrFactory, ɵPLATFORM_BROWSER_ID as PLATFORM_BR
1010
import {APP_ID, ApplicationConfig as ApplicationConfigFromCore, ApplicationModule, ApplicationRef, createPlatformFactory, ErrorHandler, Inject, InjectionToken, ModuleWithProviders, NgModule, NgZone, Optional, PLATFORM_ID, PLATFORM_INITIALIZER, platformCore, PlatformRef, Provider, RendererFactory2, SkipSelf, StaticProvider, Testability, TestabilityRegistry, Type, ɵINJECTOR_SCOPE as INJECTOR_SCOPE, ɵinternalCreateApplication as internalCreateApplication, ɵsetDocument, ɵTESTABILITY as TESTABILITY, ɵTESTABILITY_GETTER as TESTABILITY_GETTER} from '@angular/core';
1111

1212
import {BrowserDomAdapter} from './browser/browser_adapter';
13-
import {TRANSITION_ID} from './browser/server-transition';
1413
import {BrowserGetTestability} from './browser/testability';
1514
import {BrowserXhr} from './browser/xhr';
1615
import {DomRendererFactory2, REMOVE_STYLES_ON_COMPONENT_DESTROY} from './dom/dom_renderer';
@@ -252,7 +251,6 @@ export class BrowserModule {
252251
ngModule: BrowserModule,
253252
providers: [
254253
{provide: APP_ID, useValue: params.appId},
255-
{provide: TRANSITION_ID, useExisting: APP_ID},
256254
],
257255
};
258256
}

packages/platform-browser/src/browser/server-transition.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/platform-browser/src/private_export.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
export {ɵgetDOM} from '@angular/common';
1010
export {initDomAdapter as ɵinitDomAdapter, INTERNAL_BROWSER_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS} from './browser';
1111
export {BrowserDomAdapter as ɵBrowserDomAdapter} from './browser/browser_adapter';
12-
export {TRANSITION_ID as ɵTRANSITION_ID} from './browser/server-transition';
1312
export {BrowserGetTestability as ɵBrowserGetTestability} from './browser/testability';
1413
export {DomRendererFactory2 as ɵDomRendererFactory2, NAMESPACE_URIS as ɵNAMESPACE_URIS, shimContentAttribute as ɵshimContentAttribute, shimHostAttribute as ɵshimHostAttribute, shimStylesContent as ɵshimStyles} from './dom/dom_renderer';
1514
export {DomEventsPlugin as ɵDomEventsPlugin} from './dom/events/dom_events';

packages/platform-server/src/styles_host.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@
77
*/
88

99
import {DOCUMENT, ɵgetDOM as getDOM} from '@angular/common';
10-
import {Inject, Injectable, Optional} from '@angular/core';
11-
import {ɵSharedStylesHost as SharedStylesHost, ɵTRANSITION_ID} from '@angular/platform-browser';
10+
import {APP_ID, Inject, Injectable} from '@angular/core';
11+
import {ɵSharedStylesHost as SharedStylesHost} from '@angular/platform-browser';
1212

1313
@Injectable()
1414
export class ServerStylesHost extends SharedStylesHost {
1515
private head: any = null;
1616
private _styleNodes = new Set<HTMLElement>();
1717

18-
constructor(
19-
@Inject(DOCUMENT) private doc: any,
20-
@Optional() @Inject(ɵTRANSITION_ID) private transitionId: string) {
18+
constructor(@Inject(DOCUMENT) doc: any, @Inject(APP_ID) private appId: string) {
2119
super();
2220
this.head = doc.getElementsByTagName('head')[0];
2321
}
@@ -26,8 +24,8 @@ export class ServerStylesHost extends SharedStylesHost {
2624
const adapter = getDOM();
2725
const el = adapter.createElement('style');
2826
el.textContent = style;
29-
if (!!this.transitionId) {
30-
el.setAttribute('ng-transition', this.transitionId);
27+
if (!!this.appId) {
28+
el.setAttribute('ng-app', this.appId);
3129
}
3230
this.head.appendChild(el);
3331
this._styleNodes.add(el);

packages/platform-server/src/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {ApplicationRef, EnvironmentProviders, importProvidersFrom, InjectionToken, NgModuleRef, PlatformRef, Provider, Renderer2, StaticProvider, Type, ɵannotateForHydration as annotateForHydration, ɵgetComponentDef as getComponentDef, ɵinternalCreateApplication as internalCreateApplication, ɵIS_HYDRATION_FEATURE_ENABLED as IS_HYDRATION_FEATURE_ENABLED, ɵisPromise} from '@angular/core';
10-
import {BrowserModule, ɵTRANSITION_ID} from '@angular/platform-browser';
9+
import {APP_ID, ApplicationRef, EnvironmentProviders, importProvidersFrom, InjectionToken, NgModuleRef, PlatformRef, Provider, Renderer2, StaticProvider, Type, ɵannotateForHydration as annotateForHydration, ɵgetComponentDef as getComponentDef, ɵinternalCreateApplication as internalCreateApplication, ɵIS_HYDRATION_FEATURE_ENABLED as IS_HYDRATION_FEATURE_ENABLED, ɵisPromise} from '@angular/core';
10+
import {BrowserModule} from '@angular/platform-browser';
1111
import {first} from 'rxjs/operators';
1212

1313
import {PlatformState} from './platform_state';
@@ -49,7 +49,7 @@ function _render<T>(
4949
bootstrapPromise: Promise<NgModuleRef<T>|ApplicationRef>): Promise<string> {
5050
return bootstrapPromise.then((moduleOrApplicationRef) => {
5151
const environmentInjector = moduleOrApplicationRef.injector;
52-
const transitionId = environmentInjector.get(ɵTRANSITION_ID, null);
52+
const transitionId = environmentInjector.get(APP_ID, null);
5353
if (!transitionId) {
5454
throw new Error(
5555
`renderModule[Factory]() requires the use of BrowserModule.withServerTransition() to ensure

0 commit comments

Comments
 (0)