diff --git a/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx b/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx index 165fd7c6b5a..7288aa1668f 100755 --- a/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx +++ b/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx @@ -8,7 +8,7 @@ adev/shared-docs/package.json=450629456 adev/shared-docs/pipeline/api-gen/package.json=939673974 integration/package.json=-239561259 modules/package.json=-2081919225 -package.json=1306517978 +package.json=-1401411541 packages/animations/package.json=-678724831 packages/benchpress/package.json=-1908328724 packages/common/package.json=1729763064 diff --git a/devtools/README.md b/devtools/README.md index 24a688b2a73..ec0e72cdbe3 100644 --- a/devtools/README.md +++ b/devtools/README.md @@ -46,12 +46,6 @@ To run the extension in development mode run: yarn devtools:devserver ``` -You can also run a standalone version of the demo app with: - -```shell -yarn devtools:devserver:demo-standalone -``` - This would start a development server that you can access on . In development, Angular DevTools uses a "development shell." This is different from "chrome shell" in a way, that it runs the user's app in an iframe. DevTools then communicate with the user's app via message passing. diff --git a/devtools/projects/demo-standalone/BUILD.bazel b/devtools/projects/demo-standalone/BUILD.bazel deleted file mode 100644 index ffd0fb0cdc5..00000000000 --- a/devtools/projects/demo-standalone/BUILD.bazel +++ /dev/null @@ -1 +0,0 @@ -package(default_visibility = ["//visibility:public"]) diff --git a/devtools/projects/demo-standalone/src/BUILD.bazel b/devtools/projects/demo-standalone/src/BUILD.bazel deleted file mode 100644 index a002e6b145e..00000000000 --- a/devtools/projects/demo-standalone/src/BUILD.bazel +++ /dev/null @@ -1,103 +0,0 @@ -load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory") -load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild") -load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web") -load("//devtools/tools:ng_project.bzl", "ng_project") -load("//tools:defaults.bzl", "http_server") -load("//tools:defaults2.bzl", "sass_binary") - -package(default_visibility = ["//visibility:public"]) - -sass_binary( - name = "demo_styles", - src = "styles.scss", - include_paths = ["external/npm/node_modules"], - sourcemap = False, - deps = ["//devtools/projects/ng-devtools/src/styles:global"], -) - -copy_to_directory( - name = "browser_specific_styles", - srcs = [ - "//devtools/projects/ng-devtools/src/styles:chrome", - "//devtools/projects/ng-devtools/src/styles:firefox", - ], - out = "styles", - replace_prefixes = { - "devtools/projects/ng-devtools/src/styles": "", - }, -) - -copy_to_directory( - name = "assets", - srcs = [ - "//devtools/projects/ng-devtools/src/assets", - ], - out = "assets", - replace_prefixes = { - "devtools/projects/ng-devtools/src/assets": "", - }, -) - -ng_project( - name = "demo", - srcs = ["main.ts"], - deps = [ - "//:node_modules/@angular/common", - "//:node_modules/@angular/core", - "//:node_modules/@angular/platform-browser", - "//:node_modules/rxjs", - "//devtools/projects/demo-standalone/src/app:app_rjs", - "//devtools/src:demo_application_environment_rjs", - "//devtools/src:demo_application_operations_rjs", - ], -) - -esbuild( - name = "bundle", - srcs = [ - "//:node_modules/@angular/build-tooling", - "//devtools/tools/esbuild:esbuild_base", - "//devtools/tools/esbuild:esbuild_config_esm", - ], - config = "//devtools/tools/esbuild:esbuild_config_esm", - entry_points = [":main.ts"], - platform = "browser", - splitting = True, - target = "es2016", - deps = [ - ":demo_rjs", - "//:node_modules/@angular/cdk", - "//:node_modules/@angular/material", - ], -) - -exports_files(["index.html"]) - -filegroup( - name = "dev_app_static_files", - srcs = [ - ":assets", - ":browser_specific_styles", - ":demo_styles", - ":index.html", - "//:node_modules/zone.js", - "//devtools/projects/demo-standalone/src/assets", - ], -) - -pkg_web( - name = "devapp", - srcs = [":dev_app_static_files"] + [ - ":bundle", - ], -) - -http_server( - name = "devserver", - srcs = [":dev_app_static_files"], - additional_root_paths = ["angular/devtools/projects/demo-standalone/src/devapp"], - tags = ["manual"], - deps = [ - ":devapp", - ], -) diff --git a/devtools/projects/demo-standalone/src/app/BUILD.bazel b/devtools/projects/demo-standalone/src/app/BUILD.bazel deleted file mode 100644 index 3af1a197d05..00000000000 --- a/devtools/projects/demo-standalone/src/app/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("//devtools/tools:ng_project.bzl", "ng_project") - -package(default_visibility = ["//visibility:public"]) - -ng_project( - name = "app", - srcs = [ - "app.component.ts", - ], - deps = [ - "//:node_modules/@angular/core", - "//:node_modules/@angular/platform-browser", - "//:node_modules/@angular/router", - "//devtools/projects/demo-standalone/src/app/demo-app:demo-app_rjs", - "//devtools/projects/demo-standalone/src/app/devtools-app:devtools-app_rjs", - "//devtools/projects/ng-devtools:ng-devtools_rjs", - ], -) diff --git a/devtools/projects/demo-standalone/src/app/app.component.ts b/devtools/projects/demo-standalone/src/app/app.component.ts deleted file mode 100644 index 692deac65b5..00000000000 --- a/devtools/projects/demo-standalone/src/app/app.component.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {Component} from '@angular/core'; -import {Router, RouterOutlet} from '@angular/router'; - -@Component({ - selector: 'app-root', - template: ``, - imports: [RouterOutlet], -}) -export class AppComponent { - constructor(public router: Router) {} -} diff --git a/devtools/projects/demo-standalone/src/app/demo-app/BUILD.bazel b/devtools/projects/demo-standalone/src/app/demo-app/BUILD.bazel deleted file mode 100644 index 0e0033bee13..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/BUILD.bazel +++ /dev/null @@ -1,41 +0,0 @@ -load("//devtools/tools:ng_project.bzl", "ng_project") -load("//tools:defaults2.bzl", "npm_sass_library", "sass_binary") - -package(default_visibility = ["//visibility:public"]) - -npm_sass_library( - name = "todo_mvc", - deps = [ - "//:node_modules/todomvc-app-css", - "//:node_modules/todomvc-common", - ], -) - -sass_binary( - name = "demo_app_component_styles", - src = "demo-app.component.scss", - deps = [ - ":todo_mvc", - ], -) - -ng_project( - name = "demo-app", - srcs = [ - "demo-app.component.ts", - "heavy.component.ts", - "zippy.component.ts", - ], - angular_assets = [ - "demo-app.component.html", - ":demo_app_component_styles", - ], - deps = [ - "//:node_modules/@angular/core", - "//:node_modules/@angular/elements", - "//:node_modules/@angular/router", - "//devtools/projects/demo-standalone/src/app/demo-app/todo:todo_rjs", - "//devtools/projects/ng-devtools-backend:ng-devtools-backend_rjs", - "//devtools/src:zone-unaware-iframe_message_bus_rjs", - ], -) diff --git a/devtools/projects/demo-standalone/src/app/demo-app/demo-app.component.html b/devtools/projects/demo-standalone/src/app/demo-app/demo-app.component.html deleted file mode 100644 index 616b7913067..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/demo-app.component.html +++ /dev/null @@ -1,11 +0,0 @@ - -This is my content - -
HTMLElement
- -
-

Signals

-
Object Signal: {{objectSignal()|json}}
-
Object Computed: {{objectComputed()|json}}
-
Editable Signal: {{primitiveSignal()}}
-
Primitive computed: {{primitiveComputed()}}
diff --git a/devtools/projects/demo-standalone/src/app/demo-app/demo-app.component.scss b/devtools/projects/demo-standalone/src/app/demo-app/demo-app.component.scss deleted file mode 100644 index 75a1576f87d..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/demo-app.component.scss +++ /dev/null @@ -1,2 +0,0 @@ -@use 'todomvc-app-css/index.css'; -@use 'todomvc-common/base.css'; diff --git a/devtools/projects/demo-standalone/src/app/demo-app/demo-app.component.ts b/devtools/projects/demo-standalone/src/app/demo-app/demo-app.component.ts deleted file mode 100644 index 86ef912e195..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/demo-app.component.ts +++ /dev/null @@ -1,103 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {JsonPipe} from '@angular/common'; -import { - Component, - computed, - CUSTOM_ELEMENTS_SCHEMA, - ElementRef, - EventEmitter, - inject, - InjectionToken, - Injector, - Input, - Output, - signal, - ViewChild, - ViewEncapsulation, -} from '@angular/core'; -import {createCustomElement} from '@angular/elements'; -import {RouterOutlet} from '@angular/router'; -import {initializeMessageBus} from '../../../../ng-devtools-backend'; - -import {ZoneUnawareIFrameMessageBus} from '../../../../../src/zone-unaware-iframe-message-bus'; - -import {HeavyComponent} from './heavy.component'; -import {ZippyComponent} from './zippy.component'; - -const NUMBER_TOKEN = new InjectionToken('number-token'); -const SYMBOL_TOKEN = new InjectionToken('symbol-token'); - -@Component({ - selector: 'app-demo-component', - templateUrl: './demo-app.component.html', - styleUrls: ['./demo-app.component.scss'], - encapsulation: ViewEncapsulation.None, - imports: [HeavyComponent, RouterOutlet, JsonPipe], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - providers: [ - {provide: NUMBER_TOKEN, useValue: 42}, - {provide: SYMBOL_TOKEN, useValue: Symbol('symbol_token')}, - ], -}) -export class DemoAppComponent { - readonly myNumber = inject(NUMBER_TOKEN); - readonly mySymbol = inject(SYMBOL_TOKEN); - - @ViewChild(ZippyComponent) zippy!: ZippyComponent; - @ViewChild('elementReference') elementRef!: ElementRef; - - @Input('input_one') inputOne = 'input one'; - @Input() inputTwo = 'input two'; - - @Output() outputOne = new EventEmitter(); - @Output('output_two') outputTwo = new EventEmitter(); - - primitiveSignal = signal(123); - primitiveComputed = computed(() => this.primitiveSignal() ** 2); - objectSignal = signal({name: 'John', age: 40}); - objectComputed = computed(() => { - const original = this.objectSignal(); - return {...original, age: original.age + 1}; - }); - test = [signal(3)]; - - constructor() { - const el = createCustomElement(ZippyComponent, {injector: inject(Injector)}); - customElements.define('app-zippy', el as any); - } - - getTitle(): '► Click to expand' | '▼ Click to collapse' { - if (!this.zippy || !this.zippy.visible) { - return '► Click to expand'; - } - return '▼ Click to collapse'; - } -} - -export const ROUTES = [ - { - path: '', - component: DemoAppComponent, - children: [ - { - path: '', - loadChildren: () => import('./todo/todo-app.component').then((m) => m.ROUTES), - }, - ], - }, -]; - -initializeMessageBus( - new ZoneUnawareIFrameMessageBus( - 'angular-devtools-backend', - 'angular-devtools', - () => window.parent, - ), -); diff --git a/devtools/projects/demo-standalone/src/app/demo-app/heavy.component.ts b/devtools/projects/demo-standalone/src/app/demo-app/heavy.component.ts deleted file mode 100644 index 52c207c9fc4..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/heavy.component.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {Component, Input} from '@angular/core'; - -const fib = (n: number): number => { - if (n === 1 || n === 2) { - return 1; - } - return fib(n - 1) + fib(n - 2); -}; - -@Component({selector: 'app-heavy', template: `

