Skip to content

Commit 392473e

Browse files
cexbrayatkara
authored andcommitted
fix(core): consistently use ng:/// for sourcemap URLs (angular#29826)
Currently, in jit mode, `ngInjectableDef`, `ngDirectiveDef`, `ngPipeDef` and `ngModuleDef` use `ng://`, which display them in the top domain in Chrome Dev Tools, whereas `ngComponentDef` uses `ng:///` which display components in a separate domain. You can currently see: ``` AppModule UserService ng:// |_ AppComponent |_ template.html |_ AppComponent.js ... ``` This commits replaces all `ng://` with `ng:///` to display every Angular entity in the `ng://` domain. ``` ng:// |_ AppModule |_ UserService |_ AppComponent ... ``` PR Close angular#29826
1 parent 345a3cd commit 392473e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

packages/core/src/di/jit/injectable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function compileInjectable(type: Type<any>, srcMeta?: Injectable): void {
7171
throw new Error(`Unreachable state.`);
7272
}
7373
def = getCompilerFacade().compileInjectable(
74-
angularCoreDiEnv, `ng://${type.name}/ngInjectableDef.js`, compilerMeta);
74+
angularCoreDiEnv, `ng:///${type.name}/ngInjectableDef.js`, compilerMeta);
7575
}
7676
return def;
7777
},

packages/core/src/render3/jit/directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export function compileDirective(type: Type<any>, directive: Directive): void {
123123
get: () => {
124124
if (ngDirectiveDef === null) {
125125
const name = type && type.name;
126-
const sourceMapUrl = `ng://${name}/ngDirectiveDef.js`;
126+
const sourceMapUrl = `ng:///${name}/ngDirectiveDef.js`;
127127
const compiler = getCompilerFacade();
128128
const facade = directiveMetadata(type as ComponentType<any>, directive);
129129
facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);

packages/core/src/render3/jit/module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function compileNgModuleDefs(moduleType: NgModuleType, ngModule: NgModule
107107
get: () => {
108108
if (ngModuleDef === null) {
109109
ngModuleDef = getCompilerFacade().compileNgModule(
110-
angularCoreEnv, `ng://${moduleType.name}/ngModuleDef.js`, {
110+
angularCoreEnv, `ng:///${moduleType.name}/ngModuleDef.js`, {
111111
type: moduleType,
112112
bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY, resolveForwardRef),
113113
declarations: declarations.map(resolveForwardRef),
@@ -142,7 +142,7 @@ export function compileNgModuleDefs(moduleType: NgModuleType, ngModule: NgModule
142142
],
143143
};
144144
ngInjectorDef = getCompilerFacade().compileInjector(
145-
angularCoreEnv, `ng://${moduleType.name}/ngInjectorDef.js`, meta);
145+
angularCoreEnv, `ng:///${moduleType.name}/ngInjectorDef.js`, meta);
146146
}
147147
return ngInjectorDef;
148148
},

packages/core/src/render3/jit/pipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function compilePipe(type: Type<any>, meta: Pipe): void {
2121
if (ngPipeDef === null) {
2222
const typeName = type.name;
2323
ngPipeDef =
24-
getCompilerFacade().compilePipe(angularCoreEnv, `ng://${typeName}/ngPipeDef.js`, {
24+
getCompilerFacade().compilePipe(angularCoreEnv, `ng:///${typeName}/ngPipeDef.js`, {
2525
type: type,
2626
typeArgumentCount: 0,
2727
name: typeName,

0 commit comments

Comments
 (0)