_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
angular/packages/core/test/strict_types/BUILD.bazel_0_538
package(default_visibility = ["//visibility:private"]) load("//tools:defaults.bzl", "jasmine_node_test", "ts_config", "ts_library") ts_config( name = "tsconfig", src = "tsconfig.json", deps = [ "//packages:tsconfig-test", ], ) ts_library( name = "strict_types_lib", testonly = True, srcs = glob( ["**/*.ts"], ), tsconfig = ":tsconfig", deps = [ "//packages/core", ], ) jasmine_node_test( name = "strict_types", deps = [ ":strict_types_lib", ], )
{ "end_byte": 538, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/strict_types/BUILD.bazel" }
angular/packages/core/test/bundling/README.md_0_381
# Bundle ## `js_expected_symbol_test` This folder contains tests which assert that most of the code is tree shaken away. This is asserted by keeping gold files of all symbols which are expected to be retained. When doing renaming it is often necessary to update the gold files; to do so use these scripts: ``` yarn run symbol-extractor:check yarn run symbol-extractor:update ```
{ "end_byte": 381, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/README.md" }
angular/packages/core/test/bundling/core_all/BUILD.bazel_0_748
load("//tools:defaults.bzl", "app_bundle", "ts_library") load("@npm//@angular/build-tooling/bazel/map-size-tracking:index.bzl", "js_mapping_size_test") package(default_visibility = ["//visibility:public"]) ts_library( name = "core_all", srcs = ["index.ts"], tags = [], deps = [ "//packages/core", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":core_all", "//packages/core", "@npm//rxjs", ], ) js_mapping_size_test( name = "size_test", src = ":bundle.min.js", golden_file = ":bundle.golden_size_map.json", max_byte_diff = 250, max_percentage_diff = 15, source_map = ":bundle.min.js.map", tags = [ "manual", ], )
{ "end_byte": 748, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/core_all/BUILD.bazel" }
angular/packages/core/test/bundling/core_all/index.ts_0_390
/** * @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 * as core from '@angular/core'; // We need to something with the "core" import in order to ensure // that all symbols from core are preserved in the bundle. console.error(core);
{ "end_byte": 390, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/core_all/index.ts" }
angular/packages/core/test/bundling/hello_world_i18n/index.html_0_1222
<!DOCTYPE html> <html> <head> <title>Angular Hello World Example</title> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <hello-world></hello-world> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write('<script src="' + (document.location.search.endsWith('debug') ? '/bundle.debug.min.js' : '/bundle.min.js') + '"></' + 'script>'); </script> </body> </html>
{ "end_byte": 1222, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hello_world_i18n/index.html" }
angular/packages/core/test/bundling/hello_world_i18n/translations.ts_0_682
/** * @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 */ // Make the `$localize()` global function available to the compiled templates, and the direct calls // below. This would normally be done inside the application `polyfills.ts` file. import '@angular/localize/init'; import {computeMsgId} from '@angular/compiler'; import {loadTranslations} from '@angular/localize'; const translations = { [computeMsgId('Hello World!')]: 'Bonjour Monde!', [computeMsgId('Hello Title!')]: 'Bonjour Titre!', }; loadTranslations(translations);
{ "end_byte": 682, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hello_world_i18n/translations.ts" }
angular/packages/core/test/bundling/hello_world_i18n/BUILD.bazel_0_748
load("//tools:defaults.bzl", "app_bundle", "ng_module") load("@npm//http-server:index.bzl", "http_server") package(default_visibility = ["//visibility:public"]) ng_module( name = "hello_world_i18n", srcs = [ "index.ts", "translations.ts", ], deps = [ "//packages/core", "//packages/localize", "//packages/localize/init", "//packages/platform-browser", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":hello_world_i18n", "//packages/core", "@npm//rxjs", ], ) http_server( name = "prodserver", data = [ "index.html", ":bundle.debug.min.js", ":bundle.min.js", ], tags = [], )
{ "end_byte": 748, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hello_world_i18n/BUILD.bazel" }
angular/packages/core/test/bundling/hello_world_i18n/index.ts_0_708
/** * @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 './translations'; import {Component, NgModule} from '@angular/core'; import {BrowserModule, platformBrowser} from '@angular/platform-browser'; @Component({ selector: 'hello-world', template: `<div i18n i18n-title title="Hello Title!">Hello World!</div>`, standalone: false, }) export class HelloWorld {} @NgModule({ declarations: [HelloWorld], imports: [BrowserModule], bootstrap: [HelloWorld], }) export class Module {} platformBrowser().bootstrapModule(Module, {ngZone: 'noop'});
{ "end_byte": 708, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hello_world_i18n/index.ts" }
angular/packages/core/test/bundling/todo_i18n/todo.css_0_5839
html, body { margin: 0; padding: 0; } button { margin: 0; padding: 0; border: 0; background: none; font-size: 100%; vertical-align: baseline; font-family: inherit; font-weight: inherit; color: inherit; -webkit-appearance: none; appearance: none; } body { font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 1.4em; background: #f5f5f5; color: #4d4d4d; min-width: 230px; max-width: 550px; margin: 0 auto; font-weight: 300; } button, input[type="checkbox"] { outline: none; } .hidden { display: none; } .todoapp { background: #fff; margin: 130px 0 40px 0; position: relative; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1); } .todoapp input::-webkit-input-placeholder { font-style: italic; font-weight: 300; color: #e6e6e6; } .todoapp input::-moz-placeholder { font-style: italic; font-weight: 300; color: #e6e6e6; } .todoapp input::input-placeholder { font-style: italic; font-weight: 300; color: #e6e6e6; } .todoapp h1 { position: absolute; top: -155px; width: 100%; font-size: 80px; line-height: 80px; font-weight: 100; text-align: center; color: rgba(175, 47, 47, 0.15); -webkit-text-rendering: optimizeLegibility; -moz-text-rendering: optimizeLegibility; text-rendering: optimizeLegibility; } .new-todo, .edit { position: relative; margin: 0; width: 100%; font-size: 24px; font-family: inherit; font-weight: inherit; line-height: 1.4em; border: 0; outline: none; color: inherit; padding: 6px; border: 1px solid #999; box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2); box-sizing: border-box; } .new-todo { padding: 16px 16px 16px 60px; border: none; background: rgba(0, 0, 0, 0.003); box-shadow: inset 0 -2px 1px rgba(0,0,0,0.03); } .main { position: relative; z-index: 2; border-top: 1px solid #e6e6e6; } label[for='toggle-all'] { display: none; } .toggle-all { position: absolute; top: -55px; left: -12px; width: 60px; height: 34px; text-align: center; border: none; /* Mobile Safari */ } .toggle-all:before { content: '❯'; font-size: 22px; color: #e6e6e6; padding: 10px 27px 10px 27px; } .toggle-all:checked:before { color: #737373; } .todo-list { margin: 0; padding: 0; list-style: none; } .todo-list li { position: relative; font-size: 24px; border-bottom: 1px solid #ededed; } .todo-list li:last-child { border-bottom: none; } .todo-list li.editing { border-bottom: none; padding: 0; } .todo-list li.editing .edit { display: block; width: 506px; padding: 13px 17px 12px 17px; margin: 0 0 0 43px; } .todo-list li.editing .view { display: none; } .todo-list li .toggle { text-align: center; width: 40px; /* auto, since non-WebKit browsers doesn't support input styling */ height: auto; position: absolute; top: 0; bottom: 0; margin: auto 0; border: none; /* Mobile Safari */ -webkit-appearance: none; appearance: none; } .todo-list li .toggle:after { content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#ededed" stroke-width="3"/></svg>'); } .todo-list li .toggle:checked:after { content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#bddad5" stroke-width="3"/><path fill="#5dc2af" d="M72 25L42 71 27 56l-4 4 20 20 34-52z"/></svg>'); } .todo-list li label { white-space: pre-line; word-break: break-all; padding: 15px 60px 15px 15px; margin-left: 45px; display: block; line-height: 1.2; transition: color 0.4s; } .todo-list li.completed label { color: #d9d9d9; text-decoration: line-through; } .todo-list li .destroy { display: none; position: absolute; top: 0; right: 10px; bottom: 0; width: 40px; height: 40px; margin: auto 0; font-size: 30px; color: #cc9a9a; margin-bottom: 11px; transition: color 0.2s ease-out; } .todo-list li .destroy:hover { color: #af5b5e; } .todo-list li .destroy:after { content: '×'; } .todo-list li:hover .destroy { display: block; } .todo-list li .edit { display: none; } .todo-list li.editing:last-child { margin-bottom: -1px; } .footer { color: #777; padding: 10px 15px; height: 20px; text-align: center; border-top: 1px solid #e6e6e6; } .footer:before { content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 50px; overflow: hidden; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 8px 0 -3px #f6f6f6, 0 9px 1px -3px rgba(0, 0, 0, 0.2), 0 16px 0 -6px #f6f6f6, 0 17px 2px -6px rgba(0, 0, 0, 0.2); } .todo-count { float: left; text-align: left; } .todo-count strong { font-weight: 300; } .filters { margin: 0; padding: 0; list-style: none; position: absolute; right: 0; left: 0; } .filters li { display: inline; } .filters li a { color: inherit; margin: 3px; padding: 3px 7px; text-decoration: none; border: 1px solid transparent; border-radius: 3px; } .filters li a.selected, .filters li a:hover { border-color: rgba(175, 47, 47, 0.1); } .filters li a.selected { border-color: rgba(175, 47, 47, 0.2); } .clear-completed, html .clear-completed:active { float: right; position: relative; line-height: 20px; text-decoration: none; cursor: pointer; } .clear-completed:hover { text-decoration: underline; } .info { margin: 65px auto 0; color: #bfbfbf; font-size: 10px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); text-align: center; } .info p { line-height: 1; } .info a { color: inherit; text-decoration: none; font-weight: 400; } .info a:hover { text-decoration: underline; } /* Hack to remove background from Mobile Safari. Can't use it globally since it destroys checkboxes in Firefox */ @m
{ "end_byte": 5839, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo_i18n/todo.css" }
angular/packages/core/test/bundling/todo_i18n/todo.css_5840_6227
dia screen and (-webkit-min-device-pixel-ratio:0) { .toggle-all, .todo-list li .toggle { background: none; } .todo-list li .toggle { height: 40px; } .toggle-all { -webkit-transform: rotate(90deg); transform: rotate(90deg); -webkit-appearance: none; appearance: none; } } @media (max-width: 430px) { .footer { height: 50px; } .filters { bottom: 10px; } }
{ "end_byte": 6227, "start_byte": 5840, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo_i18n/todo.css" }
angular/packages/core/test/bundling/todo_i18n/index.html_0_1343
<!DOCTYPE html> <html> <head> <title>Angular Todo Example</title> <link rel="stylesheet" href="base.css"> <link rel="stylesheet" href="todo.css"> <style> .done { text-decoration: line-through; } </style> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <todo-app></todo-app> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write('<script src="' + (document.location.search.endsWith('debug') ? 'bundle.debug.min.js' : 'bundle.min.js') + '"></' + 'script>'); </script> </body> </html>
{ "end_byte": 1343, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo_i18n/index.html" }
angular/packages/core/test/bundling/todo_i18n/OUTSTANDING_WORK.md_0_1267
# Outstanding on the `Todo` app ## `Todo` app - [X] Clicking archive removes todo item. - [X] Update `Todo` app to match http://todomvc.com/. - [ ] Make it work with `[(ngModel)]`. - [ ] Make it work with `(keyup.Enter)`. ## Compiler - [X] Remove ` tslib_1.__decorate([core_1.Input(), tslib_1.__metadata("design:type", Object)], TodoComponent.prototype, "todo", void 0);` from generated output. - [ ] Allow compilation of `@angular/common` through ivy. ## Ivy Runtime - [X] Work on `ViewContainerRef` needs to cause change detection so that `todo` app renders correctly on first render. - [X] The todo input value box is not correctly rendering to checked for completed tasks. - [ ] `ViewContainerRef` must separate creation mode from update mode otherwise {{todo.done}} fails for `NgFor` because `todo` is not set during creation mode. - [ ] Injector should be optional ## Testing - [ ] Create a debug mode which would publish components into DOM for easier writing of tests. # NOTES ## Killing hung `iblaze` server At times the `iblaze run packages/core/test/bundling/todo:devserver` keeps running and holding onto ports even after `ctrl-c`. This command kills the outstanding processes. ``` kill -9 $(ps aux | grep ibazel\\\|devserver | cut -c 17-23) ```
{ "end_byte": 1267, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo_i18n/OUTSTANDING_WORK.md" }
angular/packages/core/test/bundling/todo_i18n/translations.ts_0_1589
/** * @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 */ // Make the `$localize()` global function available to the compiled templates, and the direct calls // below. This would normally be done inside the application `polyfills.ts` file. import '@angular/localize/init'; import {computeMsgId} from '@angular/compiler'; export const translations = { [computeMsgId('What needs to be done?', '')]: `Qu'y a-t-il à faire ?`, [computeMsgId('{$START_HEADING_LEVEL1}todos{$CLOSE_HEADING_LEVEL1}{$TAG_INPUT}', '')]: '{$START_HEADING_LEVEL1}liste de tâches{$CLOSE_HEADING_LEVEL1}{$TAG_INPUT}', [computeMsgId('{VAR_PLURAL, plural, =1 {item left} other {items left}}', '')]: '{VAR_PLURAL, plural, =1 {tâche restante} other {tâches restantes}}', [computeMsgId('{$START_TAG_STRONG}{$INTERPOLATION}{$CLOSE_TAG_STRONG}{$ICU}', '')]: '{$START_TAG_STRONG}{$INTERPOLATION}{$CLOSE_TAG_STRONG} {$ICU}', [computeMsgId('Clear Completed', '')]: ' Effacer terminés ', [computeMsgId('Demonstrate Components', '')]: ' Démontrer les components', [computeMsgId('Demonstrate Structural Directives', '')]: 'Démontrer les directives structurelles', [computeMsgId('Demonstrate {$value}', '')]: 'Démontrer {$value}', [computeMsgId('Demonstrate zoneless change detection', '')]: 'Démontrer la détection des changements sans zonejs', [computeMsgId('Demonstrate internationalization', '')]: `Démontrer l'internationalisation`, };
{ "end_byte": 1589, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo_i18n/translations.ts" }
angular/packages/core/test/bundling/todo_i18n/BUILD.bazel_0_1326
load("//tools:defaults.bzl", "app_bundle", "http_server", "jasmine_node_test", "ng_module", "ts_library") package(default_visibility = ["//visibility:public"]) ng_module( name = "todo_i18n", srcs = [ "index.ts", "translations.ts", ], deps = [ "//packages/core", "//packages/localize", "//packages/localize/init", "//packages/platform-browser", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":todo_i18n", "//packages/common", "//packages/core", "@npm//rxjs", ], ) ts_library( name = "test_lib", testonly = True, srcs = glob(["*_spec.ts"]), deps = [ "//packages:types", "//packages/compiler", "//packages/core", "//packages/core/testing", "//packages/localize", "//packages/localize/init", "//packages/private/testing", ], ) jasmine_node_test( name = "test", data = [ ":bundle", ":bundle.debug.min.js", ":bundle.js", ":bundle.min.js", ], deps = [":test_lib"], ) http_server( name = "server", srcs = [ "base.css", "index.html", "todo.css", ], deps = [ ":bundle.debug.min.js", ":bundle.min.js", ], )
{ "end_byte": 1326, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo_i18n/BUILD.bazel" }
angular/packages/core/test/bundling/todo_i18n/index.ts_0_5758
/** * @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 {ChangeDetectorRef, Component, Injectable, NgModule, ViewEncapsulation} from '@angular/core'; import {loadTranslations} from '@angular/localize'; import {BrowserModule, platformBrowser} from '@angular/platform-browser'; import {translations} from './translations'; class Todo { editing: boolean; get title() { return this._title; } set title(value: string) { this._title = value.trim(); } constructor( private _title: string, public completed: boolean = false, ) { this.editing = false; } } @Injectable({providedIn: 'root'}) class TodoStore { todos: Array<Todo> = [ new Todo($localize`Demonstrate Components`), new Todo($localize`Demonstrate Structural Directives`, true), // Using a placeholder new Todo($localize`Demonstrate ${'NgModules'}:value:`), new Todo($localize`Demonstrate zoneless change detection`), new Todo($localize`Demonstrate internationalization`), ]; private getWithCompleted(completed: boolean) { return this.todos.filter((todo: Todo) => todo.completed === completed); } allCompleted() { return this.todos.length === this.getCompleted().length; } setAllTo(completed: boolean) { this.todos.forEach((t: Todo) => (t.completed = completed)); } removeCompleted() { this.todos = this.getWithCompleted(false); } getRemaining() { return this.getWithCompleted(false); } getCompleted() { return this.getWithCompleted(true); } toggleCompletion(todo: Todo) { todo.completed = !todo.completed; } remove(todo: Todo) { this.todos.splice(this.todos.indexOf(todo), 1); } add(title: string) { this.todos.push(new Todo(title)); } } @Component({ selector: 'todo-app', // TODO(misko): make this work with `[(ngModel)]` encapsulation: ViewEncapsulation.None, template: ` <section class="todoapp"> <header class="header" i18n> <h1>todos</h1> <input class="new-todo" i18n-placeholder placeholder="What needs to be done?" autofocus="" [value]="newTodoText" (keyup)="$event.code == 'Enter' ? addTodo() : updateNewTodoValue($event.target.value)"> </header> <section *ngIf="todoStore.todos.length > 0" class="main"> <input *ngIf="todoStore.todos.length" #toggleall class="toggle-all" type="checkbox" [checked]="todoStore.allCompleted()" (click)="toggleAllTodos(toggleall.checked)"> <ul class="todo-list"> <li *ngFor="let todo of todoStore.todos" [class.completed]="todo.completed" [class.editing]="todo.editing"> <div class="view"> <input class="toggle" type="checkbox" (click)="toggleCompletion(todo)" [checked]="todo.completed"> <label (dblclick)="editTodo(todo)">{{todo.title}}</label> <button class="destroy" (click)="remove(todo)"></button> </div> <input *ngIf="todo.editing" class="edit" #editedtodo [value]="todo.title" (blur)="updateEditedTodoValue(todo, editedtodo.value)" (keyup)="updateEditedTodoValue(todo, $event.target.value)" (keyup)="$event.code == 'Enter' && updateEditedTodoValue(todo, editedtodo.value)" (keyup)="$event.code == 'Escape' && cancelEditingTodo(todo)"> </li> </ul> </section> <footer *ngIf="todoStore.todos.length > 0" class="footer"> <span class="todo-count" i18n> <strong>{{todoStore.getRemaining().length}}</strong> {todoStore.getRemaining().length, plural, =1 {item left} other {items left}} </span> <button *ngIf="todoStore.getCompleted().length > 0" class="clear-completed" (click)="removeCompleted()" i18n> Clear completed </button> </footer> </section> `, standalone: false, }) class ToDoAppComponent { newTodoText = ''; constructor( public todoStore: TodoStore, private readonly cdr: ChangeDetectorRef, ) { (window as any).todoAppComponent = this; } cancelEditingTodo(todo: Todo) { todo.editing = false; this.cdr.detectChanges(); } finishUpdatingTodo(todo: Todo, editedTitle: string) { editedTitle = editedTitle.trim(); if (editedTitle.length === 0) { this.remove(todo); } todo.title = editedTitle; this.cancelEditingTodo(todo); } editTodo(todo: Todo) { todo.editing = true; this.cdr.detectChanges(); } removeCompleted() { this.todoStore.removeCompleted(); this.cdr.detectChanges(); } toggleCompletion(todo: Todo) { this.todoStore.toggleCompletion(todo); this.cdr.detectChanges(); } remove(todo: Todo) { this.todoStore.remove(todo); this.cdr.detectChanges(); } addTodo() { if (this.newTodoText.trim().length) { this.todoStore.add(this.newTodoText); this.newTodoText = ''; } this.cdr.detectChanges(); } toggleAllTodos(checked: boolean) { this.todoStore.setAllTo(checked); this.cdr.detectChanges(); } updateEditedTodoValue(todo: Todo, value: string) { todo.title = value; this.cdr.detectChanges(); } updateNewTodoValue(value: string) { this.newTodoText = value; this.cdr.detectChanges(); } } @NgModule({ declarations: [ToDoAppComponent], imports: [BrowserModule], bootstrap: [ToDoAppComponent], }) class ToDoAppModule {} loadTranslations(translations); (window as any).appReady = platformBrowser().bootstrapModule(ToDoAppModule, {ngZone: 'noop'});
{ "end_byte": 5758, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo_i18n/index.ts" }
angular/packages/core/test/bundling/todo_i18n/todo_e2e_spec.ts_0_1638
/** * @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 '@angular/localize/init'; import '@angular/compiler'; import {clearTranslations} from '@angular/localize'; import {withBody} from '@angular/private/testing'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/todo_i18n'; const BUNDLES = ['bundle.js', 'bundle.debug.min.js', 'bundle.min.js']; describe('functional test for todo i18n', () => { BUNDLES.forEach((bundle) => { describe(bundle, () => { it( 'should render todo i18n', withBody('<todo-app></todo-app>', async () => { clearTranslations(); // load the bundle await import(path.join(PACKAGE, bundle)); // the bundle attaches the following fields to the `window` global. const {appReady} = window as any; await appReady; expect(document.body.textContent).toContain('liste de tâches'); expect(document.body.textContent).toContain('Démontrer les components'); expect(document.body.textContent).toContain('Démontrer NgModules'); expect(document.body.textContent).toContain('4 tâches restantes'); expect(document.querySelector('.new-todo')!.getAttribute('placeholder')).toEqual( `Qu'y a-t-il à faire ?`, ); document.querySelector('button')!.click(); expect(document.body.textContent).toContain('3 tâches restantes'); }), ); }); }); });
{ "end_byte": 1638, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo_i18n/todo_e2e_spec.ts" }
angular/packages/core/test/bundling/todo_i18n/base.css_0_1817
hr { margin: 20px 0; border: 0; border-top: 1px dashed #c5c5c5; border-bottom: 1px dashed #f7f7f7; } .learn a { font-weight: normal; text-decoration: none; color: #b83f45; } .learn a:hover { text-decoration: underline; color: #787e7e; } .learn h3, .learn h4, .learn h5 { margin: 10px 0; font-weight: 500; line-height: 1.2; color: #000; } .learn h3 { font-size: 24px; } .learn h4 { font-size: 18px; } .learn h5 { margin-bottom: 0; font-size: 14px; } .learn ul { padding: 0; margin: 0 0 30px 25px; } .learn li { line-height: 20px; } .learn p { font-size: 15px; font-weight: 300; line-height: 1.3; margin-top: 0; margin-bottom: 0; } #issue-count { display: none; } .quote { border: none; margin: 20px 0 60px 0; } .quote p { font-style: italic; } .quote p:before { content: '“'; font-size: 50px; opacity: .15; position: absolute; top: -20px; left: 3px; } .quote p:after { content: '”'; font-size: 50px; opacity: .15; position: absolute; bottom: -42px; right: 3px; } .quote footer { position: absolute; bottom: -40px; right: 0; } .quote footer img { border-radius: 3px; } .quote footer a { margin-left: 5px; vertical-align: middle; } .speech-bubble { position: relative; padding: 10px; background: rgba(0, 0, 0, .04); border-radius: 5px; } .speech-bubble:after { content: ''; position: absolute; top: 100%; right: 30px; border: 13px solid transparent; border-top-color: rgba(0, 0, 0, .04); } .learn-bar > .learn { position: absolute; width: 272px; top: 8px; left: -300px; padding: 10px; border-radius: 5px; background-color: rgba(255, 255, 255, .6); transition-property: left; transition-duration: 500ms; } @media (min-width: 899px) { .learn-bar { width: auto; padding-left: 300px; } .learn-bar > .learn { left: 8px; } }
{ "end_byte": 1817, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo_i18n/base.css" }
angular/packages/core/test/bundling/hello_world/index.html_0_1228
<!DOCTYPE html> <html> <head> <title>Angular Hello World Example</title> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <hello-world></hello-world> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write('<script src="' + (document.location.search.endsWith('debug') ? '/bundle.debug.min.js' : '/bundle.min.js') + '"></' + 'script>'); </script> </body> </html>
{ "end_byte": 1228, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hello_world/index.html" }
angular/packages/core/test/bundling/hello_world/treeshaking_spec.ts_0_941
/** * @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 '@angular/compiler'; import {runfiles} from '@bazel/runfiles'; import * as fs from 'fs'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/hello_world'; describe('treeshaking with uglify', () => { let content: string; const contentPath = runfiles.resolve(path.join(PACKAGE, 'bundle.debug.min.js')); beforeAll(() => { content = fs.readFileSync(contentPath, {encoding: 'utf-8'}); }); it('should drop unused TypeScript helpers', () => { expect(content).not.toContain('__asyncGenerator'); }); it('should not contain rxjs from commonjs distro', () => { expect(content).not.toContain('commonjsGlobal'); expect(content).not.toContain('createCommonjsModule'); }); });
{ "end_byte": 941, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hello_world/treeshaking_spec.ts" }
angular/packages/core/test/bundling/hello_world/BUILD.bazel_0_1355
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library") load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test") load("@npm//http-server:index.bzl", "http_server") package(default_visibility = ["//visibility:public"]) ng_module( name = "hello_world", srcs = ["index.ts"], deps = [ "//packages/core", "//packages/platform-browser", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":hello_world", "//packages/core", "//packages/platform-browser", "@npm//rxjs", ], ) ts_library( name = "test_lib", testonly = True, srcs = glob(["*_spec.ts"]), deps = [ "//packages:types", "//packages/compiler", "//packages/core/testing", "//packages/private/testing", "@npm//@bazel/runfiles", ], ) jasmine_node_test( name = "test", data = [ ":bundle", ":bundle.debug.min.js", ":bundle.js", ":bundle.min.js.br", ], deps = [":test_lib"], ) js_expected_symbol_test( name = "symbol_test", src = ":bundle.debug.min.js", golden = ":bundle.golden_symbols.json", ) http_server( name = "prodserver", data = [ "index.html", ":bundle.debug.min.js", ":bundle.min.js", ], )
{ "end_byte": 1355, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hello_world/BUILD.bazel" }
angular/packages/core/test/bundling/hello_world/index.ts_0_579
/** * @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, NgModule} from '@angular/core'; import {platformBrowser} from '@angular/platform-browser'; @Component({ selector: 'hello-world', template: 'Hello World!', standalone: false, }) export class HelloWorldComponent {} @NgModule({declarations: [HelloWorldComponent]}) export class HelloWorldModule {} platformBrowser().bootstrapModule(HelloWorldModule);
{ "end_byte": 579, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hello_world/index.ts" }
angular/packages/core/test/bundling/hydration/index.html_0_1228
<!DOCTYPE html> <html> <head> <title>Angular Hello World Example</title> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <hello-world></hello-world> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write('<script src="' + (document.location.search.endsWith('debug') ? '/bundle.debug.min.js' : '/bundle.min.js') + '"></' + 'script>'); </script> </body> </html>
{ "end_byte": 1228, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hydration/index.html" }
angular/packages/core/test/bundling/hydration/treeshaking_spec.ts_0_1057
/** * @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 '@angular/compiler'; import {runfiles} from '@bazel/runfiles'; import * as fs from 'fs'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/hydration'; describe('treeshaking with uglify', () => { let content: string; // We use the debug version as otherwise symbols/identifiers would be mangled (and the test would // always pass) const contentPath = runfiles.resolve(path.join(PACKAGE, 'bundle.debug.min.js')); beforeAll(() => { content = fs.readFileSync(contentPath, {encoding: 'utf-8'}); }); it('should drop unused TypeScript helpers', () => { expect(content).not.toContain('__asyncGenerator'); }); it('should not contain rxjs from commonjs distro', () => { expect(content).not.toContain('commonjsGlobal'); expect(content).not.toContain('createCommonjsModule'); }); });
{ "end_byte": 1057, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hydration/treeshaking_spec.ts" }
angular/packages/core/test/bundling/hydration/BUILD.bazel_0_1358
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library") load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test") load("@npm//http-server:index.bzl", "http_server") package(default_visibility = ["//visibility:public"]) ng_module( name = "hydration", srcs = ["index.ts"], deps = [ "//packages/core", "//packages/platform-browser", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":hydration", "//packages/core", "//packages/platform-browser", "@npm//rxjs", ], ) ts_library( name = "test_lib", testonly = True, srcs = glob(["*_spec.ts"]), deps = [ "//packages:types", "//packages/compiler", "//packages/core/testing", "//packages/private/testing", "@npm//@bazel/runfiles", ], ) jasmine_node_test( name = "test", data = [ ":bundle.debug.min.js", ":bundle.js", ":bundle.min.js", ":bundle.min.js.br", ], deps = [":test_lib"], ) js_expected_symbol_test( name = "symbol_test", src = ":bundle.debug.min.js", golden = ":bundle.golden_symbols.json", ) http_server( name = "prodserver", data = [ "index.html", ":bundle.debug.min.js", ":bundle.min.js", ], )
{ "end_byte": 1358, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hydration/BUILD.bazel" }
angular/packages/core/test/bundling/hydration/index.ts_0_521
/** * @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 {bootstrapApplication, provideClientHydration} from '@angular/platform-browser'; @Component({ standalone: true, selector: 'hello-world', template: 'Hello World!', }) class HelloWorld {} bootstrapApplication(HelloWorld, {providers: [provideClientHydration()]});
{ "end_byte": 521, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/hydration/index.ts" }
angular/packages/core/test/bundling/defer/index.html_0_1208
<!DOCTYPE html> <html> <head> <title>Defer Example</title> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <app-root></app-root> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write('<script src="' + (document.location.search.endsWith('debug') ? '/bundle.debug.min.js' : '/bundle.min.js') + '"></' + 'script>'); </script> </body> </html>
{ "end_byte": 1208, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/defer/index.html" }
angular/packages/core/test/bundling/defer/defer.component.ts_0_393
/** * @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'; @Component({ standalone: true, selector: 'defer-cmp', template: ` <h2>Defer-loaded component</h2> `, }) export class DeferComponent {}
{ "end_byte": 393, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/defer/defer.component.ts" }
angular/packages/core/test/bundling/defer/treeshaking_spec.ts_0_1053
/** * @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 '@angular/compiler'; import {runfiles} from '@bazel/runfiles'; import * as fs from 'fs'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/defer'; describe('treeshaking with uglify', () => { let content: string; // We use the debug version as otherwise symbols/identifiers would be mangled (and the test would // always pass) const contentPath = runfiles.resolve(path.join(PACKAGE, 'bundle.debug.min.js')); beforeAll(() => { content = fs.readFileSync(contentPath, {encoding: 'utf-8'}); }); it('should drop unused TypeScript helpers', () => { expect(content).not.toContain('__asyncGenerator'); }); it('should not contain rxjs from commonjs distro', () => { expect(content).not.toContain('commonjsGlobal'); expect(content).not.toContain('createCommonjsModule'); }); });
{ "end_byte": 1053, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/defer/treeshaking_spec.ts" }
angular/packages/core/test/bundling/defer/BUILD.bazel_0_1394
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library") load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test") load("@npm//http-server:index.bzl", "http_server") package(default_visibility = ["//visibility:public"]) ng_module( name = "defer", srcs = [ "defer.component.ts", "index.ts", ], deps = [ "//packages/core", "//packages/platform-browser", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":defer", "//packages/core", "//packages/platform-browser", "@npm//rxjs", ], ) ts_library( name = "test_lib", testonly = True, srcs = glob(["*_spec.ts"]), deps = [ "//packages:types", "//packages/compiler", "//packages/core/testing", "//packages/private/testing", "@npm//@bazel/runfiles", ], ) jasmine_node_test( name = "test", data = [ ":bundle.debug.min.js", ":bundle.js", ":bundle.min.js", ":bundle.min.js.br", ], deps = [":test_lib"], ) js_expected_symbol_test( name = "symbol_test", src = ":bundle.debug.min.js", golden = ":bundle.golden_symbols.json", ) http_server( name = "devserver", data = [ "index.html", ":bundle.debug.min.js", ":bundle.min.js", ], )
{ "end_byte": 1394, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/defer/BUILD.bazel" }
angular/packages/core/test/bundling/defer/index.ts_0_737
/** * @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 {bootstrapApplication} from '@angular/platform-browser'; import {DeferComponent} from './defer.component'; @Component({ standalone: true, selector: 'app-root', imports: [DeferComponent], template: ` <h1>Defer feature</h1> @defer (when isVisible) { <defer-cmp /> } @loading { loading } @placeholder { Placeholder } @error { Error } `, }) export class AppComponent { isVisible = true; } bootstrapApplication(AppComponent);
{ "end_byte": 737, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/defer/index.ts" }
angular/packages/core/test/bundling/standalone_bootstrap/index.html_0_1228
<!DOCTYPE html> <html> <head> <title>Angular Hello World Example</title> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <hello-world></hello-world> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write('<script src="' + (document.location.search.endsWith('debug') ? '/bundle.debug.min.js' : '/bundle.min.js') + '"></' + 'script>'); </script> </body> </html>
{ "end_byte": 1228, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/standalone_bootstrap/index.html" }
angular/packages/core/test/bundling/standalone_bootstrap/treeshaking_spec.ts_0_1068
/** * @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 '@angular/compiler'; import {runfiles} from '@bazel/runfiles'; import * as fs from 'fs'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/standalone_bootstrap'; describe('treeshaking with uglify', () => { let content: string; // We use the debug version as otherwise symbols/identifiers would be mangled (and the test would // always pass) const contentPath = runfiles.resolve(path.join(PACKAGE, 'bundle.debug.min.js')); beforeAll(() => { content = fs.readFileSync(contentPath, {encoding: 'utf-8'}); }); it('should drop unused TypeScript helpers', () => { expect(content).not.toContain('__asyncGenerator'); }); it('should not contain rxjs from commonjs distro', () => { expect(content).not.toContain('commonjsGlobal'); expect(content).not.toContain('createCommonjsModule'); }); });
{ "end_byte": 1068, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/standalone_bootstrap/treeshaking_spec.ts" }
angular/packages/core/test/bundling/standalone_bootstrap/BUILD.bazel_0_1379
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library") load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test") load("@npm//http-server:index.bzl", "http_server") package(default_visibility = ["//visibility:public"]) ng_module( name = "standalone_bootstrap", srcs = ["index.ts"], deps = [ "//packages/core", "//packages/platform-browser", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":standalone_bootstrap", "//packages/core", "//packages/platform-browser", "@npm//rxjs", ], ) ts_library( name = "test_lib", testonly = True, srcs = glob(["*_spec.ts"]), deps = [ "//packages:types", "//packages/compiler", "//packages/core/testing", "//packages/private/testing", "@npm//@bazel/runfiles", ], ) jasmine_node_test( name = "test", data = [ ":bundle.debug.min.js", ":bundle.js", ":bundle.min.js", ":bundle.min.js.br", ], deps = [":test_lib"], ) js_expected_symbol_test( name = "symbol_test", src = ":bundle.debug.min.js", golden = ":bundle.golden_symbols.json", ) http_server( name = "devserver", data = [ "index.html", ":bundle.debug.min.js", ":bundle.min.js", ], )
{ "end_byte": 1379, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/standalone_bootstrap/BUILD.bazel" }
angular/packages/core/test/bundling/standalone_bootstrap/index.ts_0_456
/** * @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 {bootstrapApplication} from '@angular/platform-browser'; @Component({ standalone: true, selector: 'hello-world', template: 'Hello World!', }) class HelloWorld {} bootstrapApplication(HelloWorld);
{ "end_byte": 456, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/standalone_bootstrap/index.ts" }
angular/packages/core/test/bundling/animation_world/animation_world.css_0_1104
html, body { padding:0; margin:0; font-family: Verdana; } animation-world { display:block; margin: 0 auto; max-width:1000px; border:2px solid black; } animation-world nav { padding:1em; border-bottom:2px solid black; background:#eee; } animation-world .list { display:grid; grid-template-columns: 33% 33% 34%; grid-template-rows: 33% 33% 34%; height:1000px; } animation-world .record { line-height:333px; text-align:center; font-weight: bold; font-size:50px; vertical-align: middle; } .record-1 { color:white; background: green;} .record-2 { color:white; background: red;} .record-3 { color:white; background: blue;} .record-4 { color:white; background: orange;} .record-5 { color:white; background: purple;} .record-6 { color:white; background: black;} .record-7 { color:white; background: silver;} .record-8 { color:white; background: teal;} .record-9 { color:white; background: pink;} @keyframes fadeInOut { from { opacity: 0; background: white; } 33% { opacity: 1; background: black; } 66% { opacity: 0.5; background: black; } 100% { opacity: 1 } }
{ "end_byte": 1104, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/animation_world/animation_world.css" }
angular/packages/core/test/bundling/animation_world/index.html_0_1411
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="base.css" /> <link rel="stylesheet" href="animation_world.css" /> <title>Angular Hello World Example</title> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <animation-world></animation-world> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write( '<script src="' + (document.location.search.endsWith('debug') ? '/bundle.debug.min.js' : '/bundle.min.js.br') + '"></' + 'script>' ); </script> </body> </html>
{ "end_byte": 1411, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/animation_world/index.html" }
angular/packages/core/test/bundling/animation_world/BUILD.bazel_0_653
load("//tools:defaults.bzl", "app_bundle", "http_server", "ng_module") package(default_visibility = ["//visibility:public"]) ng_module( name = "animation_world", srcs = ["index.ts"], deps = [ "//packages/core", "//packages/platform-browser", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":animation_world", "//packages/core", "@npm//rxjs", ], ) http_server( name = "server", srcs = [ "animation_world.css", "base.css", "index.html", ], deps = [ ":bundle.debug.min", ":bundle.min.js.br", ], )
{ "end_byte": 653, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/animation_world/BUILD.bazel" }
angular/packages/core/test/bundling/animation_world/index.ts_0_3767
/** * @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 { ApplicationRef, ChangeDetectorRef, Component, Directive, ElementRef, HostBinding, HostListener, NgModule, } from '@angular/core'; import {BrowserModule, platformBrowser} from '@angular/platform-browser'; @Directive({ selector: '[make-color-grey]', exportAs: 'makeColorGrey', host: {'style': 'font-family: Times New Roman;'}, standalone: false, }) class MakeColorGreyDirective { @HostBinding('style.background-color') private _backgroundColor: string | null = null; @HostBinding('style.color') private _textColor: string | null = null; on() { this._backgroundColor = 'grey'; this._textColor = 'black'; } off() { this._backgroundColor = null; this._textColor = null; } toggle() { this._backgroundColor ? this.off() : this.on(); } } @Component({ selector: 'box-with-overridden-styles', template: '...', standalone: false, }) class BoxWithOverriddenStylesComponent { public active = false; @HostBinding('style') styles = {}; constructor(private readonly cdr: ChangeDetectorRef) { this.onInActive(); } @HostListener('click', ['$event']) toggle() { if (this.active) { this.onInActive(); } else { this.onActive(); } this.cdr.detectChanges(); } onActive() { this.active = true; this.styles = {height: '500px', 'font-size': '200px', background: 'red'}; } onInActive() { this.active = false; this.styles = {width: '200px', height: '500px', border: '10px solid black', background: 'grey'}; } } @Component({ selector: 'animation-world', template: ` <div class="list"> <div #makeColorGrey="makeColorGrey" make-color-grey *ngFor="let item of items" class="record" [style.transform]="item.active ? 'scale(1.5)' : 'none'" [class]="makeClass(item)" style="border-radius: 10px" [style]="styles" [style.color]="item.value == 4 ? 'red' : null" [style.background-color]="item.value == 4 ? 'white' : null" (click)="toggleActive(item, makeColorGrey)"> {{ item.value }} </div> </div> <hr> <box-with-overridden-styles style="display:block" [style]="{'border-radius':'50px', 'border': '50px solid teal'}" [ngStyle]="{transform:'rotate(50deg)'}"> </box-with-overridden-styles> `, standalone: false, }) class AnimationWorldComponent { @HostBinding('class') classVal = 'border'; items: any[] = [ {value: 1, active: false}, {value: 2, active: false}, {value: 3, active: false}, {value: 4, active: false}, {value: 5, active: false}, {value: 6, active: false}, {value: 7, active: false}, {value: 8, active: false}, {value: 9, active: false}, ]; private _hostElement: HTMLElement; public styles: {[key: string]: any} | null = null; constructor( element: ElementRef, private readonly cdr: ChangeDetectorRef, ) { this._hostElement = element.nativeElement; } makeClass(item: any) { return `record-${item.value}`; } toggleActive(item: any, makeColorGrey: MakeColorGreyDirective) { item.active = !item.active; makeColorGrey.toggle(); this.cdr.detectChanges(); } } @NgModule({ declarations: [AnimationWorldComponent, MakeColorGreyDirective, BoxWithOverriddenStylesComponent], imports: [BrowserModule], }) class AnimationWorldModule { ngDoBootstrap(app: ApplicationRef) { app.bootstrap(AnimationWorldComponent); } } platformBrowser().bootstrapModule(AnimationWorldModule, {ngZone: 'noop'});
{ "end_byte": 3767, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/animation_world/index.ts" }
angular/packages/core/test/bundling/animation_world/base.css_0_1877
hr { margin: 20px 0; border: 0; border-top: 1px dashed #c5c5c5; border-bottom: 1px dashed #f7f7f7; } .learn a { font-weight: normal; text-decoration: none; color: #b83f45; } .learn a:hover { text-decoration: underline; color: #787e7e; } .learn h3, .learn h4, .learn h5 { margin: 10px 0; font-weight: 500; line-height: 1.2; color: #000; } .learn h3 { font-size: 24px; } .learn h4 { font-size: 18px; } .learn h5 { margin-bottom: 0; font-size: 14px; } .learn ul { padding: 0; margin: 0 0 30px 25px; } .learn li { line-height: 20px; } .learn p { font-size: 15px; font-weight: 300; line-height: 1.3; margin-top: 0; margin-bottom: 0; } #issue-count { display: none; } .quote { border: none; margin: 20px 0 60px 0; } .quote p { font-style: italic; } .quote p:before { content: '“'; font-size: 50px; opacity: .15; position: absolute; top: -20px; left: 3px; } .quote p:after { content: '”'; font-size: 50px; opacity: .15; position: absolute; bottom: -42px; right: 3px; } .quote footer { position: absolute; bottom: -40px; right: 0; } .quote footer img { border-radius: 3px; } .quote footer a { margin-left: 5px; vertical-align: middle; } .speech-bubble { position: relative; padding: 10px; background: rgba(0, 0, 0, .04); border-radius: 5px; } .speech-bubble:after { content: ''; position: absolute; top: 100%; right: 30px; border: 13px solid transparent; border-top-color: rgba(0, 0, 0, .04); } .learn-bar > .learn { position: absolute; width: 272px; top: 8px; left: -300px; padding: 10px; border-radius: 5px; background-color: rgba(255, 255, 255, .6); transition-property: left; transition-duration: 500ms; } @media (min-width: 899px) { .learn-bar { width: auto; padding-left: 300px; } .learn-bar > .learn { left: 8px; } } .border { outline:2px solid maroon; display:block; }
{ "end_byte": 1877, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/animation_world/base.css" }
angular/packages/core/test/bundling/forms_reactive/index.html_0_1226
<!DOCTYPE html> <html> <head> <title>Angular Reactive Forms Example</title> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <app-root></app-root> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write('<script src="' + (document.location.search.endsWith('debug') ? '/bundle.debug.min.js' : '/bundle.min.js') + '"></' + 'script>'); </script> </body> </html>
{ "end_byte": 1226, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/forms_reactive/index.html" }
angular/packages/core/test/bundling/forms_reactive/forms_e2e_spec.ts_0_1804
/** * @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 '@angular/compiler'; import {withBody} from '@angular/private/testing'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/forms_reactive'; const BUNDLES = ['bundle.js', 'bundle.debug.min.js', 'bundle.min.js']; describe('functional test for reactive forms', () => { BUNDLES.forEach((bundle) => { describe(`using ${bundle} bundle`, () => { it( 'should render template form', withBody('<app-root></app-root>', async () => { // load the bundle await import(path.join(PACKAGE, bundle)); // the bundle attaches the following fields to the `window` global. const {bootstrapApp} = window as any; await bootstrapApp(); // Reactive forms const reactiveFormsComponent = (window as any).reactiveFormsComponent; const reactiveForm = document.querySelector('app-reactive-forms')!; // Check for inputs const inputs = reactiveForm.querySelectorAll('input'); expect(inputs.length).toBe(5); // Check for button const reactiveButtons = reactiveForm.querySelectorAll('button'); expect(reactiveButtons.length).toBe(1); expect(reactiveButtons[0]).toBeDefined(); // Make sure button click works const reactiveFormSpy = spyOn(reactiveFormsComponent, 'addCity').and.callThrough(); reactiveButtons[0].click(); expect(reactiveFormSpy).toHaveBeenCalled(); expect(reactiveFormsComponent.addresses.length).toBe(2); }), ); }); }); });
{ "end_byte": 1804, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/forms_reactive/forms_e2e_spec.ts" }
angular/packages/core/test/bundling/forms_reactive/treeshaking_spec.ts_0_1062
/** * @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 '@angular/compiler'; import {runfiles} from '@bazel/runfiles'; import * as fs from 'fs'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/forms_reactive'; describe('treeshaking with uglify', () => { let content: string; // We use the debug version as otherwise symbols/identifiers would be mangled (and the test would // always pass) const contentPath = runfiles.resolve(path.join(PACKAGE, 'bundle.debug.min.js')); beforeAll(() => { content = fs.readFileSync(contentPath, {encoding: 'utf-8'}); }); it('should drop unused TypeScript helpers', () => { expect(content).not.toContain('__asyncGenerator'); }); it('should not contain rxjs from commonjs distro', () => { expect(content).not.toContain('commonjsGlobal'); expect(content).not.toContain('createCommonjsModule'); }); });
{ "end_byte": 1062, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/forms_reactive/treeshaking_spec.ts" }
angular/packages/core/test/bundling/forms_reactive/BUILD.bazel_0_1451
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library") load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test") load("@npm//http-server:index.bzl", "http_server") package(default_visibility = ["//visibility:public"]) ng_module( name = "forms_reactive", srcs = ["index.ts"], deps = [ "//packages/core", "//packages/forms", "//packages/platform-browser", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":forms_reactive", "//packages/core", "//packages/forms", "//packages/platform-browser", "@npm//rxjs", ], ) ts_library( name = "test_lib", testonly = True, srcs = glob(["*_spec.ts"]), deps = [ "//packages:types", "//packages/compiler", "//packages/core", "//packages/core/testing", "//packages/private/testing", "@npm//@bazel/runfiles", ], ) jasmine_node_test( name = "test", data = [ ":bundle.debug.min.js", ":bundle.js", ":bundle.min.js", ":bundle.min.js.br", ], deps = [":test_lib"], ) js_expected_symbol_test( name = "symbol_test", src = ":bundle.debug.min.js", golden = ":bundle.golden_symbols.json", ) http_server( name = "prodserver", data = [ "index.html", ":bundle.debug.min.js", ":bundle.min.js", ], )
{ "end_byte": 1451, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/forms_reactive/BUILD.bazel" }
angular/packages/core/test/bundling/forms_reactive/index.ts_0_2647
/** * @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, NgModule} from '@angular/core'; import { FormArray, FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators, } from '@angular/forms'; import {BrowserModule, platformBrowser} from '@angular/platform-browser'; @Component({ selector: 'app-reactive-forms', template: ` <form [formGroup]="profileForm"> <div> First Name: <input type="text" formControlName="firstName" /> </div> <div> Last Name: <input type="text" formControlName="lastName" /> </div> <div> Subscribe: <input type="checkbox" formControlName="subscribed" /> </div> <div>Disabled: <input formControlName="disabledInput" /></div> <div formArrayName="addresses"> <div *ngFor="let item of itemControls; let i = index" [formGroupName]="i"> <div>City: <input formControlName="city" /></div> </div> </div> <button (click)="addCity()">Add City</button> </form> `, standalone: false, }) class ReactiveFormsComponent { profileForm!: FormGroup; addresses!: FormArray; get itemControls() { return (this.profileForm.get('addresses') as FormArray).controls; } constructor(private formBuilder: FormBuilder) { // We use this reference in our test (window as any).reactiveFormsComponent = this; } ngOnInit() { this.profileForm = new FormGroup({ firstName: new FormControl('', Validators.required), lastName: new FormControl(''), addresses: new FormArray([]), subscribed: new FormControl(), disabledInput: new FormControl({value: '', disabled: true}), }); this.addCity(); } createItem(): FormGroup { return this.formBuilder.group({ city: '', }); } addCity(): void { this.addresses = this.profileForm.get('addresses') as FormArray; this.addresses.push(this.createItem()); } } @Component({ selector: 'app-root', template: ` <app-reactive-forms></app-reactive-forms> `, standalone: false, }) class RootComponent {} @NgModule({ declarations: [RootComponent, ReactiveFormsComponent], imports: [BrowserModule, ReactiveFormsModule], }) class FormsExampleModule { ngDoBootstrap(app: any) { app.bootstrap(RootComponent); } } function bootstrapApp() { return platformBrowser().bootstrapModule(FormsExampleModule, {ngZone: 'noop'}); } (window as any).bootstrapApp = bootstrapApp;
{ "end_byte": 2647, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/forms_reactive/index.ts" }
angular/packages/core/test/bundling/todo/todo.css_0_6124
html, body { margin: 0; padding: 0; } button { margin: 0; padding: 0; border: 0; background: none; font-size: 100%; vertical-align: baseline; font-family: inherit; font-weight: inherit; color: inherit; -webkit-appearance: none; appearance: none; } body { font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 1.4em; background: #f5f5f5; color: #4d4d4d; min-width: 230px; max-width: 550px; margin: 0 auto; font-weight: 300; } button, input[type="checkbox"] { outline: none; } .hidden { display: none; } .todoapp { background: #fff; margin: 130px 0 40px 0; position: relative; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1); } .todoapp input::-webkit-input-placeholder { font-style: italic; font-weight: 300; color: #e6e6e6; } .todoapp input::-moz-placeholder { font-style: italic; font-weight: 300; color: #e6e6e6; } .todoapp input::input-placeholder { font-style: italic; font-weight: 300; color: #e6e6e6; } .todoapp h1 { position: absolute; top: -155px; width: 100%; font-size: 100px; font-weight: 100; text-align: center; color: rgba(175, 47, 47, 0.15); -webkit-text-rendering: optimizeLegibility; -moz-text-rendering: optimizeLegibility; text-rendering: optimizeLegibility; } .new-todo, .edit { position: relative; margin: 0; width: 100%; font-size: 24px; font-family: inherit; font-weight: inherit; line-height: 1.4em; border: 0; outline: none; color: inherit; padding: 6px; border: 1px solid #999; box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2); box-sizing: border-box; } .new-todo { padding: 16px 16px 16px 60px; border: none; background: rgba(0, 0, 0, 0.003); box-shadow: inset 0 -2px 1px rgba(0,0,0,0.03); } .main { position: relative; z-index: 2; border-top: 1px solid #e6e6e6; } label[for='toggle-all'] { display: none; } .toggle-all { position: absolute; top: -55px; left: -12px; width: 60px; height: 34px; text-align: center; border: none; /* Mobile Safari */ } .toggle-all:before { content: '❯'; font-size: 22px; color: #e6e6e6; padding: 10px 27px 10px 27px; } .toggle-all:checked:before { color: #737373; } .todo-list { margin: 0; padding: 0; list-style: none; } .todo-list li { position: relative; font-size: 24px; border-bottom: 1px solid #ededed; } .todo-list li:last-child { border-bottom: none; } .todo-list li.editing { border-bottom: none; padding: 0; } .todo-list li.editing .edit { display: block; width: 506px; padding: 13px 17px 12px 17px; margin: 0 0 0 43px; } .todo-list li.editing .view { display: none; } .todo-list li .toggle { text-align: center; width: 40px; /* auto, since non-WebKit browsers doesn't support input styling */ height: auto; position: absolute; top: 0; bottom: 0; margin: auto 0; border: none; /* Mobile Safari */ -webkit-appearance: none; appearance: none; } .todo-list li .toggle:after { content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#ededed" stroke-width="3"/></svg>'); } .todo-list li .toggle:checked:after { content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#bddad5" stroke-width="3"/><path fill="#5dc2af" d="M72 25L42 71 27 56l-4 4 20 20 34-52z"/></svg>'); } .todo-list li label { white-space: pre-line; word-break: break-all; padding: 15px 60px 15px 15px; margin-left: 45px; display: block; line-height: 1.2; transition: color 0.4s; } .todo-list li .destroy { display: none; position: absolute; top: 0; right: 10px; bottom: 0; width: 40px; height: 40px; margin: auto 0; font-size: 30px; color: #cc9a9a; margin-bottom: 11px; transition: color 0.2s ease-out; } .todo-list li .destroy:hover { color: #af5b5e; } .todo-list li .destroy:after { content: '×'; } .todo-list li:hover .destroy { display: block; } .todo-list li .edit { display: none; } .todo-list li.editing:last-child { margin-bottom: -1px; } .footer { color: #777; padding: 10px 15px; height: 20px; text-align: center; border-top: 1px solid #e6e6e6; } .footer:before { content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 50px; overflow: hidden; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 8px 0 -3px #f6f6f6, 0 9px 1px -3px rgba(0, 0, 0, 0.2), 0 16px 0 -6px #f6f6f6, 0 17px 2px -6px rgba(0, 0, 0, 0.2); } .todo-count { float: left; text-align: left; } .todo-count strong { font-weight: 300; } .filters { margin: 0; padding: 0; list-style: none; position: absolute; right: 0; left: 0; } .filters li { display: inline; } .filters li a { color: inherit; margin: 3px; padding: 3px 7px; text-decoration: none; border: 1px solid transparent; border-radius: 3px; } .filters li a.selected, .filters li a:hover { border-color: rgba(175, 47, 47, 0.1); } .filters li a.selected { border-color: rgba(175, 47, 47, 0.2); } .clear-completed, html .clear-completed:active { float: right; position: relative; line-height: 20px; text-decoration: none; cursor: pointer; } .clear-completed:hover { text-decoration: underline; } .info { margin: 65px auto 0; color: #bfbfbf; font-size: 10px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); text-align: center; } .info p { line-height: 1; } .info a { color: inherit; text-decoration: none; font-weight: 400; } .info a:hover { text-decoration: underline; } /* Hack to remove background from Mobile Safari. Can't use it globally since it destroys checkboxes in Firefox */ @media screen and (-webkit-min-device-pixel-ratio:0) { .toggle-all, .todo-list li .toggle { background: none; } .todo-list li .toggle { height: 40px; } .toggle-all { -webkit-transform: rotate(90deg); transform: rotate(90deg); -webkit-appearance: none; appearance: none; } } @media (max-width: 430px) { .footer { height: 50px; } .filters { bottom: 10px; } }
{ "end_byte": 6124, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo/todo.css" }
angular/packages/core/test/bundling/todo/index.html_0_1494
<!DOCTYPE html> <html> <head> <title>Angular Todo Example</title> <link rel="stylesheet" href="base.css" /> <link rel="stylesheet" href="todo.css" /> <style> .done { text-decoration: line-through; } </style> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <todo-app></todo-app> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write( '<script src="' + (document.location.search.endsWith('debug') ? '/bundle.debug.min.js' : '/bundle.min.js.br') + '"></' + 'script>' ); </script> <script> bootstrapApp(); </script> </body> </html>
{ "end_byte": 1494, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo/index.html" }
angular/packages/core/test/bundling/todo/BUILD.bazel_0_1592
load("//tools:defaults.bzl", "app_bundle", "http_server", "jasmine_node_test", "ng_module", "ts_library") load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test") package(default_visibility = ["//visibility:public"]) ng_module( name = "todo", srcs = ["index.ts"], deps = [ "//packages/common", "//packages/core", "//packages/platform-browser", "//packages/platform-browser-dynamic", ], ) app_bundle( name = "bundle", entry_point = "index.ts", deps = [ ":todo", "//packages/common", "//packages/core", "//packages/platform-browser", "//packages/platform-browser-dynamic", "@npm//rxjs", ], ) ts_library( name = "test_lib", testonly = True, srcs = glob(["*_spec.ts"]), deps = [ "//packages:types", "//packages/compiler", "//packages/core", "//packages/core/testing", "//packages/platform-browser", "//packages/platform-browser-dynamic", "//packages/private/testing", ], ) jasmine_node_test( name = "test", data = [ ":bundle", ":bundle.debug.min.js", ":bundle.js", ":bundle.min.js", ], deps = [":test_lib"], ) js_expected_symbol_test( name = "symbol_test", src = ":bundle.debug.min.js", golden = ":bundle.golden_symbols.json", ) http_server( name = "server", srcs = [ "base.css", "index.html", "todo.css", ], deps = [ ":bundle.debug.min.js", ":bundle.min.js.br", ], )
{ "end_byte": 1592, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo/BUILD.bazel" }
angular/packages/core/test/bundling/todo/index.ts_0_5324
/** * @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 {CommonModule} from '@angular/common'; import {Component, Injectable, NgModule} from '@angular/core'; import {BrowserModule, platformBrowser} from '@angular/platform-browser'; class Todo { editing: boolean; private _title!: string; get title() { return this._title; } set title(value: string) { this._title = value.trim(); } constructor( title: string, public completed: boolean = false, ) { this.editing = false; this.title = title; } } @Injectable({providedIn: 'root'}) class TodoStore { todos: Array<Todo> = [ new Todo('Demonstrate Components'), new Todo('Demonstrate Structural Directives', true), new Todo('Demonstrate NgModules'), new Todo('Demonstrate zoneless change detection'), new Todo('Demonstrate internationalization'), ]; private getWithCompleted(completed: boolean) { return this.todos.filter((todo: Todo) => todo.completed === completed); } allCompleted() { return this.todos.length === this.getCompleted().length; } setAllTo(completed: boolean) { this.todos.forEach((t: Todo) => (t.completed = completed)); } removeCompleted() { this.todos = this.getWithCompleted(false); } getRemaining() { return this.getWithCompleted(false); } getCompleted() { return this.getWithCompleted(true); } toggleCompletion(todo: Todo) { todo.completed = !todo.completed; } remove(todo: Todo) { this.todos.splice(this.todos.indexOf(todo), 1); } add(title: string) { this.todos.push(new Todo(title)); } } @Component({ selector: 'todo-app', // TODO(misko): make this work with `[(ngModel)]` styles: [ ` .todo-list li.completed label { color: #d9d9d9; text-decoration: line-through; font-weight:bold; } `, ], template: ` <section class="todoapp"> <header class="header"> <h1>todos</h1> <input class="new-todo" placeholder="What needs to be done?" autofocus="" [value]="newTodoText" (keyup)="$event.code == 'Enter' ? addTodo() : newTodoText = $event.target.value"> </header> <section *ngIf="todoStore.todos.length > 0" class="main"> <input *ngIf="todoStore.todos.length" #toggleall class="toggle-all" type="checkbox" [checked]="todoStore.allCompleted()" (click)="todoStore.setAllTo(toggleall.checked)"> <ul class="todo-list"> <li *ngFor="let todo of todoStore.todos" [class.completed]="todo.completed" [class.editing]="todo.editing"> <div class="view"> <input class="toggle" type="checkbox" (click)="toggleCompletion(todo)" [checked]="todo.completed"> <label (dblclick)="editTodo(todo)">{{todo.title}}</label> <button class="destroy" (click)="remove(todo)"></button> </div> <input *ngIf="todo.editing" class="edit" #editedtodo [value]="todo.title" (blur)="stopEditing(todo, editedtodo.value)" (keyup)="todo.title = $event.target.value" (keyup)="$event.code == 'Enter' && updateEditingTodo(todo, editedtodo.value)" (keyup)="$event.code == 'Escape' && cancelEditingTodo(todo)"> </li> </ul> </section> <footer *ngIf="todoStore.todos.length > 0" class="footer"> <span class="todo-count"> <strong>{{todoStore.getRemaining().length}}</strong> {{todoStore.getRemaining().length == 1 ? 'item' : 'items'}} left </span> <button *ngIf="todoStore.getCompleted().length > 0" class="clear-completed" (click)="removeCompleted()"> Clear completed </button> </footer> </section> `, standalone: false, }) class ToDoAppComponent { newTodoText = ''; constructor(public todoStore: TodoStore) { (window as any).toDoAppComponent = this; } stopEditing(todo: Todo, editedTitle: string) { todo.title = editedTitle; todo.editing = false; } cancelEditingTodo(todo: Todo) { todo.editing = false; } updateEditingTodo(todo: Todo, editedTitle: string) { editedTitle = editedTitle.trim(); todo.editing = false; if (editedTitle.length === 0) { return this.todoStore.remove(todo); } todo.title = editedTitle; } editTodo(todo: Todo) { todo.editing = true; } removeCompleted() { this.todoStore.removeCompleted(); } toggleCompletion(todo: Todo) { this.todoStore.toggleCompletion(todo); } remove(todo: Todo) { this.todoStore.remove(todo); } addTodo() { if (this.newTodoText.trim().length) { this.todoStore.add(this.newTodoText); this.newTodoText = ''; } } } @NgModule({declarations: [ToDoAppComponent], imports: [CommonModule, BrowserModule]}) class ToDoAppModule { ngDoBootstrap(app: any) { app.bootstrap(ToDoAppComponent); } } function bootstrapApp() { return platformBrowser().bootstrapModule(ToDoAppModule, {ngZone: 'noop'}); } (window as any).bootstrapApp = bootstrapApp;
{ "end_byte": 5324, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo/index.ts" }
angular/packages/core/test/bundling/todo/todo_e2e_spec.ts_0_1703
/** * @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 '@angular/compiler'; import {withBody} from '@angular/private/testing'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/todo'; const BUNDLES = ['bundle.js', 'bundle.debug.min.js', 'bundle.min.js']; describe('functional test for todo', () => { BUNDLES.forEach((bundle) => { describe(bundle, () => { it( 'should place styles on the elements within the component', withBody('<todo-app></todo-app>', async () => { // load the bundle await import(path.join(PACKAGE, bundle)); // the bundle attaches the following fields to the `window` global. const {bootstrapApp} = window as any; await bootstrapApp(); const styleContent = findStyleTextForSelector('.todo-list\\[_ngcontent-[a-z]+-\\w+\\]'); expect(styleContent).toMatch(/font-weight:\s*bold;/); expect(styleContent).toMatch(/color:\s*#d9d9d9;/); }), ); }); }); }); function findStyleTextForSelector(selector: string): string { const styles = document.querySelectorAll('head style'); const matchExp = new RegExp(`${selector}.+?\\\{([\\s\\S]+)\\\}`, 'm'); for (let i = 0; i < styles.length; i++) { const styleElement = styles[i]; const content = styleElement.textContent || ''; const result = matchExp.exec(content); if (result && result.length > 1) { return result[1]; } } throw new Error(`The CSS Style Rule ${selector} was not found`); }
{ "end_byte": 1703, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo/todo_e2e_spec.ts" }
angular/packages/core/test/bundling/todo/base.css_0_1817
hr { margin: 20px 0; border: 0; border-top: 1px dashed #c5c5c5; border-bottom: 1px dashed #f7f7f7; } .learn a { font-weight: normal; text-decoration: none; color: #b83f45; } .learn a:hover { text-decoration: underline; color: #787e7e; } .learn h3, .learn h4, .learn h5 { margin: 10px 0; font-weight: 500; line-height: 1.2; color: #000; } .learn h3 { font-size: 24px; } .learn h4 { font-size: 18px; } .learn h5 { margin-bottom: 0; font-size: 14px; } .learn ul { padding: 0; margin: 0 0 30px 25px; } .learn li { line-height: 20px; } .learn p { font-size: 15px; font-weight: 300; line-height: 1.3; margin-top: 0; margin-bottom: 0; } #issue-count { display: none; } .quote { border: none; margin: 20px 0 60px 0; } .quote p { font-style: italic; } .quote p:before { content: '“'; font-size: 50px; opacity: .15; position: absolute; top: -20px; left: 3px; } .quote p:after { content: '”'; font-size: 50px; opacity: .15; position: absolute; bottom: -42px; right: 3px; } .quote footer { position: absolute; bottom: -40px; right: 0; } .quote footer img { border-radius: 3px; } .quote footer a { margin-left: 5px; vertical-align: middle; } .speech-bubble { position: relative; padding: 10px; background: rgba(0, 0, 0, .04); border-radius: 5px; } .speech-bubble:after { content: ''; position: absolute; top: 100%; right: 30px; border: 13px solid transparent; border-top-color: rgba(0, 0, 0, .04); } .learn-bar > .learn { position: absolute; width: 272px; top: 8px; left: -300px; padding: 10px; border-radius: 5px; background-color: rgba(255, 255, 255, .6); transition-property: left; transition-duration: 500ms; } @media (min-width: 899px) { .learn-bar { width: auto; padding-left: 300px; } .learn-bar > .learn { left: 8px; } }
{ "end_byte": 1817, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/todo/base.css" }
angular/packages/core/test/bundling/image-directive/index.html_0_349
<!DOCTYPE html> <html> <head> <title>Image Directive Example</title> <base href="/"> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <app-root></app-root> <script src="angular/packages/zone.js/bundles/zone.umd.js"></script> <script src="bundle.js"></script> </body> </html>
{ "end_byte": 349, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/index.html" }
angular/packages/core/test/bundling/image-directive/README.md_0_475
* NgOptimizedImage directive testing This folder contains a simple application that can be used as a playground for the `NgOptimizedImage` directive testing. You can run the following command to start the dev server: ``` yarn ibazel run packages/core/test/bundling/image-directive:devserver ``` There is also a set of e2e tests (powered by Protractor), which can be invoked by running: ``` yarn bazel test packages/core/test/bundling/image-directive:protractor_tests ```
{ "end_byte": 475, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/README.md" }
angular/packages/core/test/bundling/image-directive/BUILD.bazel_0_2157
load("//tools:defaults.bzl", "esbuild", "http_server", "ng_module", "protractor_web_test_suite", "ts_library") package(default_visibility = ["//visibility:public"]) ng_module( name = "image-directive", srcs = [ "e2e/basic/basic.ts", "e2e/fill-mode/fill-mode.ts", "e2e/image-distortion/image-distortion.ts", "e2e/image-perf-warnings-lazy/image-perf-warnings-lazy.ts", "e2e/image-perf-warnings-oversized/image-perf-warnings-oversized.ts", "e2e/image-perf-warnings-oversized/svg-no-perf-oversized-warnings.ts", "e2e/lcp-check/lcp-check.ts", "e2e/oversized-image/oversized-image.ts", "e2e/preconnect-check/preconnect-check.ts", "index.ts", "playground.ts", ], deps = [ "//packages/common", "//packages/core", "//packages/platform-browser", "//packages/router", ], ) # Note: Cannot use `app_bundle` as the e2e tests rely on `ngDevMode` # output which would otherwise be omitted. esbuild( name = "bundle", entry_point = ":index.ts", deps = [ ":image-directive", "//packages/common", "//packages/core", "//packages/platform-browser", "//packages/router", "@npm//rxjs", ], ) http_server( name = "devserver", srcs = [ "e2e/a.png", "e2e/b.png", "e2e/logo-1500w.jpg", "e2e/logo-1500w.svg", "e2e/logo-500w.jpg", "e2e/white-607x3.png", "index.html", ], deps = [ ":bundle", "//packages/zone.js/bundles:zone.umd.js", ], ) ts_library( name = "img_dir_e2e_tests_lib", testonly = True, srcs = ["e2e/browser-logs-util.ts"] + glob([ "e2e/**/*.e2e-spec.ts", ]), tsconfig = ":e2e/tsconfig-e2e.json", deps = [ "//packages/private/testing", "@npm//@types/selenium-webdriver", "@npm//protractor", ], ) protractor_web_test_suite( name = "protractor_tests", on_prepare = ":e2e/start-server.js", server = ":devserver", deps = [ ":img_dir_e2e_tests_lib", "@npm//selenium-webdriver", ], )
{ "end_byte": 2157, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/BUILD.bazel" }
angular/packages/core/test/bundling/image-directive/index.ts_0_2777
/** * @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, importProvidersFrom} from '@angular/core'; import {bootstrapApplication, provideProtractorTestingSupport} from '@angular/platform-browser'; import {RouterModule} from '@angular/router'; import {BasicComponent} from './e2e/basic/basic'; import {FillModeFailingComponent, FillModePassingComponent} from './e2e/fill-mode/fill-mode'; import { ImageDistortionFailingComponent, ImageDistortionPassingComponent, } from './e2e/image-distortion/image-distortion'; import {ImagePerfWarningsLazyComponent} from './e2e/image-perf-warnings-lazy/image-perf-warnings-lazy'; import {ImagePerfWarningsOversizedComponent} from './e2e/image-perf-warnings-oversized/image-perf-warnings-oversized'; import {SvgNoOversizedPerfWarningsComponent} from './e2e/image-perf-warnings-oversized/svg-no-perf-oversized-warnings'; import {LcpCheckComponent} from './e2e/lcp-check/lcp-check'; import { OversizedImageComponentFailing, OversizedImageComponentPassing, } from './e2e/oversized-image/oversized-image'; import {PreconnectCheckComponent} from './e2e/preconnect-check/preconnect-check'; import {PlaygroundComponent} from './playground'; @Component({ selector: 'app-root', standalone: true, imports: [RouterModule], template: '<router-outlet></router-outlet>', }) export class RootComponent {} const ROUTES = [ // Paths that contain components for test/demo purposes: {path: '', component: PlaygroundComponent}, // Paths below are used for e2e testing: {path: 'e2e/basic', component: BasicComponent}, {path: 'e2e/lcp-check', component: LcpCheckComponent}, {path: 'e2e/image-perf-warnings-lazy', component: ImagePerfWarningsLazyComponent}, {path: 'e2e/image-perf-warnings-oversized', component: ImagePerfWarningsOversizedComponent}, {path: 'e2e/svg-no-perf-oversized-warnings', component: SvgNoOversizedPerfWarningsComponent}, {path: 'e2e/preconnect-check', component: PreconnectCheckComponent}, {path: 'e2e/image-distortion-passing', component: ImageDistortionPassingComponent}, {path: 'e2e/image-distortion-failing', component: ImageDistortionFailingComponent}, {path: 'e2e/oversized-image-passing', component: OversizedImageComponentPassing}, {path: 'e2e/oversized-image-failing', component: OversizedImageComponentFailing}, {path: 'e2e/fill-mode-passing', component: FillModePassingComponent}, {path: 'e2e/fill-mode-failing', component: FillModeFailingComponent}, ]; bootstrapApplication(RootComponent, { providers: [ provideProtractorTestingSupport(), // importProvidersFrom(RouterModule.forRoot(ROUTES)), ], });
{ "end_byte": 2777, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/index.ts" }
angular/packages/core/test/bundling/image-directive/playground.ts_0_1099
/** * @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 {NgOptimizedImage, provideImgixLoader} from '@angular/common'; import {Component} from '@angular/core'; @Component({ selector: 'basic', styles: [ ` h1 { display: flex; align-items: center; } main { border: 1px solid blue; margin: 16px; padding: 16px; } .spacer { height: 3000px; } main img { width: 100%; height: auto; } `, ], template: ` <h1> <img ngSrc="a.png" width="50" height="50" priority ngSrcset="1x, 2x"> <span>Angular image app</span> </h1> <main> <div class="spacer"></div> <img ngSrc="hermes2.jpeg" ngSrcset="100w, 200w, 1000w, 2000w" width="1791" height="1008"> </main> `, standalone: true, imports: [NgOptimizedImage], providers: [provideImgixLoader('https://aurora-project.imgix.net')], }) export class PlaygroundComponent {}
{ "end_byte": 1099, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/playground.ts" }
angular/packages/core/test/bundling/image-directive/e2e/browser-logs-util.ts_0_1139
/** * @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 */ /* tslint:disable:no-console */ import {browser} from 'protractor'; import {logging} from 'selenium-webdriver'; export async function collectBrowserLogs( loggingLevel: logging.Level, collectMoreSevereErrors: boolean = false, ): Promise<logging.Entry[]> { const browserLog = await browser.manage().logs().get('browser'); const collectedLogs: logging.Entry[] = []; browserLog.forEach((logEntry) => { const msg = logEntry.message; console.log('>> ' + msg, logEntry); if ( (!collectMoreSevereErrors && logEntry.level.value === loggingLevel.value) || (collectMoreSevereErrors && logEntry.level.value >= loggingLevel.value) ) { collectedLogs.push(logEntry); } }); return collectedLogs; } export async function verifyNoBrowserErrors() { const logs = await collectBrowserLogs( logging.Level.INFO, true /* collect more severe errors too */, ); expect(logs).toEqual([]); }
{ "end_byte": 1139, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/browser-logs-util.ts" }
angular/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg_0_2193
<svg xmlns="http://www.w3.org/2000/svg" width="2000" height="2000" version="1.0" viewBox="0 0 1500 1500"><path d="M720.3 22.3c-.4.7-3 1.8-5.8 2.4-4.8 1-14.9 4.4-19 6.4-1.1.5-4.7 1.8-8 2.8-6.9 2.2-11.8 3.9-16 5.7-5.9 2.4-19.1 7.2-23 8.4-2.2.6-5.3 1.6-7 2.2-1.6.5-4.1 1.2-5.5 1.5-1.4.3-3 .9-3.6 1.4-1.7 1.4-20.3 7.9-22.4 7.9-1.1 0-2 .4-2 .9s-2.3 1.4-5 2c-2.8.6-7.2 2.2-9.8 3.6-2.6 1.4-5.4 2.5-6.3 2.5-2.6 0-10.9 3.1-10.9 4.1 0 .5-1.2.9-2.7.9-1.4 0-3.4.6-4.2 1.4-.9.7-3.4 1.8-5.6 2.4-7.1 1.9-29 9.7-29.3 10.4-.2.5-1.4.8-2.7.8-1.3 0-2.6.4-2.9.9-.3.5-2.3 1.2-4.3 1.6-2.1.3-4.8 1.3-6.1 2.1-1.3.8-4.5 1.8-7.2 2.1-2.8.3-5.5 1.2-6.1 1.9-.6.8-1.9 1.4-2.9 1.4-2 0-10.8 3.5-15.8 6.2-1.8 1-4.4 1.8-5.8 1.8-1.4 0-4.6.9-7.2 1.9-5.8 2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1.6-4.7 1.9-2.1.6-2.3 4.5-.8 18.1.6 4.9 1.7 14.8 2.4 22 2.8 25.9 4 34.5 4.8 34.5.4 0 .8 4.8.8 10.6 0 6.2.5 11.4 1.2 12.7.6 1.2 1.5 6.7 1.9 12.2.4 5.5 1.2 14.5 1.8 20 .6 5.5 1.5 14.3 2 19.5.6 5.2 1.7 14.4 2.6 20.5.8 6 2 15.9 2.5 22 .5 6 1.4 13.7 1.9 17 1.4 8.4 3.1 23.2 4.1 35 .4 5.5 1.2 12 1.8 14.5.6 2.5 1.6 11.2 2.2 19.5.7 8.2 1.8 18.7 2.6 23.2.8 4.6 2.1 16.3 2.9 26 .9 9.8 1.8 18.5 2.1 19.3.6 1.6 1.6 9.2 3.3 27 .6 5.8 1.5 12.1 2 14
{ "end_byte": 2193, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg" }
angular/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg_2194_4317
.6 1.9 1.1 6.6 1.1 10.5.1 3.8.8 10.8 1.5 15.5.8 4.7 1.9 13.4 2.5 19.5 3.2 30.2 3.9 36.3 4.4 39.5.3 1.9 1.5 12 2.6 22.5 1.1 10.4 2.5 21.5 3 24.6.6 3 1 8.1 1 11.3 0 3.2.4 8.6 1 12 2.3 14.1 4.2 28.8 5 39.6.5 6.3 1.4 14.4 1.9 18 1.7 11 4.1 30 5.1 41 .6 5.8 1.2 12.3 1.5 14.5.3 2.2 1.5 12.7 2.7 23.2 1.2 10.6 2.6 19.3 3 19.3.4 0 .8 4.4.9 9.7 0 9.6.7 17.1 2.9 32.3.6 4.1 1.5 12 2 17.5s1.3 13.4 1.9 17.5c.5 4.1 1.4 11.5 2 16.3.5 4.9 1.5 12.1 2 16 2.3 15.8 3.1 22.7 7 61.2.5 4.9 1.4 11.4 2 14.4.6 2.9 1.1 8.2 1.1 11.7 0 6.2.1 6.4 3.3 7.9 5.3 2.6 9.1 4.9 13.7 8.3 2.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8.6 6.1 3.1 11.2 6 11.5 6.5.3.4 1.9 1.1 3.5 1.4 1.7.4 3.5 1.3 4 2 .6.6 3.7 2.5 7 4.1 3.3 1.6 6.8 3.7 7.7 4.7 1 .9 2.4 1.7 3.1 1.7.6 0 3.9 1.8 7.2 4 3.3 2.2 6.9 4 7.9 4 1.1 0 1.6.3 1.2.7-.3.4 2.6 2.2 6.6 4 4 1.9 7.5 3.7 7.8 4.1.9 1.2 4.9 3.2 6.5 3.2.8 0 1.5.5 1.5 1 0 .6 1 1.5 2.3 2 1.2.6 5.8 3 10.2 5.5 4.4 2.4 8.8 4.4 9.8 4.5.9 0 1.7.4 1.7.9s1 1.3 2.2 1.7c1.2.3 2.9 1.4 3.9 2.3 1 .9 4.2 2.9 7.3 4.4 3.1 1.6 5.8 3.2 6.1 3.7.3.5 2.2 1.4 4.3 2.1 2 .6 4.4 1.7 5.2 2.4.8.7 4.9 2.9 9 5 9.3 4.6 8.1 3.9 22.6 13.3 1 .6 2.6 1.5
{ "end_byte": 4317, "start_byte": 2194, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg" }
angular/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg_4318_6430
3.4 1.8.8.3 2.4 1 3.5 1.6 11.5 6.3 13.7 6.8 17.5 3.8 1.4-1.1 3.1-2 3.8-2 .6 0 1.2-.5 1.2-1 0-.6.6-1 1.4-1 .7 0 2.5-.9 3.9-2s3-2 3.5-2 4.6-2 9.1-4.5 8.6-4.3 9.1-4c.5.3 1.5-.3 2.2-1.2 1.5-2 2.5-2.7 12.3-7.8 3.9-2.1 7.7-4.4 8.6-5.1.8-.8 2.1-1.4 2.7-1.4.6 0 3.7-1.7 6.9-3.9 3.2-2.1 6.8-4.1 8.1-4.5 1.3-.4 5.1-2.4 8.5-4.3 3.4-2 9.6-5.4 13.7-7.6 4.1-2.2 7.7-4.4 8-4.8.3-.4 2.6-1.7 5.2-2.8 2.5-1 4.9-2.4 5.2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.7 4.1-2.7 7.2-4.4 6.6-3.5 11.2-6.4 11.9-7.3.3-.4 1.8-1.1 3.3-1.4 1.5-.4 2.7-1.1 2.7-1.5 0-.5 2.1-1.6 4.8-2.6 2.6-1 5.4-2.5 6.2-3.4.8-.9 2.6-1.7 3.9-1.7 1.4-.1 2.9-.9 3.3-1.8.5-.8 1.5-1.5 2.3-1.5.8 0 2.2-.8 3.2-1.8s3.7-2.4 5.9-3c2.3-.7 4.5-1.9 4.8-2.7.3-.8 1.4-1.5 2.4-1.5 1.1 0 3.8-1.3 6-3 2.3-1.6 6.3-4 8.9-5.3 2.6-1.3 7.3-3.8 10.3-5.6 8.1-4.9 8-4.8 14-7.8 3-1.5 5.7-3 6-3.4.3-.3 2.2-1.4 4.3-2.4 2-.9 3.7-2.1 3.7-2.6s.7-.9 1.6-.9c.9 0 5-1.7 9.2-3.9 4.3-2.1 8.9-4.3 10.5-4.9 1.5-.6 2.7-1.9 2.7-2.7 0-.9 1.2-1.8 2.9-2.1 4.4-.9 6.5-3.7 6.3-8.6-.1-2.2.2-4.6.7-5.2.4-.6 1.1-5.6 1.5-11.1.7-10.1 4.3-41 5.1-43.2.2-.6.7-6.5 1-13 .4-6.5 1.1-13.2 1.6-14.8.5-1.7 1.4-7.8 1.9-13.5.9-9.7
{ "end_byte": 6430, "start_byte": 4318, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg" }
angular/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg_6431_8540
1.9-17.9 5-44.5.6-5.5 1.8-13.6 2.6-18s1.4-10.7 1.4-14c0-3.3.9-11 1.9-17 1-6.1 2.4-19.3 3.1-29.5.7-10.3 1.8-20.2 2.6-22.3.9-2.3 1.4-7.6 1.4-13.7 0-5.5.4-10 .8-10 .5 0 1.8-9.1 3.1-20.3 1.2-11.1 2.6-23.4 3.1-27.2.5-3.9 1.2-10.2 1.4-14 .3-3.9 1.2-12.1 2.1-18.3.8-6.1 2.2-16.1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2-1.4-.8-3.4-1.4-4.3-1.4-.9 0-1.9-.4-2.2-.9-.3-.5-2.3-1.2-4.3-1.6-2.1-.4-4-1-4.3-1.3-.7-1-9.9-4.4-13.2-4.9-1.6-.3-2.8-.9-2.8-1.4 0-.5-1-.9-2.3-.9-1.3 0-3.2-.7-4.3-1.5-1-.8-2.7-1.5-3.7-1.5s-4.2-.9-7-2.1c-9.5-3.8-15.5-6-18.7-6.6-1.4-.3-4.7-1.6-7.5-2.9-2.7-1.4-6.7-2.7-8.7-3.1-2.1-.3-3.8-.9-3.8-1.3s-2.1-1.3-4.7-2c-2.7-.6-5.8-1.6-7-2.1-1.3-.5-3.3-1.3-4.5-1.8-5-2-13.7-5-21.3-7.4-4.4-1.4-11.6-4-16-5.7-4.4-1.8-9.9-3.6-12.2-4-2.3-.5-5-1.3-6-1.8-3.4-1.8-12.8-5.2-14.3-5.2-.8 0-3.7-1.2-6.5-2.5-2.7-1.4-5.7-2.5-6.5-2.5-.8 0-2.7-.6-4.2-1.4-1.5-.8-4-1.7-5.7-2.1-1.7-.4-3.3-1.1-3.6-1.6-.4-.5-1.4-.9-2.5-.9-1 0-5.1-1.3-9.1-3-4.1-1.6-8.2-3-9.2-3s-2.5-.7-3.3-1.5c-.9-.8-2.4-1.5-3.4-1.5s-2.1-.4-2.4-.9c-.4-.5-2.5-1.2-4.9-1.6-2.3-.4-4.8-1.2-5.6-1.8-1.7-1.5-8.1-3.7-10.5-3.7-1
{ "end_byte": 8540, "start_byte": 6431, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg" }
angular/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg_8541_10646
0-3.3-.8-5-1.8-1.7-1.1-5.7-2.4-8.8-3.1-3.2-.7-6-1.7-6.3-2.2-.4-.5-1.5-.9-2.5-.9s-3.5-.9-5.5-2.1c-1.9-1.2-5-2.5-6.8-2.9-4-1.1-12.6-4-14.9-5.1-1-.5-2.2-.9-2.8-.9-1.2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1.5 2.3 1.5 3.6 0 1.2.7 2.9 1.5 3.8.8.8 1.5 2.2 1.5 3.1 0 .8 1.1 3.2 2.4 5.3 1.3 2 3.5 6.5 4.8 9.9 1.2 3.5 2.9 6.3 3.6 6.3.6 0 1.2 1 1.2 2.3 0 1.3 1.6 5.5 3.5 9.4 1.9 3.9 3.5 7.6 3.5 8.1 0 .6 1.1 3.3 2.5 6 1.4 2.8 2.5 5.7 2.5 6.5 0 .8 1.1 3.5 2.5 5.8 1.4 2.4 2.5 5.2 2.5 6.1 0 .9.6 2.3 1.3 3 .6.7 2.1 3.4 3.3 5.8 1.1 2.5 3.2 7 4.7 10s2.7 6.1 2.7 6.8c0 .7.7 1.5 1.5 1.8.8.4 1.5 1.6 1.5 2.7 0 2 2.1 8.2 5.6 16.3.8 1.7 2 3.7 2.9 4.4.8.7 1.5 1.8 1.5 2.4 0 1.3 4.9 13.2 7.9 19.3 1.2 2.3 2.1 4.6 2.1 5.1 0 1.5 6.1 14.1 7.1 14.8.5.3.9 1.2.9 2 0 .9 1.4 4.5 3 8.1 1.7 3.5 3 7 3 7.6 0 .7.9 2.7 2 4.5 1.1 1.8 2 3.8 2 4.5 0 .7.9 2.3 2 3.5 1.1 1.2 2 2.7 2 3.4 0 .8.6 2.3 1.4 3.4.8 1.1 1.7 3.7 2.1 5.7.4 2 1.3 4.1 2.1 4.8.8.6 1.4 2.2 1.4 3.6 0 1.3.7 2.6 1.5 2.9.8.4 1.5 1.4 1.5 2.4 0 .9 1.8 5.2 4 9.5s4 8.4 4 9.1c0 .8.9 2.3 2 3.4s2 2.9 2 4 1.5 5.2 3.4 9.2c6.7 14.3 8.6 18.7 8.6 19.8 0 .6 1.1 3.3 2.5 6s2.5 5.6 2.5
{ "end_byte": 10646, "start_byte": 8541, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg" }
angular/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg_10647_12726
6.4c0 .8.6 2.1 1.3 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te": 10647, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg" }
angular/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg_12727_14850
0-1.2-.5-2.7-1.2-3.4-.7-.7-1.3-2.2-1.3-3.5v-2.2l-179.9-.3-179.9-.2-2.3 2c-1.2 1.2-2.4 3.9-2.8 6.1-.3 2.1-1.1 3.9-1.6 3.9-.6 0-1 .8-1 1.7 0 1-.6 2.9-1.3 4.3-.7 1.4-2.1 4.7-3.1 7.5-1.1 2.7-2.5 5.9-3.3 7-.7 1.1-1.3 2.7-1.3 3.7s-.9 3.5-2 5.5c-1.1 2.1-2 4.5-2 5.3 0 .9-.6 2.4-1.4 3.5-.7 1.1-1.7 3.6-2.1 5.5-.4 1.9-1.6 4.1-2.6 4.8-1.1.7-1.9 2.4-1.9 3.8s-.6 3.2-1.4 4c-.8.7-1.9 3.7-2.5 6.5-1.1 5.2-2.3 8.2-6.7 17.4-1.3 2.8-2.4 5.6-2.4 6.3 0 .7-.4 2-.9 3-2.2 3.9-4.1 8.6-4.1 9.8 0 .7-1.3 4.1-2.9 7.6-4.9 10.7-5.8 13.2-6.5 17-.4 2.1-1.1 3.8-1.6 3.8-.6 0-1 .6-1 1.2 0 .7-1.4 4-3 7.3s-3 7.2-3 8.7c0 1.6-.4 2.8-.8 2.8-.9 0-5.5 11.3-6.8 16.5-.4 1.6-1.5 3.8-2.5 4.9-1 1-1.6 2.3-1.3 2.8.3.4-.3 1.9-1.4 3.3-1.1 1.4-2.3 4.1-2.7 6.2-.4 2-1.8 5.9-3.1 8.6-1.4 2.7-2.3 5.5-2 6.3.4.9-.7 2.2-2.7 3.4-3.1 2-5.1 2-80.7 1.7l-77.5-.2-.3-3.4c-.2-2.2.3-4 1.6-5.5 1.1-1.1 2.7-4.6 3.7-7.6 2-6.5 6.4-16 8.2-17.8.7-.7 1.3-2.1 1.3-3.1s1.3-4.2 2.9-7.2c1.5-3 3.2-7 3.6-8.9.4-1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 1.4-3.6 3-7 1.7-3.3 3-6.6 3-7.4 0-.8.4-1.4.9-1.4s1.6-2.4 2.6-5.3c1.5-4.8 2.9-8 9-21.2 5.5-11.7 7.5-16.5 7.5-17.8 0-.8.9-2.2 2-3.2s2-2.6 2-3.6.7-2.4
{ "end_byte": 14850, "start_byte": 12727, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg" }
angular/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg_14851_17010
1.5-3.3c.8-.8 1.5-2.3 1.5-3.3.1-2.9 4.6-12.5 6.4-13.5.9-.5 1.6-1.8 1.6-3 0-2 1.3-5.3 7.1-17.3 1.6-3.3 2.9-6.7 2.9-7.6 0-.9.7-2.2 1.5-2.9.8-.7 1.5-1.9 1.5-2.8 0-.8 1.7-5.1 3.9-9.6 9.5-20.1 11.1-23.8 11.1-25.9 0-1.2.9-2.8 2-3.5 1.1-.7 2-1.8 2-2.5 0-.6 1.1-3.4 2.5-6.1 1.4-2.7 2.5-5.6 2.5-6.4 0-.7.7-2.6 1.5-4 .8-1.5 2.6-5.4 4-8.7 1.4-3.3 3.7-8.5 5.2-11.5 1.4-3 3.1-6.9 3.8-8.5.8-1.7 3.2-6.9 5.4-11.7 2.3-4.7 4.1-9.2 4.1-10 0-.7.7-2.2 1.5-3.2.8-1.1 1.5-2.7 1.5-3.7 0-.9 1-3.1 2.3-5 1.2-1.9 2.9-5.4 3.6-7.9 1.3-4 3.2-8.7 9.2-21.6 1-2.3 1.9-4.6 1.9-5.2 0-.6.8-1.9 1.9-2.9 1-1 2.2-3.3 2.6-5.1.3-1.7 1.1-3.2 1.6-3.2s.9-.9.9-2.1c0-2.1 5.6-14.6 7-15.4.5-.3 1.1-2.3 1.5-4.5.4-2.2 1.1-4 1.6-4s1.1-1.2 1.5-2.8c.9-3.7 4.6-11.2 5.6-11.2.4 0 .8-.9.8-2.1 0-1.1.6-3.3 1.4-4.7 1.2-2.4 5.7-12 11.5-24.7 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.4-3 6.6-3.6 9.4-.6 2.7-1.7 5.6-2.3 6.5-1.7 2-3.4 5.9-4.1 9.2-.4 1.6-1.1 2.8-1.6 2.8-.6 0-1 1.1-1 2.4 0 1.3-1.6 5.5-3.6 9.2-4.3 8.5-7.3 16.2-8.7 23.1-.7 3.1-1.7 5.3-2.4 5.3s-1.3.9-1.3 1.9c0 1.1-.7 3.2-1.5 4.8-4 7.7-9.5 20.2-9.5 21.5 0 .8-.4 1.8-1 2.4-.5.5-1.6 3-2.4 5.4-2.4 7.5-4 11.4-5.4 12.9-.8.8-1.1 2.2-.9 3.2.3
{ "end_byte": 17010, "start_byte": 14851, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg" }
angular/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg_17011_18535
1.1.1 1.9-.3 1.9-.5 0-1.6 2.1-2.6 4.7-1 2.7-2.3 5.7-3 6.8-.7 1.1-2.5 5.1-4 9-1.5 3.8-3.1 7.4-3.5 8-.5.5-.9 1.7-.9 2.6 0 1-1.1 3.9-2.4 6.6-1.4 2.6-2.8 6.1-3.2 7.8-.3 1.6-1.2 3.7-1.9 4.5-.7.8-1.6 2.6-2 4-.3 1.4-1.2 3.8-2 5.5-3.4 7.6-4.5 10.4-4.5 11.9 0 .9-.4 1.6-1 1.6-.5 0-1 .9-1 1.9 0 1.6-3.1 8.8-7.1 16.3-.5 1-.9 2.2-.9 2.7s-1.6 4.3-3.5 8.4c-1.9 4.1-3.5 8.3-3.5 9.3 0 .9-.6 2.5-1.3 3.3-.7.9-1.9 3.6-2.7 6.1-.7 2.5-2.1 6.1-3 8-1 1.9-3.4 6.9-5.4 11-2.2 4.6-3.6 9-3.6 11.3 0 3-.5 4-2.5 4.9-1.4.6-2.4 1.5-2.3 2 .2.5 54.9.8 122.8.8 115.5 0 122.5-.1 122.3-1.8-.2-2.8-3.3-10.6-4.9-12.3-.8-.8-1.4-2.5-1.4-3.8 0-1.2-.7-2.4-1.5-2.7-.8-.4-1.5-1.4-1.5-2.4 0-2.2-4.8-15.1-6.1-16.4-.5-.6-.9-2-.9-3.3 0-1.3-.4-2.3-1-2.3-.5 0-1-.5-1-1.1 0-2-5.4-14.9-6.2-14.9-.4 0-.8-1.3-.8-3 0-1.9-.7-3.4-2-4.2-1.1-.7-2-2.2-2-3.3 0-1.1-1.8-6-4-11-2.2-4.9-4-9.7-4-10.7 0-2-5.9-14.6-7.7-16.6-.7-.7-1.3-2.7-1.3-4.3 0-1.9-.5-2.9-1.5-2.9-.9 0-1.5-.9-1.5-2.4 0-1.3-1.3-5.3-3-8.9-1.6-3.7-3-7.5-3-8.6 0-1-.7-2.4-1.5-3.1-.8-.7-1.5-2.1-1.5-3 0-1.6-3-8.7-6.1-14.2-.5-1-.9-2.3-.9-3 0-.6-.9-3.1-2-5.5s-2.9-6.4-4.1-9.1c-1.1-2.6-2.7-5.9-3.5-7.4-.8-1.4-1.4-3.6-1.4-4.7 0-1.2-.4-2.1-1-2.1-.5 0-1-.8-1-1.8s-.6-2.7-1.4-3.8c-.8-1.1-1.7-3.7-2.1-5.7-.4-2-1.3-4.1-2.1-4.8-.8-.6-1.4-1.6-1.4-2.1 0-.6-.7-2.6-1.6-4.6-.9-2.1-2.2-5.2-3-7-.8-1.8-1.4-3.7-1.4-4.2 0-.6-1-3.2-2.1-5.8-4.2-9.3-4.9-11-4.9-11.7 0-.4-.8-1.9-1.9-3.3-1-1.5-2.1-3.8-2.5-5.2-.4-1.4-1.1-3.4-1.5-4.5-.5-1.1-2.6-6.5-4.7-12s-5.1-12.4-6.6-15.4c-1.6-3-2.8-6-2.8-6.7 0-1.5-2.7-4.4-4.1-4.4-.5 0-1.4 1.2-1.9 2.6z"/></svg>
{ "end_byte": 18535, "start_byte": 17011, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/logo-1500w.svg" }
angular/packages/core/test/bundling/image-directive/e2e/start-server.js_0_709
/** * @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 */ const protractorUtils = require('@bazel/protractor/protractor-utils'); const protractor = require('protractor'); /** * Helper function to start up a server for testing using Protractor utils. * Used as a part of the `protractor_web_test_suite` rule configuration. */ module.exports = async function (config) { const {port} = await protractorUtils.runServer(config.workspace, config.server, '--port', []); const serverUrl = `http://localhost:${port}`; protractor.browser.baseUrl = serverUrl; };
{ "end_byte": 709, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/start-server.js" }
angular/packages/core/test/bundling/image-directive/e2e/preconnect-check/preconnect-check.e2e-spec.ts_0_1825
/** * @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 */ /* tslint:disable:no-console */ import {browser, by, element, ElementHelper} from 'protractor'; import {logging} from 'selenium-webdriver'; import {collectBrowserLogs} from '../browser-logs-util'; // Verifies that both images used in a component were rendered. async function verifyImagesPresent(element: ElementHelper) { const imgs = element.all(by.css('img')); const srcA = await imgs.get(0).getAttribute('src'); expect(srcA.endsWith('a.png')).toBe(true); const srcB = await imgs.get(1).getAttribute('src'); expect(srcB.endsWith('b.png')).toBe(true); } describe('NgOptimizedImage directive', () => { it('should log a warning when there is no preconnect for priority images', async () => { await browser.get('/e2e/preconnect-check'); await verifyImagesPresent(element); // Make sure that only one warning is in the console for both images, // because they both have the same base URL (which is used to look for // corresponding `<link rel="preconnect">` tags). const logs = await collectBrowserLogs(logging.Level.WARNING); expect(logs.length).toEqual(1); // Verify that the error code and a raw image src are present in the // error message. expect(logs[0].message).toMatch(/NG02956.*?a\.png/); }); it('should not produce any warnings in the console when a preconnect tag is present', async () => { await browser.get('/e2e/preconnect-check?preconnect'); await verifyImagesPresent(element); // Make sure there are no browser logs. const logs = await collectBrowserLogs(logging.Level.WARNING); expect(logs.length).toEqual(0); }); });
{ "end_byte": 1825, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/preconnect-check/preconnect-check.e2e-spec.ts" }
angular/packages/core/test/bundling/image-directive/e2e/preconnect-check/preconnect-check.ts_0_1800
/** * @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 {DOCUMENT, IMAGE_LOADER, NgOptimizedImage} from '@angular/common'; import {Component, Inject} from '@angular/core'; @Component({ selector: 'preconnect-check', standalone: true, imports: [NgOptimizedImage], template: ` <img ngSrc="/e2e/a.png" width="50" height="50" priority> <img ngSrc="/e2e/b.png" width="50" height="50" priority> <img ngSrc="/e2e/c.png" width="50" height="50"> `, providers: [ { provide: IMAGE_LOADER, useValue: (config: {src: string}) => `https://angular.io/assets/images/${config.src}`, }, ], }) export class PreconnectCheckComponent { constructor(@Inject(DOCUMENT) private doc: Document) { this.createRequestedLinkElements(); } /** * Setup an environment required for e2e testing: create the necessary `<link>` elements in the * `document.head`, so that the `NgOptimizedImage` logic can be verified in various scenarios. */ private createRequestedLinkElements() { const win = this.doc.defaultView; if (!win) return; const url = new URL(win.location.href).searchParams; const preconnect = url.get('preconnect'); if (preconnect !== null) { const link = this.createLinkElement('preconnect', 'https://angular.io'); this.doc.head.appendChild(link); } } /** * Helper method to create a simple `<link>` element based on inputs. */ private createLinkElement(rel: string, href: string, as?: string): HTMLLinkElement { const link = this.doc.createElement('link'); link.rel = rel; link.href = href; if (as) link.as = as; return link; } }
{ "end_byte": 1800, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/preconnect-check/preconnect-check.ts" }
angular/packages/core/test/bundling/image-directive/e2e/oversized-image/oversized-image.ts_0_1478
/** * @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 {IMAGE_LOADER, ImageLoaderConfig, NgOptimizedImage} from '@angular/common'; import {Component} from '@angular/core'; const imageLoader = { provide: IMAGE_LOADER, useFactory: () => (config: ImageLoaderConfig) => config.src, }; @Component({ selector: 'oversized-image-passing', standalone: true, imports: [NgOptimizedImage], providers: [imageLoader], template: ` <!-- Image is rendered within threshold range--> <div style="width: 500px; height: 500px"> <img ngSrc="/e2e/logo-500w.jpg" width="200" height="200" priority> </div> <!-- Image is rendered too small but ngSrcset set--> <div style="width: 300px; height: 300px"> <img ngSrc="/e2e/logo-1500w.jpg" width="100" height="100" priority ngSrcset="100w, 200w"> </div> `, }) export class OversizedImageComponentPassing {} @Component({ selector: 'oversized-image-failing', standalone: true, imports: [NgOptimizedImage], providers: [imageLoader], template: ` <!-- Image is rendered too small --> <div style="width: 300px; height: 300px"> <img ngSrc="/e2e/logo-1500w.jpg" width="100" height="100" priority disableOptimizedSrcset> </div> `, }) export class OversizedImageComponentFailing {}
{ "end_byte": 1478, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/oversized-image/oversized-image.ts" }
angular/packages/core/test/bundling/image-directive/e2e/oversized-image/oversized-image.e2e-spec.ts_0_1117
/** * @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 */ /* tslint:disable:no-console */ import {browser, by, element, ExpectedConditions} from 'protractor'; import {logging} from 'selenium-webdriver'; import {collectBrowserLogs} from '../browser-logs-util'; describe('NgOptimizedImage directive', () => { it('should not warn if there is no oversized image', async () => { await browser.get('/e2e/oversized-image-passing'); const logs = await collectBrowserLogs(logging.Level.WARNING); expect(logs.length).toEqual(0); }); it('should warn if rendered image size is much smaller than intrinsic size', async () => { await browser.get('/e2e/oversized-image-failing'); const logs = await collectBrowserLogs(logging.Level.WARNING); expect(logs.length).toEqual(1); const expectedMessageRegex = /the intrinsic image is significantly larger than necessary\./; expect(expectedMessageRegex.test(logs[0].message)).toBeTruthy(); }); });
{ "end_byte": 1117, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/oversized-image/oversized-image.e2e-spec.ts" }
angular/packages/core/test/bundling/image-directive/e2e/fill-mode/fill-mode.e2e-spec.ts_0_1933
/** * @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 */ /* tslint:disable:no-console */ import {browser} from 'protractor'; import {logging} from 'selenium-webdriver'; import {collectBrowserLogs} from '../browser-logs-util'; describe('NgOptimizedImage directive', () => { it('should not warn when an image in the fill mode is rendered correctly', async () => { await browser.get('/e2e/fill-mode-passing'); const logs = await collectBrowserLogs(logging.Level.WARNING); expect(logs.length).toEqual(0); }); it('should warn if an image in the fill mode has zero height after rendering', async () => { await browser.get('/e2e/fill-mode-failing'); const logs = await collectBrowserLogs(logging.Level.WARNING); expect(logs.length).toEqual(1); // Image loading order is not guaranteed, so all logs, rather than single entry // needs to be checked in order to test whether a given error message is present. const expectErrorMessageInLogs = (logs: logging.Entry[], message: string) => { expect( logs.some((log) => { return log.message.includes(message); }), ).toBeTruthy(); }; expectErrorMessageInLogs( logs, 'NG02952: The NgOptimizedImage directive (activated on an \\u003Cimg> element ' + 'with the `ngSrc=\\"/e2e/logo-500w.jpg\\"`) has detected that the height ' + 'of the fill-mode image is zero. This is likely because the containing element ' + "does not have the CSS 'position' property set to one of the following: " + '\\"relative\\", \\"fixed\\", or \\"absolute\\". To fix this problem, ' + "make sure the container element has the CSS 'position' " + 'property defined and the height of the element is not zero.', ); }); });
{ "end_byte": 1933, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/fill-mode/fill-mode.e2e-spec.ts" }
angular/packages/core/test/bundling/image-directive/e2e/fill-mode/fill-mode.ts_0_939
/** * @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 {NgOptimizedImage} from '@angular/common'; import {Component} from '@angular/core'; @Component({ selector: 'fill-mode-passing', standalone: true, imports: [NgOptimizedImage], template: ` <!-- Make sure an image in the fill mode has the size of a container --> <div style="position: absolute; width: 100px; height: 100px;"> <img ngSrc="/e2e/logo-500w.jpg" fill priority> </div> `, }) export class FillModePassingComponent {} @Component({ selector: 'fill-mode-failing', standalone: true, imports: [NgOptimizedImage], template: ` <div style="position: relative; width: 100%;"> <img ngSrc="/e2e/logo-500w.jpg" fill priority> </div> `, }) export class FillModeFailingComponent {}
{ "end_byte": 939, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/fill-mode/fill-mode.ts" }
angular/packages/core/test/bundling/image-directive/e2e/basic/basic.ts_0_649
/** * @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 {IMAGE_LOADER, NgOptimizedImage} from '@angular/common'; import {Component} from '@angular/core'; @Component({ selector: 'basic', standalone: true, imports: [NgOptimizedImage], template: `<img ngSrc="/e2e/a.png" width="150" height="150" priority>`, providers: [ { provide: IMAGE_LOADER, useValue: () => 'https://angular.io/assets/images/logos/angular/angular.svg', }, ], }) export class BasicComponent {}
{ "end_byte": 649, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/basic/basic.ts" }
angular/packages/core/test/bundling/image-directive/e2e/basic/basic.e2e-spec.ts_0_1003
/** * @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 {browser, by, element} from 'protractor'; import {logging} from 'selenium-webdriver'; import {collectBrowserLogs} from '../browser-logs-util'; describe('NgOptimizedImage directive', () => { it('should render an image with an updated `src`', async () => { await browser.get('/e2e/basic'); const imgs = element.all(by.css('img')); const src = await imgs.get(0).getAttribute('src'); expect(/angular\.svg/.test(src)).toBe(true); // Since there are no preconnect tags on a page, // we expect a log in a console that mentions that. const logs = await collectBrowserLogs(logging.Level.WARNING); expect(logs.length).toEqual(1); // Verify that the error code and a raw image src are present. expect(logs[0].message).toMatch(/NG02956.*?a\.png/); }); });
{ "end_byte": 1003, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/basic/basic.e2e-spec.ts" }
angular/packages/core/test/bundling/image-directive/e2e/image-perf-warnings-lazy/image-perf-warnings-lazy.e2e-spec.ts_0_1367
/** * @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 */ /* tslint:disable:no-console */ import {browser, by, element} from 'protractor'; import {logging} from 'selenium-webdriver'; import {collectBrowserLogs} from '../browser-logs-util'; describe('Image performance warnings', () => { it('should log a warning when a LCP image is loaded lazily', async () => { await browser.get('/e2e/image-perf-warnings-lazy'); // Wait for load event await new Promise((resolve) => setTimeout(resolve, 600)); // Verify that both images were rendered. const imgs = element.all(by.css('img')); let srcA = await imgs.get(0).getAttribute('src'); expect(srcA.endsWith('a.png')).toBe(true); let srcB = await imgs.get(1).getAttribute('src'); expect(srcB.endsWith('b.png')).toBe(true); // Make sure that only one warning is in the console for image `a.png`, // since the `b.png` should be below the fold and not treated as an LCP element. const logs = await collectBrowserLogs(logging.Level.WARNING); expect(logs.length).toEqual(1); // Verify that the error code and the image src are present in the error message. expect(logs[0].message).toMatch(/NG0913.*?a\.png/); }); });
{ "end_byte": 1367, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/image-perf-warnings-lazy/image-perf-warnings-lazy.e2e-spec.ts" }
angular/packages/core/test/bundling/image-directive/e2e/image-perf-warnings-lazy/image-perf-warnings-lazy.ts_0_694
/** * @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'; @Component({ selector: 'image-perf-warnings-lazy', standalone: true, template: ` <!-- 'a.png' should be treated as an LCP element --> <img src="/e2e/a.png" width="2500" height="2500" loading="lazy"> <br> <!-- 'b.png' should *not* be treated as an LCP element here as well, since it's below the fold --> <img src="/e2e/b.png" width="10" height="10"> `, }) export class ImagePerfWarningsLazyComponent {}
{ "end_byte": 694, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/image-perf-warnings-lazy/image-perf-warnings-lazy.ts" }
angular/packages/core/test/bundling/image-directive/e2e/lcp-check/lcp-check.ts_0_1046
/** * @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 {NgOptimizedImage} from '@angular/common'; import {Component} from '@angular/core'; @Component({ selector: 'lcp-check', standalone: true, imports: [NgOptimizedImage], template: ` <!-- 'b.png' should *not* be treated as an LCP element, since there is a bigger one right below it --> <img ngSrc="/e2e/b.png" width="5" height="5"> <br> <!-- 'a.png' should be treated as an LCP element --> <img [ngSrc]=imageSrc width="2500" height="2500"> <br> <!-- 'b.png' should *not* be treated as an LCP element here as well, since it's below the fold --> <img ngSrc="/e2e/b.png" width="10" height="10"> `, }) export class LcpCheckComponent { imageSrc = '/e2e/a.png'; ngOnInit() { setTimeout(() => { this.imageSrc = '/e2e/logo-500w.jpg'; }, 500); } }
{ "end_byte": 1046, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/lcp-check/lcp-check.ts" }
angular/packages/core/test/bundling/image-directive/e2e/lcp-check/lcp-check.e2e-spec.ts_0_1534
/** * @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 */ /* tslint:disable:no-console */ import {browser, by, element} from 'protractor'; import {logging} from 'selenium-webdriver'; import {collectBrowserLogs} from '../browser-logs-util'; describe('NgOptimizedImage directive', () => { it('should log a warning when a `priority` is missing on an LCP image', async () => { await browser.get('/e2e/lcp-check'); // Wait for ngSrc to be modified await new Promise((resolve) => setTimeout(resolve, 600)); // Verify that both images were rendered. const imgs = element.all(by.css('img')); let srcB = await imgs.get(0).getAttribute('src'); expect(srcB.endsWith('b.png')).toBe(true); const srcA = await imgs.get(1).getAttribute('src'); expect(srcA.endsWith('logo-500w.jpg')).toBe(true); // The `b.png` image is used twice in a template. srcB = await imgs.get(2).getAttribute('src'); expect(srcB.endsWith('b.png')).toBe(true); // Make sure that only one warning is in the console for image `a.png`, // since the `b.png` should be below the fold and not treated as an LCP element. const logs = await collectBrowserLogs(logging.Level.SEVERE); expect(logs.length).toEqual(1); // Verify that the error code and the image src are present in the error message. expect(logs[0].message).toMatch(/NG02955.*?a\.png/); }); });
{ "end_byte": 1534, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/lcp-check/lcp-check.e2e-spec.ts" }
angular/packages/core/test/bundling/image-directive/e2e/image-distortion/image-distortion.e2e-spec.ts_0_6225
/** * @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 */ /* tslint:disable:no-console */ import {browser} from 'protractor'; import {logging} from 'selenium-webdriver'; import {collectBrowserLogs} from '../browser-logs-util'; describe('NgOptimizedImage directive', () => { it('should not warn if there is no image distortion', async () => { await browser.get('/e2e/image-distortion-passing'); const logs = await collectBrowserLogs(logging.Level.WARNING); expect(logs.length).toEqual(0); }); it('should warn if there is image distortion', async () => { await browser.get('/e2e/image-distortion-failing'); const logs = await collectBrowserLogs(logging.Level.WARNING); expect(logs.length).toEqual(7); // Image loading order is not guaranteed, so all logs, rather than single entry // needs to be checked in order to test whether a given error message is present. const expectErrorMessageInLogs = (logs: logging.Entry[], message: string) => { expect( logs.some((log) => { return log.message.includes(message); }), ).toBeTruthy(); }; // Images with incorrect width/height attributes expectErrorMessageInLogs( logs, 'The NgOptimizedImage directive (activated on an \\u003Cimg> element ' + 'with the `ngSrc=\\"/e2e/b.png\\"`) has detected that ' + 'the aspect ratio of the image does not match the aspect ratio indicated by the width and height attributes. ' + '\\nIntrinsic image size: 250w x 250h (aspect-ratio: 1). ' + '\\nSupplied width and height attributes: 26w x 30h (aspect-ratio: 0.87). ' + '\\nTo fix this, update the width and height attributes.', ); expectErrorMessageInLogs( logs, 'The NgOptimizedImage directive (activated on an \\u003Cimg> element ' + 'with the `ngSrc=\\"/e2e/b.png\\"`) has detected that ' + 'the aspect ratio of the image does not match the aspect ratio indicated by the width and height attributes. ' + '\\nIntrinsic image size: 250w x 250h (aspect-ratio: 1). ' + '\\nSupplied width and height attributes: 24w x 240h (aspect-ratio: 0.10). ' + '\\nTo fix this, update the width and height attributes.', ); // Images with incorrect styling expectErrorMessageInLogs( logs, 'The NgOptimizedImage directive (activated on an \\u003Cimg> element ' + 'with the `ngSrc=\\"/e2e/b.png\\"`) has detected that ' + "the aspect ratio of the rendered image does not match the image's intrinsic aspect ratio. " + '\\nIntrinsic image size: 250w x 250h (aspect-ratio: 1). ' + '\\nRendered image size: 250w x 30h (aspect-ratio: 8.33). ' + '\\nThis issue can occur if \\"width\\" and \\"height\\" attributes are added to an image ' + 'without updating the corresponding image styling. To fix this, adjust image styling. In most cases, ' + 'adding \\"height: auto\\" or \\"width: auto\\" to the image styling will fix this issue.', ); expectErrorMessageInLogs( logs, 'The NgOptimizedImage directive (activated on an \\u003Cimg> element ' + 'with the `ngSrc=\\"/e2e/b.png\\"`) has detected that ' + "the aspect ratio of the rendered image does not match the image's intrinsic aspect ratio. " + '\\nIntrinsic image size: 250w x 250h (aspect-ratio: 1). ' + '\\nRendered image size: 30w x 250h (aspect-ratio: 0.12). ' + '\\nThis issue can occur if \\"width\\" and \\"height\\" attributes are added to an image ' + 'without updating the corresponding image styling. To fix this, adjust image styling. In most cases, ' + 'adding \\"height: auto\\" or \\"width: auto\\" to the image styling will fix this issue.', ); // Padding is used on <img> expectErrorMessageInLogs( logs, 'The NgOptimizedImage directive (activated on an \\u003Cimg> element ' + 'with the `ngSrc=\\"/e2e/logo-500w.jpg\\"`) has detected that ' + "the aspect ratio of the rendered image does not match the image's intrinsic aspect ratio. " + '\\nIntrinsic image size: 500w x 500h (aspect-ratio: 1). ' + '\\nRendered image size: 100w x 500h (aspect-ratio: 0.20). ' + '\\nThis issue can occur if \\"width\\" and \\"height\\" attributes are added to an image ' + 'without updating the corresponding image styling. To fix this, adjust image styling. In most cases, ' + 'adding \\"height: auto\\" or \\"width: auto\\" to the image styling will fix this issue.', ); expectErrorMessageInLogs( logs, 'The NgOptimizedImage directive (activated on an \\u003Cimg> element ' + 'with the `ngSrc=\\"/e2e/logo-500w.jpg\\"`) has detected that ' + "the aspect ratio of the rendered image does not match the image's intrinsic aspect ratio. " + '\\nIntrinsic image size: 500w x 500h (aspect-ratio: 1). ' + '\\nRendered image size: 200w x 400h (aspect-ratio: 0.50). ' + '\\nThis issue can occur if \\"width\\" and \\"height\\" attributes are added to an image ' + 'without updating the corresponding image styling. To fix this, adjust image styling. In most cases, ' + 'adding \\"height: auto\\" or \\"width: auto\\" to the image styling will fix this issue.', ); // Image with incorrect width/height attributes AND incorrect styling // This only generate only one error to ensure that users first fix the width and height // attributes. expectErrorMessageInLogs( logs, 'The NgOptimizedImage directive (activated on an \\u003Cimg> element ' + 'with the `ngSrc=\\"/e2e/b.png\\"`) has detected that ' + 'the aspect ratio of the image does not match the aspect ratio indicated by the width and height attributes. ' + '\\nIntrinsic image size: 250w x 250h (aspect-ratio: 1). ' + '\\nSupplied width and height attributes: 150w x 250h (aspect-ratio: 0.60). ' + '\\nTo fix this, update the width and height attributes.', ); }); });
{ "end_byte": 6225, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/image-distortion/image-distortion.e2e-spec.ts" }
angular/packages/core/test/bundling/image-directive/e2e/image-distortion/image-distortion.ts_0_5262
/** * @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 {NgOptimizedImage} from '@angular/common'; import {Component} from '@angular/core'; @Component({ selector: 'image-distortion-passing', standalone: true, imports: [NgOptimizedImage], template: ` <!-- All the images in this template should not throw --> <!-- This image is here for the sake of making sure the "LCP image is priority" assertion is passed --> <img ngSrc="/e2e/logo-500w.jpg" width="500" height="500" priority> <br> <!-- width and height attributes exactly match the intrinsic size of image --> <img ngSrc="/e2e/a.png" width="25" height="25"> <br> <!-- supplied aspect ratio exactly matches intrinsic aspect ratio--> <img ngSrc="/e2e/a.png" width="250" height="250"> <img ngSrc="/e2e/b.png" width="40" height="40"> <img ngSrc="/e2e/b.png" width="240" height="240"> <br> <!-- supplied aspect ratio is similar to intrinsic aspect ratio --> <!-- Aspect-ratio: 0.93333333333 --> <img ngSrc="/e2e/b.png" width="28" height="30"> <!-- Aspect-ratio: 0.9 --> <img ngSrc="/e2e/b.png" width="27" height="30"> <!-- Aspect-ratio: 1.09375 --> <img ngSrc="/e2e/b.png" width="350" height="320"> <!-- Aspect-ratio: 1.0652173913 --> <img ngSrc="/e2e/b.png" width="245" height="230"> <br> <!-- Fill mode disables aspect ratio warning --> <!-- Aspect-ratio: 0.1 --> <img ngSrc="/e2e/b.png" width="24" height="240" disableOptimizedSrcset fill> <br> <!-- Supplied aspect ratio is correct & image has 0x0 rendered size --> <img ngSrc="/e2e/a.png" width="25" height="25" style="display: none"> <br> <!-- styling is correct --> <img ngSrc="/e2e/a.png" width="25" height="25" style="width: 100%; height: 100%"> <img ngSrc="/e2e/a.png" width="250" height="250" style="max-width: 100%; height: 100%"> <img ngSrc="/e2e/a.png" width="25" height="25" style="height: 25%; width: 25%;"> <br> <!-- handles padding --> <img ngSrc="/e2e/a.png" width="25" height="25" style="padding: 4px"> <img ngSrc="/e2e/a.png" width="25" height="25" style="padding-top: 4px"> <img ngSrc="/e2e/a.png" width="25" height="25" style="padding-right: 4px"> <img ngSrc="/e2e/a.png" width="25" height="25" style="padding-bottom: 4px"> <img ngSrc="/e2e/a.png" width="25" height="25" style="padding-left: 4px; box-sizing: content-box; height: 25px; width: auto"> <img ngSrc="/e2e/a.png" width="25" height="25" style="padding-left: 4px; box-sizing: border-box; height: 25px; width: auto"> <img ngSrc="/e2e/a.png" width="25" height="25" style="padding: 1px 2px 5px 10px; box-sizing: content-box; height: 25px; width: auto"> <img ngSrc="/e2e/a.png" width="25" height="25" style="padding: 1px 2px 5px 10px; box-sizing: border-box; height: 25px; width: auto"> <br> <!-- autoscale with large difference between width and height resulting in rounding --> <img ngSrc="/e2e/white-607x3.png" width="607" height="3" style="width: auto; height: 2px"> <br> `, }) export class ImageDistortionPassingComponent {} @Component({ selector: 'image-distortion-failing', standalone: true, imports: [NgOptimizedImage], template: ` <!-- With the exception of the priority image, all the images in this template should throw --> <!-- This image is here for the sake of making sure the "LCP image is priority" assertion is passed --> <img ngSrc="/e2e/logo-500w.jpg" width="500" height="500" priority> <br> <!-- These images should throw --> <!-- Supplied aspect ratio differs from intrinsic aspect ratio by > .1 --> <!-- Aspect-ratio: 0.86666666666 --> <img ngSrc="/e2e/b.png" width="26" height="30" disableOptimizedSrcset> <!-- Aspect-ratio: 0.1 --> <img ngSrc="/e2e/b.png" width="24" height="240" disableOptimizedSrcset> <!-- Supplied aspect ratio is incorrect & image has 0x0 rendered size --> <img ngSrc="/e2e/a.png" width="222" height="25" style="display: none" disableOptimizedSrcset> <br> <!-- Image styling is causing distortion --> <div style="width: 300px; height: 300px"> <img ngSrc="/e2e/b.png" width="250" height="250" style="width: 10%" disableOptimizedSrcset> <img ngSrc="/e2e/b.png" width="250" height="250" style="max-height: 10%" disableOptimizedSrcset> <!-- Images dimensions are incorrect AND image styling is incorrect --> <img ngSrc="/e2e/b.png" width="150" height="250" style="max-height: 10%" disableOptimizedSrcset> </div> <!-- Image is distorted but padding is applied to trick clientWidth --> <img ngSrc="/e2e/logo-500w.jpg" width="500" height="500" priority style="width: 100px; height: 500px; padding-left: 400px; box-sizing: content-box"> <img ngSrc="/e2e/logo-500w.jpg" width="500" height="500" priority style="width: 400px; height: 400px; padding-left: 200px; box-sizing: border-box"> `, }) export class ImageDistortionFailingComponent {}
{ "end_byte": 5262, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/image-distortion/image-distortion.ts" }
angular/packages/core/test/bundling/image-directive/e2e/image-perf-warnings-oversized/svg-no-perf-oversized-warnings.ts_0_575
/** * @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'; @Component({ selector: 'svg-no-perf-oversized-warnings', standalone: true, template: ` <!-- Image is rendered too small --> <div style="width: 200px; height: 200px"> <img src="/e2e/logo-1500w.svg" width="100" height="100"> </div> `, }) export class SvgNoOversizedPerfWarningsComponent {}
{ "end_byte": 575, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/image-perf-warnings-oversized/svg-no-perf-oversized-warnings.ts" }
angular/packages/core/test/bundling/image-directive/e2e/image-perf-warnings-oversized/image-perf-warnings-oversized.ts_0_574
/** * @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'; @Component({ selector: 'image-perf-warnings-oversized', standalone: true, template: ` <!-- Image is rendered too small --> <div style="width: 200px; height: 200px"> <img src="/e2e/logo-1500w.jpg" width="100" height="100"> </div> `, }) export class ImagePerfWarningsOversizedComponent {}
{ "end_byte": 574, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/image-perf-warnings-oversized/image-perf-warnings-oversized.ts" }
angular/packages/core/test/bundling/image-directive/e2e/image-perf-warnings-oversized/image-perf-warnings-oversized.e2e-spec.ts_0_1480
/** * @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 */ /* tslint:disable:no-console */ import {browser} from 'protractor'; import {logging} from 'selenium-webdriver'; import {collectBrowserLogs} from '../browser-logs-util'; describe('Image performance warnings', () => { it('should warn if rendered image size is much smaller than intrinsic size', async () => { await browser.get('/e2e/image-perf-warnings-oversized'); // Wait for load event await new Promise((resolve) => setTimeout(resolve, 600)); const logs = await collectBrowserLogs(logging.Level.WARNING); expect(logs.length).toEqual(1); const expectedMessageRegex = /has intrinsic file dimensions much larger than/; expect(expectedMessageRegex.test(logs[0].message)).toBeTruthy(); }); // https://github.com/angular/angular/issues/57941 it('should NOT warn if rendered SVG image size is much smaller that intrinsic size', async () => { await browser.get('/e2e/svg-no-perf-oversized-warnings'); // Wait for load event await new Promise((resolve) => setTimeout(resolve, 600)); const logs = await collectBrowserLogs(logging.Level.WARNING); // Please note that prior to shipping the fix, it was logging a warning // for the SVG image (see the attached issue above). expect(logs.length).toEqual(0); }); });
{ "end_byte": 1480, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/image-directive/e2e/image-perf-warnings-oversized/image-perf-warnings-oversized.e2e-spec.ts" }
angular/packages/core/test/bundling/cyclic_import/trigger.ts_0_366
/** * @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'; @Component({ selector: 'trigger', template: '<dep></dep>', standalone: false, }) export class TriggerComponent {}
{ "end_byte": 366, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/cyclic_import/trigger.ts" }
angular/packages/core/test/bundling/cyclic_import/integration_spec.ts_0_1622
/** * @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 '@angular/compiler'; import {withBody} from '@angular/private/testing'; import {runfiles} from '@bazel/runfiles'; import * as fs from 'fs'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/cyclic_import'; describe('treeshaking with uglify', () => { let content: string; const contentPath = runfiles.resolve(path.join(PACKAGE, 'bundle.debug.min.js')); beforeAll(() => { content = fs.readFileSync(contentPath, {encoding: 'utf-8'}); }); describe('functional test in domino', () => { it( 'should render hello world when not minified', withBody('<trigger></trigger>', async () => { await import(path.join(PACKAGE, 'bundle.js')); await (window as any).appReady; expect(document.body.textContent).toEqual('dep'); }), ); it( 'should render hello world when debug minified', withBody('<trigger></trigger>', async () => { await import(path.join(PACKAGE, 'bundle.debug.min.js')); await (window as any).appReady; expect(document.body.textContent).toEqual('dep'); }), ); it( 'should render hello world when fully minified', withBody('<trigger></trigger>', async () => { await import(path.join(PACKAGE, 'bundle.min.js')); await (window as any).appReady; expect(document.body.textContent).toEqual('dep'); }), ); }); });
{ "end_byte": 1622, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/cyclic_import/integration_spec.ts" }
angular/packages/core/test/bundling/cyclic_import/index.html_0_1190
<!DOCTYPE html> <html> <head> <title>Angular Cyclic Import Example</title> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <trigger></trigger> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write('<script src="' + (document.location.search.endsWith('debug') ? 'bundle.debug.min.js' : 'bundle.min.js') + '"></' + 'script>'); </script> </body> </html>
{ "end_byte": 1190, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/cyclic_import/index.html" }
angular/packages/core/test/bundling/cyclic_import/README.md_0_1165
# Purpose This test exists to validate that ngtsc, when compiling an application where Ivy would otherwise require a circular dependency, uses "remote scoping" via the `setComponentScope` function instead. # How it works There are two files, `index.ts` and `trigger.ts`. `index.ts` contains the NgModule and a simple component (`<dep>`). `trigger.ts` contains a component `TriggerComponent` that uses `<dep>` in its template. Normally, Ivy would want `DepComponent` to be listed in `TriggerComponent`'s definition. However, this requires adding an import from `trigger.ts` -> `index.ts`, and there's already an import from `index.ts` to `trigger.ts` (for the NgModule). In this case, ngtsc decides to set the directives in `TriggerComponent`'s definition via a different mechanism: remote scoping. Alongside the NgModule (in `index.ts`) a call to `setComponentScope` is generated which sets up `TriggerComponent`'s definition correctly, without introducing any imports. This call is not tree-shakeable, but does not create a cycle. The symbol test here verifies that `setComponentScope` is used, and the e2e spec verifies that the application works correctly.
{ "end_byte": 1165, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/cyclic_import/README.md" }
angular/packages/core/test/bundling/cyclic_import/BUILD.bazel_0_1363
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library") load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test") load("@npm//http-server:index.bzl", "http_server") package(default_visibility = ["//visibility:public"]) ng_module( name = "cyclic_import", srcs = [ "index.ts", "trigger.ts", ], deps = [ "//packages/core", "//packages/platform-browser", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":cyclic_import", "//packages/core", "@npm//rxjs", ], ) ts_library( name = "test_lib", testonly = True, srcs = glob(["*_spec.ts"]), deps = [ "//packages:types", "//packages/compiler", "//packages/core/testing", "//packages/private/testing", "@npm//@bazel/runfiles", ], ) jasmine_node_test( name = "test", data = [ ":bundle.debug.min.js", ":bundle.js", ":bundle.min.js", ":bundle.min.js.br", ], deps = [":test_lib"], ) js_expected_symbol_test( name = "symbol_test", src = ":bundle.debug.min.js", golden = ":bundle.golden_symbols.json", ) http_server( name = "devserver", data = [ "index.html", ":bundle.debug.min.js", ":bundle.min.js", ], )
{ "end_byte": 1363, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/cyclic_import/BUILD.bazel" }
angular/packages/core/test/bundling/cyclic_import/index.ts_0_734
/** * @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 {ApplicationRef, Component, NgModule} from '@angular/core'; import {BrowserModule, platformBrowser} from '@angular/platform-browser'; import {TriggerComponent} from './trigger'; @Component({ selector: 'dep', template: 'dep', standalone: false, }) export class DepComponent {} @NgModule({ declarations: [DepComponent, TriggerComponent], imports: [BrowserModule], bootstrap: [TriggerComponent], }) export class Module {} (window as any).appReady = platformBrowser().bootstrapModule(Module, {ngZone: 'noop'});
{ "end_byte": 734, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/cyclic_import/index.ts" }
angular/packages/core/test/bundling/injection/usage.ts_0_942
/** * @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 { ɵcreateInjector as createInjector, ɵɵdefineInjectable, ɵɵdefineInjector, } from '@angular/core'; export class RootService { static ɵprov = ɵɵdefineInjectable({ token: RootService, providedIn: 'root', factory: () => new RootService(), }); } export class ScopedService { static ɵprov = ɵɵdefineInjectable({ token: ScopedService, providedIn: null, factory: () => new ScopedService(), }); doSomething(): void { // tslint:disable-next-line:no-console console.log("Ensure this isn't tree-shaken."); } } export class DefinedInjector { static ɵinj = ɵɵdefineInjector({ providers: [ScopedService], }); } export const INJECTOR = createInjector(DefinedInjector);
{ "end_byte": 942, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/injection/usage.ts" }
angular/packages/core/test/bundling/injection/treeshaking_spec.ts_0_495
/** * @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 '@angular/compiler'; import {INJECTOR, ScopedService} from './usage'; describe('functional test for injection system bundling', () => { it('should be able to inject the scoped service', () => { expect(INJECTOR.get(ScopedService) instanceof ScopedService).toBe(true); }); });
{ "end_byte": 495, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/injection/treeshaking_spec.ts" }
angular/packages/core/test/bundling/injection/BUILD.bazel_0_971
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test") load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ts_library") package(default_visibility = ["//visibility:public"]) ts_library( name = "injection", srcs = [ "index.ts", "usage.ts", ], deps = [ "//packages/core", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":injection", "//packages/core", "@npm//rxjs", ], ) ts_library( name = "test_lib", testonly = True, srcs = glob(["*_spec.ts"]), deps = [ ":injection", "//packages:types", "//packages/compiler", "//packages/core/testing", "//packages/private/testing", ], ) jasmine_node_test( name = "test", deps = [":test_lib"], ) js_expected_symbol_test( name = "symbol_test", src = ":bundle.debug.min.js", golden = ":bundle.golden_symbols.json", )
{ "end_byte": 971, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/injection/BUILD.bazel" }
angular/packages/core/test/bundling/injection/index.ts_0_297
/** * @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 {INJECTOR, ScopedService} from './usage'; INJECTOR.get(ScopedService).doSomething();
{ "end_byte": 297, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/injection/index.ts" }
angular/packages/core/test/bundling/forms_template_driven/index.html_0_1233
<!DOCTYPE html> <html> <head> <title>Angular Template-driven Forms Example</title> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <app-root></app-root> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write('<script src="' + (document.location.search.endsWith('debug') ? '/bundle.debug.min.js' : '/bundle.min.js') + '"></' + 'script>'); </script> </body> </html>
{ "end_byte": 1233, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/forms_template_driven/index.html" }
angular/packages/core/test/bundling/forms_template_driven/forms_e2e_spec.ts_0_1715
/** * @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 '@angular/compiler'; import {withBody} from '@angular/private/testing'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/forms_template_driven'; const BUNDLES = ['bundle.js', 'bundle.debug.min.js', 'bundle.min.js']; describe('functional test for forms', () => { BUNDLES.forEach((bundle) => { describe(`using ${bundle} bundle`, () => { it( 'should render template form', withBody('<app-root></app-root>', async () => { // load the bundle await import(path.join(PACKAGE, bundle)); // the bundle attaches the following fields to the `window` global. const {bootstrapApp} = window as any; await bootstrapApp(); // Template forms const templateFormsComponent = (window as any).templateFormsComponent; const templateForm = document.querySelector('app-template-forms')!; // Check for inputs const iputs = templateForm.querySelectorAll('input'); expect(iputs.length).toBe(5); // Check for button const templateButtons = templateForm.querySelectorAll('button'); expect(templateButtons.length).toBe(1); expect(templateButtons[0]).toBeDefined(); // Make sure button click works const templateFormSpy = spyOn(templateFormsComponent, 'addCity'); templateButtons[0].click(); expect(templateFormSpy).toHaveBeenCalled(); }), ); }); }); });
{ "end_byte": 1715, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/forms_template_driven/forms_e2e_spec.ts" }
angular/packages/core/test/bundling/forms_template_driven/treeshaking_spec.ts_0_1069
/** * @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 '@angular/compiler'; import {runfiles} from '@bazel/runfiles'; import * as fs from 'fs'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/forms_template_driven'; describe('treeshaking with uglify', () => { let content: string; // We use the debug version as otherwise symbols/identifiers would be mangled (and the test would // always pass) const contentPath = runfiles.resolve(path.join(PACKAGE, 'bundle.debug.min.js')); beforeAll(() => { content = fs.readFileSync(contentPath, {encoding: 'utf-8'}); }); it('should drop unused TypeScript helpers', () => { expect(content).not.toContain('__asyncGenerator'); }); it('should not contain rxjs from commonjs distro', () => { expect(content).not.toContain('commonjsGlobal'); expect(content).not.toContain('createCommonjsModule'); }); });
{ "end_byte": 1069, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/forms_template_driven/treeshaking_spec.ts" }
angular/packages/core/test/bundling/forms_template_driven/BUILD.bazel_0_1465
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library") load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test") load("@npm//http-server:index.bzl", "http_server") package(default_visibility = ["//visibility:public"]) ng_module( name = "forms_template_driven", srcs = ["index.ts"], deps = [ "//packages/core", "//packages/forms", "//packages/platform-browser", ], ) app_bundle( name = "bundle", entry_point = ":index.ts", deps = [ ":forms_template_driven", "//packages/core", "//packages/forms", "//packages/platform-browser", "@npm//rxjs", ], ) ts_library( name = "test_lib", testonly = True, srcs = glob(["*_spec.ts"]), deps = [ "//packages:types", "//packages/compiler", "//packages/core", "//packages/core/testing", "//packages/private/testing", "@npm//@bazel/runfiles", ], ) jasmine_node_test( name = "test", data = [ ":bundle.debug.min.js", ":bundle.js", ":bundle.min.js", ":bundle.min.js.br", ], deps = [":test_lib"], ) js_expected_symbol_test( name = "symbol_test", src = ":bundle.debug.min.js", golden = ":bundle.golden_symbols.json", ) http_server( name = "prodserver", data = [ "index.html", ":bundle.debug.min.js", ":bundle.min.js", ], )
{ "end_byte": 1465, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/forms_template_driven/BUILD.bazel" }
angular/packages/core/test/bundling/forms_template_driven/index.ts_0_1933
/** * @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, NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {BrowserModule, platformBrowser} from '@angular/platform-browser'; @Component({ selector: 'app-template-forms', template: ` <form novalidate> <div ngModelGroup="profileForm"> <div> First Name: <input name="first" ngModel required /> </div> <div> Last Name: <input name="last" ngModel /> </div> <div> Subscribe: <input name="subscribed" type="checkbox" ngModel /> </div> <div>Disabled: <input name="foo" ngModel disabled /></div> <div *ngFor="let city of addresses; let i = index"> City <input [(ngModel)]="addresses[i].city" name="name" /> </div> <button (click)="addCity()">Add City</button> </div> </form> `, standalone: false, }) class TemplateFormsComponent { name = {first: 'Nancy', last: 'Drew', subscribed: true}; addresses = [{city: 'Toronto'}]; constructor() { // We use this reference in our test (window as any).templateFormsComponent = this; } addCity() { this.addresses.push({city: ''}); } } @Component({ selector: 'app-root', template: ` <app-template-forms></app-template-forms> `, standalone: false, }) class RootComponent {} @NgModule({ declarations: [RootComponent, TemplateFormsComponent], imports: [BrowserModule, FormsModule], }) class FormsExampleModule { ngDoBootstrap(app: any) { app.bootstrap(RootComponent); } } function bootstrapApp() { return platformBrowser().bootstrapModule(FormsExampleModule, {ngZone: 'noop'}); } (window as any).bootstrapApp = bootstrapApp;
{ "end_byte": 1933, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/forms_template_driven/index.ts" }
angular/packages/core/test/bundling/animations-standalone/index.html_0_1220
<!DOCTYPE html> <html> <head> <title>Angular Animations Example</title> </head> <body> <!-- The Angular application will be bootstrapped into this element. --> <app-root></app-root> <!-- Script tag which bootstraps the application. Use `?debug` in URL to select the debug version of the script. There are two scripts sources: `bundle.min.js` and `bundle.debug.min.js` You can switch between which bundle the browser loads to experiment with the application. - `bundle.min.js`: Is what the site would serve to their users. It has gone through rollup, build-optimizer, and uglify with tree shaking. - `bundle.debug.min.js`: Is what the developer would like to see when debugging the application. It has also gone through full pipeline of esbuild, babel optimization, plugins from the devkit and terser, however mangling is disabled and the minified file is formatted using prettier (to ease debugging). --> <script> document.write('<script src="' + (document.location.search.endsWith('debug') ? '/bundle.debug.min.js' : '/bundle.min.js') + '"></' + 'script>'); </script> </body> </html>
{ "end_byte": 1220, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/animations-standalone/index.html" }
angular/packages/core/test/bundling/animations-standalone/treeshaking_spec.ts_0_1069
/** * @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 '@angular/compiler'; import {runfiles} from '@bazel/runfiles'; import * as fs from 'fs'; import * as path from 'path'; const PACKAGE = 'angular/packages/core/test/bundling/animations-standalone'; describe('treeshaking with uglify', () => { let content: string; // We use the debug version as otherwise symbols/identifiers would be mangled (and the test would // always pass) const contentPath = runfiles.resolve(path.join(PACKAGE, 'bundle.debug.min.js')); beforeAll(() => { content = fs.readFileSync(contentPath, {encoding: 'utf-8'}); }); it('should drop unused TypeScript helpers', () => { expect(content).not.toContain('__asyncGenerator'); }); it('should not contain rxjs from commonjs distro', () => { expect(content).not.toContain('commonjsGlobal'); expect(content).not.toContain('createCommonjsModule'); }); });
{ "end_byte": 1069, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/bundling/animations-standalone/treeshaking_spec.ts" }