{{ calculate() }}

`}) -export class HeavyComponent { - @Input() - set foo(_: any) {} - - state = { - nested: { - props: { - foo: 1, - bar: 2, - }, - [Symbol(3)](): number { - return 1.618; - }, - get foo(): number { - return 42; - }, - }, - }; - calculate(): number { - return fib(15); - } -} diff --git a/devtools/projects/demo-standalone/src/app/demo-app/todo/BUILD.bazel b/devtools/projects/demo-standalone/src/app/demo-app/todo/BUILD.bazel deleted file mode 100644 index 03aa102ae7c..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/todo/BUILD.bazel +++ /dev/null @@ -1,20 +0,0 @@ -load("//devtools/tools:ng_project.bzl", "ng_project") - -package(default_visibility = ["//visibility:public"]) - -ng_project( - name = "todo", - srcs = [ - "dialog.component.ts", - "todo-app.component.ts", - ], - deps = [ - "//:node_modules/@angular/common", - "//:node_modules/@angular/core", - "//:node_modules/@angular/forms", - "//:node_modules/@angular/material", - "//:node_modules/@angular/router", - "//devtools/projects/demo-standalone/src/app/demo-app/todo/about:about_rjs", - "//devtools/projects/demo-standalone/src/app/demo-app/todo/home:home_rjs", - ], -) diff --git a/devtools/projects/demo-standalone/src/app/demo-app/todo/about/BUILD.bazel b/devtools/projects/demo-standalone/src/app/demo-app/todo/about/BUILD.bazel deleted file mode 100644 index edd3996530b..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/todo/about/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("//devtools/tools:ng_project.bzl", "ng_project") - -package(default_visibility = ["//visibility:public"]) - -ng_project( - name = "about", - srcs = ["about.component.ts"], - deps = [ - "//:node_modules/@angular/core", - "//:node_modules/@angular/router", - ], -) diff --git a/devtools/projects/demo-standalone/src/app/demo-app/todo/about/about.component.ts b/devtools/projects/demo-standalone/src/app/demo-app/todo/about/about.component.ts deleted file mode 100644 index a15efb2304b..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/todo/about/about.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {Component} from '@angular/core'; -import {RouterLink} from '@angular/router'; - -@Component({ - selector: 'app-about', - imports: [RouterLink], - template: ` - About component - Home - Home - Home - `, -}) -export class AboutComponent {} diff --git a/devtools/projects/demo-standalone/src/app/demo-app/todo/dialog.component.ts b/devtools/projects/demo-standalone/src/app/demo-app/todo/dialog.component.ts deleted file mode 100644 index e2799944fdc..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/todo/dialog.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {Component, Inject} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from '@angular/material/dialog'; -import {MatFormField, MatLabel} from '@angular/material/form-field'; - -export interface DialogData { - animal: string; - name: string; -} - -@Component({ - selector: 'app-dialog', - imports: [MatDialogModule, MatFormField, MatLabel, FormsModule], - template: ` -

