profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/danrub/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

danrub/AzurePipelines 0

A single Repo to contain the source for ALL my Azure DevOps Build/Release Extensions. The packages can be found in the VSTS Marketplace

danrub/greendonut 0

Green Donut is a port of facebook's DataLoader utility, written in C# for .NET Core and .NET Framework

danrub/orientdb 0

OrientDB document graph NoSQL dbms (database)

danrub/RazorLight 0

Template engine based on Microsoft's Razor parsing engine for .NET Core

danrub/TypeScript 0

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

Pull request review commentangular/angular

fix(forms): allow minLength/maxLength validator to be bound to `null`

 import {NgForm} from '@angular/forms';        <div ngModelGroup="name" #nameCtrl="ngModelGroup">         <input name="first" [ngModel]="name.first" minlength="2">+        <input name="middle" [ngModel]="name.middle" maxlength="2">

Thanks for additional info 👍 Let's keep it.

iRealNirmal

comment created time in 28 minutes

Pull request review commentangular/angular

fix(forms): allow minLength/maxLength validator to be bound to `null`

 export class MinLengthValidator implements Validator, OnChanges {   }    private _createValidator(): void {-    this._validator = minLengthValidator(-        typeof this.minlength === 'number' ? this.minlength : parseInt(this.minlength, 10));+    this._validator =+        this.enabled() ? minLengthValidator(toInteger(this.minlength!)) : nullValidator;+  }++  enabled(): boolean {

Yeah, it looks like the test CI job is failing because of this change. Let's use @nodoc for now then and we can change that to private later once ViewEngine is removed.

iRealNirmal

comment created time in 26 minutes

Pull request review commentangular/angular

docs: improve ApplicationRef.bootstrap docs

  * found in the LICENSE file at https://angular.io/license  */ -import {Component, createPlatformFactory} from '@angular/core';-import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';+import {ApplicationRef, Component, DoBootstrap, NgModule, Type} from '@angular/core';+import {BrowserModule} from '@angular/platform-browser'; -// #docregion longform-@Component({selector: 'app-root', template: 'Hello World'})-class MyApp {+@Component({+  selector: 'app-root',+  template: ` <h1>App Component</h1> `,+})+export class AppComponent { } -const myPlatformFactory = createPlatformFactory(platformBrowserDynamic, 'myPlatform');-myPlatformFactory().bootstrapModule(MyApp);+@Component({+  selector: 'app-root',+  template: ` <h1>Component One</h1> `,+})+export class ComponentOne {+}++@Component({+  selector: 'app-root',+  template: ` <h1>Component Two</h1> `,+})+export class ComponentTwo {+}++@NgModule({imports: [BrowserModule], declarations: [ComponentOne, ComponentTwo]})+// #docregion componentSelector+export class AppModule implements DoBootstrap {+  readonly componentMap: {[key: string]: Type<unknown>} = {+    'ComponentOne': ComponentOne,+    'ComponentTwo': ComponentTwo,+  };++  ngDoBootstrap(appRef: ApplicationRef) {+    this.fetchDataFromApi().then((componentName: string) => {+      appRef.bootstrap(this.componentMap[componentName]);+    });+  }

I think we should avoid extra complexity and just have an if-else block here:

  ngDoBootstrap(appRef: ApplicationRef) {
    this.fetchDataFromApi().then((componentName: string) => {
      if (componentName === 'ComponentOne') {
        appRef.bootstrap(ComponentOne);
      } else {
        appRef.bootstrap(ComponentTwo);
      }
    });
  }
umairhm

comment created time in 3 days

Pull request review commentangular/angular

Ngtsc/smarter type emitter

 export function canEmitType(type: ts.TypeNode, resolver: TypeReferenceResolver):   return canEmitTypeWorker(type);    function canEmitTypeWorker(type: ts.TypeNode): boolean {-    return visitTypeNode(type, {-      visitTypeReferenceNode: type => canEmitTypeReference(type),-      visitArrayTypeNode: type => canEmitTypeWorker(type.elementType),-      visitKeywordType: () => true,-      visitLiteralType: () => true,-      visitOtherType: () => false,-    });+    return visitNode(type) !== INELIGIBLE;+  }++  function visitNode(node: ts.Node): typeof INELIGIBLE|undefined {

typeof INELIGIBLE here is {}, the empty interface type. Lots of things are assignable to it, including false.

If we want to make a singleton value, it'd be better to use a branded type instead:

type INELIGIBLE = {__brand: 'ineligible'};
const INELIGIBLE: INELIGIBLE = {} as INELIGIBLE;

This ensures we don't accidentally create other values of this type besides the constant.

JoostK

comment created time in 3 hours

Pull request review commentangular/angular

Ngtsc/smarter type emitter

 export function canEmitType(type: ts.TypeNode, resolver: TypeReferenceResolver):   return canEmitTypeWorker(type);    function canEmitTypeWorker(type: ts.TypeNode): boolean {-    return visitTypeNode(type, {-      visitTypeReferenceNode: type => canEmitTypeReference(type),-      visitArrayTypeNode: type => canEmitTypeWorker(type.elementType),-      visitKeywordType: () => true,-      visitLiteralType: () => true,-      visitOtherType: () => false,-    });+    return visitNode(type) !== INELIGIBLE;+  }++  function visitNode(node: ts.Node): typeof INELIGIBLE|undefined {+    if (ts.isTypeReferenceNode(node) && !canEmitTypeReference(node)) {+      return INELIGIBLE;+    } else {+      return ts.forEachChild(node, visitNode);

This is getting a bit too clever... it seems we're relying on the fact that this returns undefined for all other kinds of type nodes, correct? At the very least, we should have a comment here explaining:

  1. what kinds of nodes we want to return INELIGIBLE for, and why.
  2. the mechanism by which eligible nodes end up getting selected.
JoostK

comment created time in 3 hours

pull request commentangular/angular

feat(compiler): add support for shorthand property declarations in templates

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

<!-- need_author_consent -->

crisbeto

comment created time in 3 hours

pull request commentangular/angular

refactor(core): optimize the implementation about finding context from error in ErrorHandler

There seem to be 4 consistently failing tests in the test_ivy_aot test run related to golden files. You may need to rebase / take a look at the failures.

damingerdai

comment created time in 4 hours

Pull request review commentangular/angular

fix(complier-cli): check split two way binding

 class TcbUnclaimedOutputsOp extends TcbOp {         continue;       } +      // Check for split two way binding with unclaimed outputs+      let inputName = output.name.replace('Change', '');+      if (this.claimedInputs.has(inputName)) {+        let input = this.element.inputs.find(input => input.name == inputName)+        if (input?.sourceSpan == output.sourceSpan) {

Nit: Since already know the inputName is claimed, if we don't get an input, that's an internal compiler error. I'm thinking we should either assert that input is defined (not sure of the best way to do that in the compiler) or use input!.sourceSpan so we get a real error.

danieltre23

comment created time in 5 hours

Pull request review commentangular/angular

fix(complier-cli): check split two way binding

 class TcbUnclaimedOutputsOp extends TcbOp {         continue;       } +      // Check for split two way binding with unclaimed outputs

Instead of removing Change and then looking for an input with that name, we should look for an input only if the output ends with Change. Otherwise something like:

class MyComponent {
  @Input() @Output() something: string;
}

Would lead to strange behavior. Admittedly that's probably its own bug, but I imagine we'd want to handle that separately from this.

danieltre23

comment created time in 5 hours

Pull request review commentangular/angular

fix(complier-cli): check split two way binding

 export class TcbDirectiveOutputsOp extends TcbOp { class TcbUnclaimedOutputsOp extends TcbOp {   constructor(       private tcb: Context, private scope: Scope, private element: TmplAstElement,-      private claimedOutputs: Set<string>) {+      private claimedOutputs: Set<string>, private claimedInputs: Set<string>) {

Nit: I would swap the claimedInputs and claimedOutputs parameters so inputs comes first. Otherwise I think it would be pretty easy for users to accidentally pass their arguments backwards.

danieltre23

comment created time in 5 hours

Pull request review commentangular/angular

fix(complier-cli): check split two way binding

 class TcbUnclaimedOutputsOp extends TcbOp {         continue;       } +      // Check for split two way binding with unclaimed outputs+      let inputName = output.name.replace('Change', '');

We can probably limit this to just outputs which end with Change, otherwise a name like ChangeDataEvent would become DataEvent and lead to strange behavior.

I think we can use a regex to only replace a Change which is the last part of the string:

output.name.replace(/Change$/, '');
danieltre23

comment created time in 5 hours

Pull request review commentangular/angular

fix(complier-cli): check split two way binding

 export declare class AnimationEvent {       expect(diags.length).toBe(0);     }); +    it('should check split two way binding', () => {+      env.tsconfig({strictTemplates: true});+      env.write('test.ts', `+        import {Component, Input, Output, EventEmitter, NgModule} from '@angular/core';++        @Component({+          selector: 'test',+          template: '<child-cmp [(value)]="counterValue"></child-cmp>',+        })++        export class TestCmp {+          counterValue = 0;+        }++        @Component({+          selector: 'child-cmp',+          template: '',+        })++        export class ChildCmp {+          @Input() value = 0;+          @Output() incrementValue = new EventEmitter<number>();

Nit: Consider adding a comment here which points out that this name should be valueChange, but the user got it wrong which causes the error. This will make it more clear exactly what mistake this is testing for.

danieltre23

comment created time in 5 hours

Pull request review commentangular/angular

fix(complier-cli): check split two way binding

 export class OutOfBandDiagnosticRecorderImpl implements OutOfBandDiagnosticRecor         templateId, mapping, diagnosticVar.keySpan, ts.DiagnosticCategory.Suggestion,         ngErrorCode(ErrorCode.SUGGEST_SUBOPTIMAL_TYPE_INFERENCE), message));   }++  splitTwoWayBinding(templateId: TemplateId, output: TmplAstBoundEvent): void {+    const mapping = this.resolver.getSourceMapping(templateId);+    const errorMsg = `The output ${output.name} for the two way binding is not declared.`;

Nit: I'm thinking we should include a link to https://angular.io/guide/two-way-binding#how-two-way-binding-works which gives a much more complete explanation of the two-way binding contract. That would help users understand exactly what they did wrong and how to fix it.

danieltre23

comment created time in 4 hours

issue openedangular/angular

i18n Interpolation + Ternary operator

Bug Report

Affected Package

@angular/localize

Is this a regression?

Don't Know

Description

When trying to apply i18n translation to a button does not work. The button text is an interpolated expression which has a ternary operator to evaluate te string to show.

When launching the translated app, simple translations work fine, but the button who has the dynamic text stays the same (with the original language) and even stops to change text dynamically as if the expression was frozen.

Minimal Reproduction

(the app sourceLocale is 'es' Spanish and the translation is to 'en' English) The button example is:

<button mat-raised-button style="width: 100%;" type="submit" color="primary" [disabled]="loading"
      i18n="Boton de login con titulo dinamico">{{loading ? 'Cargando Módulo...' : 'Ingresar'}}</button>

the messages.xlf file is:

      <trans-unit id="187187500641108332" datatype="html">
        <source><x id="INTERPOLATION" equiv-text="{{loading ? &apos;Cargando Módulo...&apos; : &apos;Ingresar&apos;}}"/></source>
        <context-group purpose="location">
          <context context-type="sourcefile">src/app/modules/signed-out-module/sign-in/sign-in.component.html</context>
          <context context-type="linenumber">32,33</context>
        </context-group>
        <note priority="1" from="description">Boton de login con titulo dinamico</note>
      </trans-unit>

the messages.en.xlf file is:

      <trans-unit id="187187500641108332" datatype="html">
        <source><x id="INTERPOLATION" equiv-text="{{loading ? &apos;Cargando Módulo...&apos; : &apos;Ingresar&apos;}}"/></source>
        <target><x id="INTERPOLATION" equiv-text="{{loading ? &apos;Loading...&apos; : &apos;Log in&apos;}}"/></target>
        <context-group purpose="location">
          <context context-type="sourcefile">src/app/modules/signed-out-module/sign-in/sign-in.component.html</context>
          <context context-type="linenumber">31,32</context>
        </context-group>
        <note priority="1" from="description">Boton de login con titulo dinamico</note>
      </trans-unit>

I also have tried changing the target in the messages.en.xlf to something like: <target>{{loading ? 'Loading...' : 'Log in';}}</target> But it generates an error (Unable to parse ICU expression in "{{loading ? 'Loading Module...' : 'Log In'}}" message.) so it doesn't work either.

Exception or Error

<pre><code> <!-- If the issue is accompanied by an exception or an error, please share it below: -->

</code></pre>

Your Environment

Angular Version: <pre><code>

 _                      _                 ____ _     ___ 
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ △ \ | '_ \ / | | | | |/ _ | '__| | | | | | | / ___ | | | | (| | || | | (| | | | || |___ | | // __| ||_, |_,||_,|| _||_| |___/

Angular CLI: 12.0.5 Node: 16.1.0 Package Manager: npm 7.11.2 OS: win32 x64

Angular: 12.0.5 ... animations, cdk, cli, common, compiler, compiler-cli, core ... forms, language-service, localize, material ... material-moment-adapter, platform-browser ... platform-browser-dynamic, platform-server, router ... service-worker

Package Version

@angular-devkit/architect 0.1200.5 @angular-devkit/build-angular 12.0.5 @angular-devkit/core 12.0.5 @angular-devkit/schematics 12.0.5 @angular/flex-layout 12.0.0-beta.34 @schematics/angular 12.0.5 rxjs 6.6.7 typescript 4.2.4 </code></pre>

Anything else relevant?

Nope

created time in 5 hours

issue commentangular/angular

AngularWebpackPlugin marks not related files as affected

I cannot reproduce using 12.1.0-next.6, here's my repro project: https://github.com/JoostK/ng42543

Here's the logging when changing something in m1.ts:

  physicallyChangedTsFiles: Set(1) {
    '/Users/joost/Development/angular/repros/ng42543/src/app/m1.ts'
  },
  logicallyChangedTsFiles: Set(2) {
    '/Users/joost/Development/angular/repros/ng42543/src/app/m1.ts',
    '/Users/joost/Development/angular/repros/ng42543/src/app/app.module.ts'
  }
SebastianPodgajny

comment created time in 5 hours

issue commentangular/angular

docs: RouterTestingModule should be added to Testing guide

If anyone lands here and needs an example to follow, this helped: https://stackoverflow.com/questions/53823091/unable-to-test-routing-using-routertestingmodule

Essentially, we need to add the following because DI no longer instantiates it `import {MockLocationStrategy} from '@angular/common/testing' import { LocationStrategy } from '@angular/common';

{ provide: LocationStrategy, useClass: MockLocationStrategy }`

Splaktar

comment created time in 5 hours

PR opened angular/angular

Reviewers
fix(complier-cli): check split two way binding target: patch

Check for split two way binding when output is not declared to make error message clearer.

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [x] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->

  • [x] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Documentation content changes
  • [ ] angular.io application / infrastructure changes
  • [ ] Other... Please describe:

What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

Issue Number: 39300

What is the new behavior?

The new error message for a banana-in-a-box binding with the output not declared should be "The output {outputName} for the two way binding is not declared."

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->

Other information

+80 -4

0 comment

4 changed files

pr created time in 5 hours

Pull request review commentangular/angular

feat(compiler): add support for shorthand property declarations in templates

 describe('type check blocks diagnostics', () => {               '(null as any ? (((ctx).a /*3,4*/) /*3,4*/)!.method /*6,12*/(((ctx).b /*13,14*/) /*13,14*/) : undefined) /*3,15*/');     }); +    it('should annotate safe keyed reads', () => {

I think we should squash the commits and then extract these tests into a separate commit, honestly.

It's not a big deal, but I think in the name of having a clean history, it makes sense not to bundle unrelated tests.

To avoid another round trip and blocking this PR, I'll go ahead and do that for you since I think it's ready to merge otherwise.

crisbeto

comment created time in 6 hours

pull request commentangular/angular

refactor(compiler-cli): support xi18n in ngtsc

Switching to target: patch, as this PR applies cleanly to the patch branch, and we want to keep the compiler in sync as much as possible.

alxhub

comment created time in 7 hours

push eventangular/angular

Pete Bacon Darwin

commit sha b0592c1be6a65c5074a4a0967075b28b8e054b54

build(docs-infra): use case-insensitive encoding for content files (#42414) To avoid having content files that have the same file path on case-insensitive file-systems, we now encode the paths to remove uppercase characters. PR Close #42414

view details

Pete Bacon Darwin

commit sha 15fca6ca94bd0843f4e810165d566de6aa84bd22

build(docs-infra): remove `disambiguator` doc-type (#42414) Now that we disambiguate files by encoding the outputPath, there is no need for the `disambiguator` doc-type. PR Close #42414

view details

Pete Bacon Darwin

commit sha b037df28fdaf2daac750e635d2157447381018f1

Revert "fix(docs-infra): do not redirect disambiguated URLs" (#42414) This reverts commit 61ad68a586135a4d7b2b920fda0cb4238c6422fe, since there are no longer any disambiguated paths that need special handling. PR Close #42414

view details

Pete Bacon Darwin

commit sha 983c540191b5d838e19863c1e722170be6ea42e3

docs: fix pipe params (#42593) The addition of overloads to some of the number pipes caused the documentation to lose the parameter descriptions. This change fixes that by moving the JSDOC block in from of the primary method signature, rather than the first overload. Fixes #42590 PR Close #42593

view details

push time in 8 hours

issue closedangular/angular

App not running up on removing unsafe-eval for restricted CSP

Bug Report

Description

My Application has restricted CSP which does not allow unsafe-eval for scripts. On adding a Content-Security-Policy header without unsafe-eval my application fails to load up.

Minimal Reproduction

I am passing this restrictive CSP header through nginx proxy configuration file . <pre><code> add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'nonce-$request_id' </code></pre> I have removed the unsafe-eval here which is causing this issue while loading up the application <pre><code>Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'</code></pre>

You can add this CSP directly in index.html file for reproducing this error <pre><code class="language-html"><meta http-equiv="Content-Security-Policy" content= "default-src 'self' 'nonce-$request_id' ; script-src 'self' 'nonce-$request_id' ; style-src 'self' 'unsafe-inline'; frame-ancestors 'self';"> </pre></code>

I am using angular version 9 with aot enabled in my project.

Exception or Error

<pre><code> Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'nonce-17279687d574ebf5358210888e9e9395'".

at new Function (<anonymous>)
at b.N (vendor.c63b596435f6d085789d.js:1)
at b.c (vendor.c63b596435f6d085789d.js:1)
at Object.D [as resolveRef] (vendor.c63b596435f6d085789d.js:1)
at Object.t.exports [as code] (vendor.c63b596435f6d085789d.js:1)
at Object.t.exports [as validate] (vendor.c63b596435f6d085789d.js:1)
at Object.t.exports [as code] (vendor.c63b596435f6d085789d.js:1)
at t.exports (vendor.c63b596435f6d085789d.js:1)
at N (vendor.c63b596435f6d085789d.js:1)
at b.t (vendor.c63b596435f6d085789d.js:1

</code></pre>

Your Environment

Angular Version: <pre><code> Angular CLI: 9.1.13 Node: 16.2.0 OS: win32 x64

Angular: 9.1.13 ... animations, cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router, service-worker Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.901.13 @angular-devkit/build-angular 0.901.13 @angular-devkit/build-optimizer 0.901.13 @angular-devkit/build-webpack 0.901.13 @angular-devkit/core 9.1.13 @angular-devkit/schematics 9.1.13 @angular/cdk 9.2.4 @angular/material 9.2.4 @ngtools/webpack 9.1.13 @schematics/angular 9.1.13 @schematics/update 0.901.13 rxjs 6.6.3 typescript 3.8.3 webpack 4.42.0

</code></pre>

closed time in 8 hours

404shades

issue commentangular/angular

App not running up on removing unsafe-eval for restricted CSP

Closing as it appears this has been resolved. Thanks for confirming you no longer have this issue, @404shades.

404shades

comment created time in 8 hours

issue closedangular/angular

Error in compiling: Could not mark an element as translatable inside of a translatable section

Current behavior Compiling an application with the angular compiler throws error, Could not mark an element as the translatable inside of a translatable section.

Expected/desired behavior It should compile successfully. When I do a fresh npm install it works for one or two builds after that application throwing error.

Angular CLI: 11.2.9 Node: 12.13.0 OS: win32 x64

Application dev-dependencies: "@angular-devkit/build-angular": "~0.803.25", "@angular/cli": "~8.3.25", "@angular/compiler-cli": "^8.2.14", "@angular/language-service": "^8.2.14",

Capture

closed time in 8 hours

bhaveshdewangan

issue commentangular/angular

Error in compiling: Could not mark an element as translatable inside of a translatable section

Closing due to lack of reproduction and a lot of changes in this area in recent versions, so please update to a supported version of Angular. Feel free to open a new issue if you continue to have problems.

bhaveshdewangan

comment created time in 8 hours

issue commentangular/angular

Wrong error -- Error: NG0300: Multiple components match node with tagname app-tooltip

Closing due to lack of reproduction. Please open a new issue if you can share additional information on when this happens.

emilalsgndr

comment created time in 8 hours

push eventangular/angular

George Kalpakas

commit sha aec60d04f31f217c0ee6194a6914135a005b8df7

test(docs-infra): add testcases for all redirect rules (#42452) This commit adds testcases in `URLS_TO_REDIRECT.txt` for all redirect rules defined in `firebase.json`. This ensures that all rules are tested and work as expected. PR Close #42452

view details

George Kalpakas

commit sha 5ea4ae77116d38ce871fc44c720e7379e6002440

test(docs-infra): unnest unnecessarily nested test suite (#42452) Previously, the `destinations` test suite in `testFirebaseRedirection.spec.ts` was nested under the `with legacy URLs` test suite. However, the two suites are unrelated and there is no reason to have them nested. This commit moves the `destinations` test suite to be beside (instead of inside) the `with legacy URLs` one. PR Close #42452

view details

George Kalpakas

commit sha 3e744830627f0fb5757db99ed378f58d71fa0f81

test(docs-infra): ensure all redirect rules are tested (#42452) This commit adds a test assertion to verify that all redirect rules defined in `firebase.json` are tested, i.e. that each rule is applied to at least one testcase from `URLS_TO_REDIRECT.txt`. This will ensure that any redirect rules added in the future will be tested. PR Close #42452

view details

George Kalpakas

commit sha fa2775fb5601c08097ee06534451cdba152fbf00

build(docs-infra): add missing redirect rule for `api/http` in `firebase.json` (#42452) Previously, only sub-paths, such as `api/http/foo`, were redirected to `guide/deprecations#http`. This commit ensures that also `api/http` itself (which used to point to the `http` module's API page) is redirected as well. PR Close #42452

view details

George Kalpakas

commit sha 43eeca467baad27bb9d13d488b1c634712e6677e

build(docs-infra): remove redundant `navigationUrls` globs from `ngsw-config.json` (#42452) This commit removes some `navigationUrls` globs from `ngsw-config.json` that have no effect. More specifically: - It removes globs of the form `!/**/xyz.html`, since these are already covered by the more generic `!/**/*.*` glob. - It removes `!/api/**/NgFor`, since it does not have a corresponding redirect rule in `firebase.json`. This is in preparation of automatically generating the ServiceWorker `navigationUrls` based on `firebase.json`. PR Close #42452

view details

George Kalpakas

commit sha b74750bb136f4209c2a1fc8b1e779e8e9c1c9f06

build(docs-infra): allow a trailing `/` in more `navigationUrls` globs in `ngsw-config.json` (#42452) Previously, we were not consistent in allowing a trailing `/` in `navigationUrls` globs in `ngsw-config.json`. And when we did, we used two globs: one with and one without the trailing `/`. This commit updates all appropriate `navigationUrls` globs to allow a trailing `/`. It also merges the two glob patterns (the one with and the one without the `/`) into one. This is in preparation of automatically generating the ServiceWorker `navigationUrls` based on `firebase.json`. PR Close #42452

view details

George Kalpakas

commit sha e045ba31923700087b65f8a4ed30501471adeed9

build(docs-infra): alphabetically sort all `navigationUrls` in `ngsw-config.json` (#42452) This commit sorts all `navigationUrls` in `ngsw-config.json` alphabetically. This is in preparation of automatically generating the ServiceWorker `navigationUrls` based on `firebase.json`. PR Close #42452

view details

George Kalpakas

commit sha 537f34d929bf1a5d073005f6f8185d8a032fa451

build(docs-infra): align `navigationUrls` in `ngsw-config.json` with Firebase redirects (#42452) The ServiceWorker `navigationUrls` globs defined in `ngsw-config.json` are supposed to exclude any URLs that are redirected on the server (as configured in `firebase.json`). However, the list of redirected URLs/globs in `firebase.json` and `ngsw-config.json` have gotten out of sync. This commit updates the globs in `ngsw-config.json` to match the ones in `firebase.json`. This is in preparation of automatically generating the ServiceWorker `navigationUrls` based on `firebase.json`. PR Close #42452

view details

George Kalpakas

commit sha a7bec2b181a3bdc854ef71ebb883811dd24220b0

build(docs-infra): auto-generate SW `navigationUrls` from Firebase config (#42452) Previously, redirects had to be configured in both the Firebase config (`firebase.json`) and the ServiceWorker config (`ngsw-config.json`). This made it challenging to correctly configure redirects, since one had to understand the different formats of the two configs, and was also prone to getting out-of-sync configs. This commit simplifies the process of adding redirects by removing the need to update the ServiceWorker config (`ngsw-config.json`) and keep it in sync with the Firebase config (`firebase.json`). Instead the ServiceWorker `navigationUrls` are automatically generated from the list of redirects in the Firebase config. NOTE: Currently, the automatic generation only supports the limited set of patterns that are necessary to translate the existing redirects. It can be made more sophisticated in the future, should the need arise. PR Close #42452

view details

George Kalpakas

commit sha 41123231c5c54c2923f3e41a8a3361416581bbe9

docs(docs-infra): document how to configure redirects (#42452) PR Close #42452

view details

push time in 9 hours

push eventangular/angular

George Kalpakas

commit sha e0338189b3a15c893dd798f05a7d677c6e4c777c

test(docs-infra): add testcases for all redirect rules (#42452) This commit adds testcases in `URLS_TO_REDIRECT.txt` for all redirect rules defined in `firebase.json`. This ensures that all rules are tested and work as expected. PR Close #42452

view details

George Kalpakas

commit sha c66423ab2a194d5563926ccd7b231b3dffbad783

test(docs-infra): unnest unnecessarily nested test suite (#42452) Previously, the `destinations` test suite in `testFirebaseRedirection.spec.ts` was nested under the `with legacy URLs` test suite. However, the two suites are unrelated and there is no reason to have them nested. This commit moves the `destinations` test suite to be beside (instead of inside) the `with legacy URLs` one. PR Close #42452

view details

George Kalpakas

commit sha c397b59855a3869cfac8ddb321071fbe144e88a3

test(docs-infra): ensure all redirect rules are tested (#42452) This commit adds a test assertion to verify that all redirect rules defined in `firebase.json` are tested, i.e. that each rule is applied to at least one testcase from `URLS_TO_REDIRECT.txt`. This will ensure that any redirect rules added in the future will be tested. PR Close #42452

view details

George Kalpakas

commit sha 36fb5744db3586d7c54d33d61274e0847119f07d

build(docs-infra): add missing redirect rule for `api/http` in `firebase.json` (#42452) Previously, only sub-paths, such as `api/http/foo`, were redirected to `guide/deprecations#http`. This commit ensures that also `api/http` itself (which used to point to the `http` module's API page) is redirected as well. PR Close #42452

view details

George Kalpakas

commit sha 4635d4f957cfcc60a7f3f43913924838f6007a48

build(docs-infra): remove redundant `navigationUrls` globs from `ngsw-config.json` (#42452) This commit removes some `navigationUrls` globs from `ngsw-config.json` that have no effect. More specifically: - It removes globs of the form `!/**/xyz.html`, since these are already covered by the more generic `!/**/*.*` glob. - It removes `!/api/**/NgFor`, since it does not have a corresponding redirect rule in `firebase.json`. This is in preparation of automatically generating the ServiceWorker `navigationUrls` based on `firebase.json`. PR Close #42452

view details

George Kalpakas

commit sha 932f24645406f9c4c2f46dfae991bb4772a9fbbe

build(docs-infra): allow a trailing `/` in more `navigationUrls` globs in `ngsw-config.json` (#42452) Previously, we were not consistent in allowing a trailing `/` in `navigationUrls` globs in `ngsw-config.json`. And when we did, we used two globs: one with and one without the trailing `/`. This commit updates all appropriate `navigationUrls` globs to allow a trailing `/`. It also merges the two glob patterns (the one with and the one without the `/`) into one. This is in preparation of automatically generating the ServiceWorker `navigationUrls` based on `firebase.json`. PR Close #42452

view details

George Kalpakas

commit sha fe3c79fe407357216886d1a2e1f9dc82c7fb0204

build(docs-infra): alphabetically sort all `navigationUrls` in `ngsw-config.json` (#42452) This commit sorts all `navigationUrls` in `ngsw-config.json` alphabetically. This is in preparation of automatically generating the ServiceWorker `navigationUrls` based on `firebase.json`. PR Close #42452

view details

George Kalpakas

commit sha 982521f284373e855f186985f1e46ad221a5b6fe

build(docs-infra): align `navigationUrls` in `ngsw-config.json` with Firebase redirects (#42452) The ServiceWorker `navigationUrls` globs defined in `ngsw-config.json` are supposed to exclude any URLs that are redirected on the server (as configured in `firebase.json`). However, the list of redirected URLs/globs in `firebase.json` and `ngsw-config.json` have gotten out of sync. This commit updates the globs in `ngsw-config.json` to match the ones in `firebase.json`. This is in preparation of automatically generating the ServiceWorker `navigationUrls` based on `firebase.json`. PR Close #42452

view details

George Kalpakas

commit sha d07e736f17a8dc0451adf581281b7221227785f2

build(docs-infra): auto-generate SW `navigationUrls` from Firebase config (#42452) Previously, redirects had to be configured in both the Firebase config (`firebase.json`) and the ServiceWorker config (`ngsw-config.json`). This made it challenging to correctly configure redirects, since one had to understand the different formats of the two configs, and was also prone to getting out-of-sync configs. This commit simplifies the process of adding redirects by removing the need to update the ServiceWorker config (`ngsw-config.json`) and keep it in sync with the Firebase config (`firebase.json`). Instead the ServiceWorker `navigationUrls` are automatically generated from the list of redirects in the Firebase config. NOTE: Currently, the automatic generation only supports the limited set of patterns that are necessary to translate the existing redirects. It can be made more sophisticated in the future, should the need arise. PR Close #42452

view details

George Kalpakas

commit sha 44291889eeef6961ee9bec4d90770d134cdce734

docs(docs-infra): document how to configure redirects (#42452) PR Close #42452

view details

push time in 9 hours

PR closed angular/angular

build(docs-infra): simplify configuring redirects action: merge cla: yes comp: build & ci comp: docs-infra target: patch

NOTE: This PR sits on top of #42414 to avoid rebase conflicts. #42414 has been merged.

This PR cleans up the configured Firebase and ServiceWorker redirects and the corresponding tests and simplifies the process of configuring redirects by auto-generating the ServiceWorker config navigationUrls from the Firebase redirects config.

See individual commits for more details.

+318 -191

3 comments

14 changed files

gkalpak

pr closed time in 9 hours

push eventangular/angular

George Kalpakas

commit sha 12644486f4cd68a8ff2fa6cf1ccf907881766183

ci: start tracking CSS payload sizes for angular.io (#42584) Previously, we only tracked the sizes of the eagerly loaded JS bundles. However, the CSS styles (which also have a non-negligible size) must also be downloaded and parsed by the browser, thus affecting the initial rendering time. This commit starts tracking the CSS styles payload sizes. (Originally discussed in https://github.com/angular/angular/pull/42584#discussion_r653787961) PR Close #42584

view details

George Kalpakas

commit sha 0f6ebe1ab51455cee171c92b59c6ea58d8ddf9e1

refactor(docs-infra): remove redundant CSS rule (#42584) Since we now use SVG for external link icons, there are no `<img>` elements inside the anchor elements. So, the CSS rule does not match any element and can be removed. PR Close #42584

view details

George Kalpakas

commit sha fd8f9ab4e8aef0d2a1977bfdf88175ade9cccd13

fix(docs-infra): convert external links to `MatIconButton`s (#42584) This commit changes the anchor elements used for external links to `MatIconButton`s. While the appearance remains the same (with the exception of hover/focus styles), this better aligns the styling of external link icons with other nearby icon buttons (i.e. the theme toggle) and alows as to simplify the CSS for external links (since much of their styling is handled by Angular Material). PR Close #42584

view details

George Kalpakas

commit sha 29302e3baab74198323226e3c2d94f67e1ffa3f4

fix(docs-infra): remove redundant `MatIcon` element (#42584) Previously, we included a dummy `MatIcon` element in `AppComponent` in order to ensure that the `Material Icons` font would be requested (and thus cached by the ServiceWorker) on every navigation. However, #41129 introduced the `ThemeToggleComponent`, which will be present on all pages (since it is located in the top-menu) and relies on the `Material Icons` font. Therefore, the work-around for loading the `Material Icons` font is no longer necessary. This commit removes the now redundant `MatIcon` from `AppComponent`. PR Close #42584

view details

George Kalpakas

commit sha 0c105c38daf957f72bf202f840e374c4d1c2d8cf

fix(docs-infra): make `NotificationComponent` elements non-focusable when hidden (#42584) Previously, the `NotificationComponent` would be hidden by reducing its height to `0`. This allowed for a smoother hide animation when closing the notification, but left the component's interactive elements focusable via keyboard navigation. This was confusing for users, because the focused elements would not be visible on the page. This commit fixes the issue be also setting the `display` CSS property to `none` when the `NotificationComponent` is hidden, thus ensuring that its contents are not focusable via keyboard navigation. (This does not affect the hide animation, since the `display` style is not animatable and is only applied at the end of the animation.) PR Close #42584

view details

push time in 9 hours