Skip to content

Commit a1bb684

Browse files
committed
refactor(core): export profile event as enum and move profile_types.ts and framework to shared devtools folder
move framework enum and profile_types to a shared folder so it can be used by wiz
1 parent d2b854b commit a1bb684

33 files changed

+58
-33
lines changed

goldens/public-api/core/global_utils.api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
```ts
66

7+
import { ɵFramework } from '@angular/core';
8+
79
// @public
810
export function applyChanges(component: {}): void;
911

packages/core/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ ng_project(
3636
"//:node_modules/zone.js",
3737
"//packages:goog_types",
3838
"//packages/core/primitives/defer:triggers",
39+
"//packages/core/primitives/devtools",
3940
"//packages/core/primitives/di",
4041
"//packages/core/primitives/dom-navigation",
4142
"//packages/core/primitives/event-dispatch",
42-
"//packages/core/primitives/profiler",
4343
"//packages/core/primitives/signals",
4444
"//packages/core/src/compiler",
4545
"//packages/core/src/di/interface",

packages/core/primitives/profiler/BUILD.bazel renamed to packages/core/primitives/devtools/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package(default_visibility = [
66
])
77

88
ts_project(
9-
name = "profiler",
9+
name = "devtools",
1010
srcs = glob(
1111
[
1212
"**/*.ts",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Angular Profiler Types
2+
3+
This directory contains interfaces and enums related to the [Angular Devtools](https://angular.dev/tools/devtools). Use these interfaces and enums if you need to hook into Angular Devtools.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.dev/license
7+
*/
8+
9+
export {ProfilerEvent, type Profiler} from './src/profiler_types';
10+
export {Framework} from './src/framework';
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.dev/license
7+
*/
8+
9+
/** The framework used to author a particular application or component. */
10+
export enum Framework {
11+
Angular = 'angular',
12+
ACX = 'acx',
13+
Wiz = 'wiz',
14+
}

packages/core/primitives/profiler/src/profiler_types.ts renamed to packages/core/primitives/devtools/src/profiler_types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*!
1+
/**
22
* @license
33
* Copyright Google LLC All Rights Reserved.
44
*
@@ -14,7 +14,7 @@
1414
* Profiler events is an enum used by the profiler to distinguish between different calls of user
1515
* code invoked throughout the application lifecycle.
1616
*/
17-
export const enum ProfilerEvent {
17+
export enum ProfilerEvent {
1818
/**
1919
* Corresponds to the point in time before the runtime has called the template function of a
2020
* component with `RenderFlags.Create`.

packages/core/primitives/profiler/README.md

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

packages/core/src/application/application_ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import {TESTABILITY} from '../testability/testability';
4545
import {NgZone} from '../zone/ng_zone';
4646

4747
import {profiler} from '../render3/profiler';
48-
import {ProfilerEvent} from '../../primitives/profiler/src/profiler_types';
48+
import {ProfilerEvent} from '../../primitives/devtools';
4949
import {EffectScheduler} from '../render3/reactivity/root_effect_scheduler';
5050
import {isReactiveLViewConsumer} from '../render3/reactive_lview_consumer';
5151
import {ApplicationInitStatus} from './application_init';

packages/core/src/application/create_application.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {ApplicationRef} from './application_ref';
1717
import {provideZonelessChangeDetectionInternal} from '../change_detection/scheduling/zoneless_scheduling_impl';
1818
import {bootstrap} from '../platform/bootstrap';
1919
import {profiler} from '../render3/profiler';
20-
import {ProfilerEvent} from '../../primitives/profiler/src/profiler_types';
20+
import {ProfilerEvent} from '../../primitives/devtools';
2121
import {errorHandlerEnvironmentInitializer} from '../error_handler';
2222
import {RuntimeError, RuntimeErrorCode} from '../errors';
2323
import {PlatformRef} from '../platform/platform_ref';

0 commit comments

Comments
 (0)