Hi {{ data.name }}

-
-

What's your favorite animal?

- - Favorite Animal - - -
-
- - -
- `, -}) -export class DialogComponent { - constructor( - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: DialogData, - ) {} - - onNoClick(): void { - this.dialogRef.close(); - } -} diff --git a/devtools/projects/demo-standalone/src/app/demo-app/todo/home/BUILD.bazel b/devtools/projects/demo-standalone/src/app/demo-app/todo/home/BUILD.bazel deleted file mode 100644 index d99130b0373..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/todo/home/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("//devtools/tools:ng_project.bzl", "ng_project") - -package(default_visibility = ["//visibility:public"]) - -ng_project( - name = "home", - srcs = [ - "sample.pipe.ts", - "todo.component.ts", - "todos.component.ts", - "tooltip.directive.ts", - ], - deps = [ - "//:node_modules/@angular/common", - "//:node_modules/@angular/core", - "//:node_modules/@angular/router", - ], -) diff --git a/devtools/projects/demo-standalone/src/app/demo-app/todo/home/sample.pipe.ts b/devtools/projects/demo-standalone/src/app/demo-app/todo/home/sample.pipe.ts deleted file mode 100644 index a2438a2ac35..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/todo/home/sample.pipe.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {OnDestroy, Pipe, PipeTransform} from '@angular/core'; - -@Pipe({name: 'sample', pure: false}) -export class SamplePipe implements PipeTransform, OnDestroy { - transform(val: unknown) { - return val; - } - - ngOnDestroy(): void { - // tslint:disable-next-line:no-console - console.log('Destroying'); - } -} diff --git a/devtools/projects/demo-standalone/src/app/demo-app/todo/home/todo.component.ts b/devtools/projects/demo-standalone/src/app/demo-app/todo/home/todo.component.ts deleted file mode 100644 index 871f77de750..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/todo/home/todo.component.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {ChangeDetectionStrategy, Component, EventEmitter, Input, Output} from '@angular/core'; - -import {TooltipDirective} from './tooltip.directive'; - -export interface Todo { - id: string; - completed: boolean; - label: string; -} - -@Component({ - selector: 'app-todo', - changeDetection: ChangeDetectionStrategy.OnPush, - imports: [TooltipDirective], - styles: [ - ` - .destroy { - cursor: pointer; - display: unset !important; - } - `, - ], - template: ` -
  • -
    - - - -
    - -
  • - `, -}) -export class TodoComponent { - @Input() todo!: Todo; - @Output() update = new EventEmitter(); - @Output() delete = new EventEmitter(); - - editMode = false; - - toggle(): void { - this.todo.completed = !this.todo.completed; - this.update.emit(this.todo); - } - - completeEdit(label: string): void { - this.todo.label = label; - this.editMode = false; - this.update.emit(this.todo); - } - - enableEditMode(): void { - this.editMode = true; - } -} diff --git a/devtools/projects/demo-standalone/src/app/demo-app/todo/home/todos.component.ts b/devtools/projects/demo-standalone/src/app/demo-app/todo/home/todos.component.ts deleted file mode 100644 index 6f630d9b468..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/todo/home/todos.component.ts +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {NgForOf} from '@angular/common'; -import { - ChangeDetectorRef, - Component, - EventEmitter, - OnDestroy, - OnInit, - Output, - Pipe, - PipeTransform, -} from '@angular/core'; -import {RouterLink} from '@angular/router'; - -import {SamplePipe} from './sample.pipe'; -import {Todo, TodoComponent} from './todo.component'; -import {TooltipDirective} from './tooltip.directive'; - -export const enum TodoFilter { - All = 'all', - Completed = 'completed', - Active = 'active', -} - -@Pipe({pure: false, name: 'todosFilter'}) -export class TodosFilter implements PipeTransform { - transform(todos: Todo[], filter: TodoFilter): Todo[] { - return (todos || []).filter((t) => { - if (filter === TodoFilter.All) { - return true; - } - if (filter === TodoFilter.Active && !t.completed) { - return true; - } - if (filter === TodoFilter.Completed && t.completed) { - return true; - } - return false; - }); - } -} - -const fib = (n: number): number => { - if (n === 1 || n === 2) { - return 1; - } - return fib(n - 1) + fib(n - 2); -}; - -@Component({ - selector: 'app-todos', - imports: [RouterLink, TodoComponent, SamplePipe, TodosFilter, TooltipDirective], - template: ` - Home - Home - Home -

    {{ 'Sample text processed by a pipe' | sample }}

    -
    -
    -

    todos

    - -
    -
    - - -
      - @for (todo of todos | todosFilter: filterValue; track todo) { - - } -
    -
    -
    - - {{ itemsLeft }} item left - - -
    -
    - `, -}) -export class TodosComponent implements OnInit, OnDestroy { - todos: Todo[] = [ - { - label: 'Buy milk', - completed: false, - id: '42', - }, - { - label: 'Build something fun!', - completed: false, - id: '43', - }, - ]; - - @Output() update = new EventEmitter(); - @Output() delete = new EventEmitter(); - @Output() add = new EventEmitter(); - - private hashListener!: EventListenerOrEventListenerObject; - - constructor(private cdRef: ChangeDetectorRef) {} - - ngOnInit(): void { - if (typeof window !== 'undefined') { - window.addEventListener('hashchange', (this.hashListener = () => this.cdRef.markForCheck())); - } - } - - ngOnDestroy(): void { - fib(40); - if (typeof window !== 'undefined') { - window.removeEventListener('hashchange', this.hashListener); - } - } - - get filterValue(): TodoFilter { - if (typeof window !== 'undefined') { - return (window.location.hash.replace(/^#\//, '') as TodoFilter) || TodoFilter.All; - } - return TodoFilter.All; - } - - get itemsLeft(): number { - return (this.todos || []).filter((t) => !t.completed).length; - } - - clearCompleted(): void { - (this.todos || []).filter((t) => t.completed).forEach((t) => this.delete.emit(t)); - } - - addTodo(input: HTMLInputElement): void { - const todo = { - completed: false, - label: input.value, - }; - const result: Todo = {...todo, id: Math.random().toString()}; - this.todos.push(result); - input.value = ''; - } - - onChange(todo: Todo): void { - if (!todo.id) { - return; - } - } - - onDelete(todo: Todo): void { - if (!todo.id) { - return; - } - const idx = this.todos.findIndex((t) => t.id === todo.id); - if (idx < 0) { - return; - } - // tslint:disable-next-line:no-console - console.log('Deleting', idx); - - this.todos.splice(idx, 1); - } -} diff --git a/devtools/projects/demo-standalone/src/app/demo-app/todo/home/tooltip.directive.ts b/devtools/projects/demo-standalone/src/app/demo-app/todo/home/tooltip.directive.ts deleted file mode 100644 index da3b1c463da..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/todo/home/tooltip.directive.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {Directive, HostListener} from '@angular/core'; - -@Directive({selector: '[appTooltip]'}) -export class TooltipDirective { - visible = false; - nested = { - child: { - grandchild: { - prop: 1, - }, - }, - }; - - constructor() { - // setInterval(() => this.nested.child.grandchild.prop++, 500); - } - - @HostListener('click') - handleClick(): void { - this.visible = !this.visible; - if (this.visible) { - (this as any).extraProp = true; - } else { - delete (this as any).extraProp; - } - } -} diff --git a/devtools/projects/demo-standalone/src/app/demo-app/todo/todo-app.component.ts b/devtools/projects/demo-standalone/src/app/demo-app/todo/todo-app.component.ts deleted file mode 100644 index b85e16f459a..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/todo/todo-app.component.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {Component} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {MatDialog, MatDialogModule} from '@angular/material/dialog'; -import {RouterLink, RouterOutlet} from '@angular/router'; - -import {DialogComponent} from './dialog.component'; - -@Component({ - selector: 'app-todo-demo', - imports: [RouterLink, RouterOutlet, MatDialogModule, FormsModule], - styles: [ - ` - nav { - padding-top: 20px; - padding-bottom: 10px; - - a { - margin-right: 15px; - text-decoration: none; - } - } - - .dialog-open-button { - border: 1px solid #ccc; - padding: 10px; - margin-right: 20px; - } - `, - ], - template: ` - - - - - - `, -}) -export class TodoAppComponent { - name!: string; - animal!: string; - - constructor(public dialog: MatDialog) {} - - openDialog(): void { - const dialogRef = this.dialog.open(DialogComponent, { - width: '250px', - data: {name: this.name, animal: this.animal}, - }); - - dialogRef.afterClosed().subscribe((result) => { - // tslint:disable-next-line:no-console - console.log('The dialog was closed'); - - this.animal = result; - }); - } -} - -export const ROUTES = [ - { - path: 'todos', - component: TodoAppComponent, - children: [ - { - path: 'app', - loadComponent: () => import('./home/todos.component').then((m) => m.TodosComponent), - }, - { - path: 'about', - loadComponent: () => import('./about/about.component').then((m) => m.AboutComponent), - }, - { - path: '**', - redirectTo: 'app', - }, - ], - }, - { - path: '**', - redirectTo: 'todos', - }, -]; diff --git a/devtools/projects/demo-standalone/src/app/demo-app/zippy.component.ts b/devtools/projects/demo-standalone/src/app/demo-app/zippy.component.ts deleted file mode 100644 index c1b1a102fa2..00000000000 --- a/devtools/projects/demo-standalone/src/app/demo-app/zippy.component.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {Component, Input} from '@angular/core'; - -@Component({ - selector: 'app-zippy', - styles: [ - ` - :host { - user-select: none; - } - - header { - max-width: 120px; - border: 1px solid #ccc; - padding-left: 10px; - padding-right: 10px; - cursor: pointer; - } - - div { - max-width: 120px; - border-left: 1px solid #ccc; - border-right: 1px solid #ccc; - border-bottom: 1px solid #ccc; - padding: 10px; - } - `, - ], - template: ` -
    -
    {{ title }}
    -
    - -
    -
    - `, -}) -export class ZippyComponent { - @Input() title!: string; - visible = false; -} diff --git a/devtools/projects/demo-standalone/src/app/devtools-app/BUILD.bazel b/devtools/projects/demo-standalone/src/app/devtools-app/BUILD.bazel deleted file mode 100644 index 9c2dd22210e..00000000000 --- a/devtools/projects/demo-standalone/src/app/devtools-app/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("//devtools/tools:ng_project.bzl", "ng_project") - -package(default_visibility = ["//visibility:public"]) - -ng_project( - name = "devtools-app", - srcs = ["devtools-app.component.ts"], - deps = [ - "//:node_modules/@angular/common", - "//:node_modules/@angular/core", - "//:node_modules/@angular/router", - "//devtools/projects/ng-devtools:ng-devtools_rjs", - "//devtools/projects/ng-devtools/src/lib/application-services:frame_manager_rjs", - "//devtools/projects/protocol:protocol_rjs", - "//devtools/src:iframe_message_bus_rjs", - ], -) diff --git a/devtools/projects/demo-standalone/src/app/devtools-app/devtools-app.component.ts b/devtools/projects/demo-standalone/src/app/devtools-app/devtools-app.component.ts deleted file mode 100644 index 31c12c2ff2f..00000000000 --- a/devtools/projects/demo-standalone/src/app/devtools-app/devtools-app.component.ts +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {Component, ElementRef, ViewChild} from '@angular/core'; -import {Events, MessageBus, PriorityAwareMessageBus} from '../../../../protocol'; - -import {IFrameMessageBus} from '../../../../../src/iframe-message-bus'; -import {DevToolsComponent} from '../../../../ng-devtools'; -import {FrameManager} from '../../../../../projects/ng-devtools/src/lib/application-services/frame_manager'; - -@Component({ - imports: [DevToolsComponent], - providers: [ - {provide: FrameManager, useFactory: () => FrameManager.initialize(null)}, - { - provide: MessageBus, - useFactory(): MessageBus { - return new PriorityAwareMessageBus( - new IFrameMessageBus( - 'angular-devtools', - 'angular-devtools-backend', - () => (document.querySelector('#sample-app') as HTMLIFrameElement).contentWindow!, - ), - ); - }, - }, - ], - styles: [ - ` - iframe { - height: 340px; - width: 100%; - border: 0; - } - - .devtools-wrapper { - height: calc(100vh - 345px); - } - `, - ], - template: ` - -
    -
    - -
    - `, -}) -export class DemoDevToolsComponent { - messageBus: IFrameMessageBus | null = null; - @ViewChild('ref') iframe!: ElementRef; -} diff --git a/devtools/projects/demo-standalone/src/assets/.gitkeep b/devtools/projects/demo-standalone/src/assets/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/devtools/projects/demo-standalone/src/assets/BUILD.bazel b/devtools/projects/demo-standalone/src/assets/BUILD.bazel deleted file mode 100644 index 2168887f51e..00000000000 --- a/devtools/projects/demo-standalone/src/assets/BUILD.bazel +++ /dev/null @@ -1,9 +0,0 @@ -package(default_visibility = ["//:__subpackages__"]) - -filegroup( - name = "assets", - srcs = [ - "//third_party/fonts.google.com/material-symbols-outlined", - "//third_party/fonts.google.com/material-symbols-outlined:LICENSE", - ], -) diff --git a/devtools/projects/demo-standalone/src/environments/BUILD.bazel b/devtools/projects/demo-standalone/src/environments/BUILD.bazel deleted file mode 100644 index bd5a5307f1c..00000000000 --- a/devtools/projects/demo-standalone/src/environments/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("//devtools/tools:typescript.bzl", "ts_project") - -package(default_visibility = ["//visibility:public"]) - -ts_project( - name = "environments", - srcs = [ - "environment.ts", - ], - deps = [ - "//:node_modules/@angular/platform-browser", - ], -) diff --git a/devtools/projects/demo-standalone/src/environments/environment.ts b/devtools/projects/demo-standalone/src/environments/environment.ts deleted file mode 100644 index 51dec73bfa9..00000000000 --- a/devtools/projects/demo-standalone/src/environments/environment.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -export const environment = { - production: false, -}; diff --git a/devtools/projects/demo-standalone/src/index.html b/devtools/projects/demo-standalone/src/index.html deleted file mode 100644 index 54d425d2c1b..00000000000 --- a/devtools/projects/demo-standalone/src/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - AngularDevtools - - - - - - - - -
    - -
    - - - - - diff --git a/devtools/projects/demo-standalone/src/main.ts b/devtools/projects/demo-standalone/src/main.ts deleted file mode 100644 index 08d4e39021b..00000000000 --- a/devtools/projects/demo-standalone/src/main.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {bootstrapApplication} from '@angular/platform-browser'; -import {provideAnimations} from '@angular/platform-browser/animations'; -import {provideRouter} from '@angular/router'; -import {ApplicationEnvironment, ApplicationOperations} from '../../ng-devtools'; - -import {DemoApplicationEnvironment} from '../../../src/demo-application-environment'; -import {DemoApplicationOperations} from '../../../src/demo-application-operations'; - -import {AppComponent} from './app/app.component'; - -bootstrapApplication(AppComponent, { - providers: [ - provideAnimations(), - provideRouter([ - { - path: '', - loadComponent: () => - import('./app/devtools-app/devtools-app.component').then((m) => m.DemoDevToolsComponent), - pathMatch: 'full', - }, - { - path: 'demo-app', - loadChildren: () => import('./app/demo-app/demo-app.component').then((m) => m.ROUTES), - }, - ]), - { - provide: ApplicationOperations, - useClass: DemoApplicationOperations, - }, - { - provide: ApplicationEnvironment, - useClass: DemoApplicationEnvironment, - }, - ], -}); diff --git a/devtools/projects/demo-standalone/src/styles.scss b/devtools/projects/demo-standalone/src/styles.scss deleted file mode 100644 index adbeab311bc..00000000000 --- a/devtools/projects/demo-standalone/src/styles.scss +++ /dev/null @@ -1 +0,0 @@ -@use '../../../projects/ng-devtools/src/styles/global'; diff --git a/package.json b/package.json index 9cfad64cf17..19262984cb3 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "ts-circular-deps:check": "yarn -s ng-dev ts-circular-deps check --config ./packages/circular-deps-test.conf.js", "check-tooling-setup": "yarn tsc --project .ng-dev/tsconfig.json && yarn tsc --project scripts/tsconfig.json", "devtools:devserver": "ibazel run //devtools/src:devserver", - "devtools:devserver:demo-standalone": "ibazel run //devtools/projects/demo-standalone/src:devserver", "devtools:build:chrome": "bazelisk build --//devtools/projects/shell-browser/src:flag_browser=chrome //devtools/projects/shell-browser/src:prodapp", "devtools:build:firefox": "bazelisk build --config snapshot-build-firefox --//devtools/projects/shell-browser/src:flag_browser=firefox //devtools/projects/shell-browser/src:prodapp", "devtools:build:chrome:release": "yarn run -s devtools:build:chrome",