Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new pull request by comparing changes across two branches #234

Merged
merged 36 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c9d9078
fix(upgrade): Address Trusted Types violations in @angular/upgrade (#…
bjarkler Aug 19, 2024
34ce46f
docs: fix formating in class-binding (#57447)
JeanMeche Aug 19, 2024
4716c3b
perf(compiler-cli): reduce duplicate component style resolution (#57502)
clydin Aug 23, 2024
46a9569
build: update to TypeScript 5.6 RC (#57507)
crisbeto Aug 24, 2024
6307f97
docs: update Angular CLI help [main] (#57508)
angular-robot Aug 24, 2024
969dadc
docs: fix typo in recommendations.ts (#57521)
realstealthninja Aug 26, 2024
bfda774
fix(devtools): catch invalidated extension error to prevent devtools …
AleksanderBodurri May 6, 2024
564a8d5
docs(docs-infra): Add query as an url query param to the api referenc…
mvdluit Jul 20, 2024
122af30
refactor(core): Merge autoDetectChanges behaviors between fixtures (#…
atscott Aug 15, 2024
4e594e1
refactor(core): Move ngZone subscription to base implementation (#57416)
atscott Aug 15, 2024
455cd1e
refactor(core): Merge implementations of ComponentFixture (#57416)
atscott Aug 15, 2024
6a7c5ae
refactor(core): allow disabling checkNoChanges with zoneless (#57416)
atscott Aug 15, 2024
0300dd2
fix(core): Fix fixture.detectChanges with autoDetect disabled and zon…
atscott Aug 26, 2024
dab722f
refactor(compiler): add `i18nPreserveWhitespaceForLegacyExtraction` (…
dgp1130 Jun 17, 2024
5a0ff41
refactor(compiler): ensure context is always provided for `Whitespace…
dgp1130 Jul 19, 2024
50f08e6
feat(common): automatically use sizes auto in NgOptimizedImage (#57479)
atcastle Aug 21, 2024
7b1e5be
fix(core): fallback to default ng-content with empty projectable node…
chintankavathia Aug 22, 2024
d73f2e9
refactor(animations): Add loading strategy for the Async Animations (…
JeanMeche Aug 26, 2024
5fed53a
build: update dependency jsdom to v25 (#57514)
angular-robot Aug 25, 2024
99e4057
fix(devtools): ignore DOM Nodes from other frames when performing ren…
AleksanderBodurri Aug 26, 2024
6f5b435
refactor(migrations): initial migration logic for converting to signa…
devversion Aug 26, 2024
f454ad3
refactor(migrations): properly handle multi query migration (#57525)
devversion Aug 27, 2024
8f63084
fix(router): Do not unnecessarily run matcher twice on route matching…
atscott Aug 26, 2024
37f8c9a
ci: fix fw-testing group triggering for schematics testing changes (#…
devversion Aug 26, 2024
ca2610f
refactor(compiler): extend directive mock to avoid failing at matchin…
AndrewKushnir Aug 26, 2024
85e08c6
build: update dependency @babel/generator to v7.25.5 (#57542)
angular-robot Aug 27, 2024
9779227
build: update github/codeql-action action to v3.26.5 (#57543)
angular-robot Aug 27, 2024
099955b
build: remove Sourcemaps from Schematics bundles (#57545)
alan-agius4 Aug 27, 2024
a3cdbfe
fix(core): avoid leaking memory if component throws during creation (…
crisbeto Aug 27, 2024
96b698c
test: avoid leaking some LViews in tests (#57546)
crisbeto Aug 27, 2024
5ba8ea8
build: update to latest version of @angular/build-tooling (#57551)
josephperrott Aug 27, 2024
90b5fef
fix(docs-infra): Fix scrolling in application (#57554)
atscott Aug 27, 2024
21445a2
fix(http): Dynamicaly call the global fetch implementation (#57531)
JeanMeche Aug 26, 2024
0ba2a95
Revert "refactor(migrations): properly handle multi query migration (…
alxhub Aug 27, 2024
76b9e2b
Revert "refactor(migrations): initial migration logic for converting …
alxhub Aug 27, 2024
226a67d
fix(core): Schedulers run in zone above Angular rather than root (#57…
atscott Aug 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@883d8588e56d1753a8a58c1c86e88976f0c23449 # v3.26.3
uses: github/codeql-action/upload-sarif@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .pullapprove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ groups:
<<: *defaults
conditions:
- >
contains_any_globs(files.exclude('packages/compiler-cli/*').exclude('packages/language-service/*').exclude('packages/service-worker/*'), [
contains_any_globs(files.exclude('packages/compiler-cli/*').exclude('packages/language-service/*').exclude('packages/service-worker/*').exclude('packages/core/schematics/*'), [
'packages/**/testing/**/{*,.*}',
])
reviewers:
Expand Down
1 change: 1 addition & 0 deletions adev/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ http_server(
"angular/adev/build/browser",
],
enable_dev_ui = True,
relax_cors = True,
deps = [":build"],
)

Expand Down
2 changes: 1 addition & 1 deletion adev/shared-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"fast-glob": "~3.3.2",
"fflate": "^0.8.2",
"html-entities": "~2.5.2",
"jsdom": "~24.1.0",
"jsdom": "~25.0.0",
"marked": "~14.0.0",
"mermaid": "^11.0.0",
"shiki": "^1.10.3"
Expand Down
14 changes: 12 additions & 2 deletions adev/src/app/app-scroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ export class AppScroller {
this._lastScrollEvent = e;
}),
filter(() => !this.disableScrolling),
filter(() => {
const info = this.router.lastSuccessfulNavigation?.extras.info as Record<
'disableScrolling',
boolean
>;
return !info?.['disableScrolling'];
}),
switchMap((e) => {
return firstValueFrom(
this.appRef.isStable.pipe(
Expand All @@ -64,7 +71,7 @@ export class AppScroller {
const {anchor, position} = this._lastScrollEvent;

// Don't scroll during rendering
this.cancelScroll = afterNextRender(
const ref = afterNextRender(
{
write: () => {
if (position) {
Expand All @@ -77,6 +84,9 @@ export class AppScroller {
},
},
{injector: this.injector},
).destroy;
);
this.cancelScroll = () => {
ref.destroy();
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h3 [attr.id]="group.id">
@if (group.isFeatured) {
<docs-icon aria-hidden>star</docs-icon>
}
<a routerLink="/api" [fragment]="group.id" class="adev-api-anchor" tabindex="-1">{{ group.title }}</a>
<a routerLink="/api" [fragment]="group.id" queryParamsHandling="preserve" class="adev-api-anchor" tabindex="-1">{{ group.title }}</a>
</h3>
</header>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {signal} from '@angular/core';
import {ApiItemType} from '../interfaces/api-item-type';
import {RouterTestingHarness} from '@angular/router/testing';
import {provideRouter} from '@angular/router';
import {Location} from '@angular/common';

describe('ApiReferenceList', () => {
let component: ApiReferenceList;
Expand Down Expand Up @@ -117,4 +118,30 @@ describe('ApiReferenceList', () => {
harness.navigateByUrl(`/api`);
expect(component.type()).toBe(ALL_STATUSES_KEY);
});

it('should set the value of the queryParam equal to the query value', async () => {
const location = TestBed.inject(Location);
component.query.set('item1');
await fixture.whenStable();
expect(location.path()).toBe(`?query=item1&type=All`);
});

it('should keep the values of existing queryParams and set new queryParam equal to the type', async () => {
const location = TestBed.inject(Location);

component.query.set('item1');
await fixture.whenStable();
expect(location.path()).toBe(`?query=item1&type=All`);

component.filterByItemType(ApiItemType.BLOCK);
await fixture.whenStable();
expect(location.path()).toBe(`?query=item1&type=${ApiItemType.BLOCK}`);
});

it('should display all items when query and type are undefined', async () => {
component.query.set(undefined);
component.type.set(undefined);
await fixture.whenStable();
expect(component.filteredGroups()![0].items).toEqual([fakeItem1, fakeItem2]);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import ApiItemsSection from '../api-items-section/api-items-section.component';
import {FormsModule} from '@angular/forms';
import {SlideToggle, TextField} from '@angular/docs';
import {NgFor, NgIf} from '@angular/common';
import {Params, Router} from '@angular/router';
import {ApiItemType} from '../interfaces/api-item-type';
import {ApiReferenceManager} from './api-reference-manager.service';
import ApiItemLabel from '../api-item-label/api-item-label.component';
Expand Down Expand Up @@ -50,6 +51,7 @@ export const ALL_STATUSES_KEY = 'All';
})
export default class ApiReferenceList {
private readonly apiReferenceManager = inject(ApiReferenceManager);
private readonly router = inject(Router);
filterInput = viewChild.required(TextField, {read: ElementRef});
private readonly injector = inject(EnvironmentInjector);

Expand All @@ -71,9 +73,28 @@ export default class ApiReferenceList {
{injector: this.injector},
);
});

effect(
() => {
const params: Params = {
'query': this.query() ? this.query() : null,
'type': this.type() ? this.type() : null,
};

this.router.navigate([], {
queryParams: params,
replaceUrl: true,
preserveFragment: true,
info: {
disableScrolling: true,
},
});
},
{allowSignalWrites: true},
);
}

query = signal('');
query = model<string | undefined>('');
includeDeprecated = signal(false);

type = model<string | undefined>(ALL_STATUSES_KEY);
Expand All @@ -87,8 +108,10 @@ export default class ApiReferenceList {
id: group.id,
items: group.items.filter((apiItem) => {
return (
(this.query()
? apiItem.title.toLocaleLowerCase().includes(this.query().toLocaleLowerCase())
(this.query() !== undefined
? apiItem.title
.toLocaleLowerCase()
.includes((this.query() as string).toLocaleLowerCase())
: true) &&
(this.includeDeprecated() ? true : apiItem.isDeprecated === this.includeDeprecated()) &&
(this.type() === undefined ||
Expand Down
2 changes: 1 addition & 1 deletion adev/src/app/features/update/recommendations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,7 @@ export const RECOMMENDATIONS: Step[] = [
level: ApplicationComplexity.Basic,
step: 'v17 zone.js support',
action:
'Make sure that you are using a supported version of Zone.js before you upgrade your application. Angular v16 supports Zone.js version 0.14.x or later.',
'Make sure that you are using a supported version of Zone.js before you upgrade your application. Angular v17 supports Zone.js version 0.14.x or later.',
},
{
possibleIn: 1700,
Expand Down
2 changes: 1 addition & 1 deletion adev/src/content/cli/help/build-info.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"branchName": "refs/heads/main",
"sha": "b08d472c072301d166137a1bc3634607682de2ad"
"sha": "3513cd179d428e6c8d6529f1010dac65282a8a44"
}
2 changes: 1 addition & 1 deletion adev/src/content/cli/help/completion.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"command": "ng completion",
"shortDescription": "Set up Angular CLI autocompletion for your terminal.",
"longDescriptionRelativePath": "@angular/cli/src/commands/completion/long-description.md",
"longDescription": "Setting up autocompletion configures your terminal, so pressing the `<TAB>` key while in the middle\nof typing will display various commands and options available to you. This makes it very easy to\ndiscover and use CLI commands without lots of memorization.\n\n![A demo of Angular CLI autocompletion in a terminal. The user types several partial `ng` commands,\nusing autocompletion to finish several arguments and list contextual options.\n](assets/images/guide/cli/completion.gif)\n\n## Automated setup\n\nThe CLI should prompt and ask to set up autocompletion for you the first time you use it (v14+).\nSimply answer \"Yes\" and the CLI will take care of the rest.\n\n```\n$ ng serve\n? Would you like to enable autocompletion? This will set up your terminal so pressing TAB while typing Angular CLI commands will show possible options and autocomplete arguments. (Enabling autocompletion will modify configuration files in your home directory.) Yes\nAppended `source <(ng completion script)` to `/home/my-username/.bashrc`. Restart your terminal or run:\n\nsource <(ng completion script)\n\nto autocomplete `ng` commands.\n\n# Serve output...\n```\n\nIf you already refused the prompt, it won't ask again. But you can run `ng completion` to\ndo the same thing automatically.\n\nThis modifies your terminal environment to load Angular CLI autocompletion, but can't update your\ncurrent terminal session. Either restart it or run `source <(ng completion script)` directly to\nenable autocompletion in your current session.\n\nTest it out by typing `ng ser<TAB>` and it should autocomplete to `ng serve`. Ambiguous arguments\nwill show all possible options and their documentation, such as `ng generate <TAB>`.\n\n## Manual setup\n\nSome users may have highly customized terminal setups, possibly with configuration files checked\ninto source control with an opinionated structure. `ng completion` only ever appends Angular's setup\nto an existing configuration file for your current shell, or creates one if none exists. If you want\nmore control over exactly where this configuration lives, you can manually set it up by having your\nshell run at startup:\n\n```bash\nsource <(ng completion script)\n```\n\nThis is equivalent to what `ng completion` will automatically set up, and gives power users more\nflexibility in their environments when desired.\n\n## Platform support\n\nAngular CLI supports autocompletion for the Bash and Zsh shells on MacOS and Linux operating\nsystems. On Windows, Git Bash and [Windows Subsystem for Linux](https://docs.microsoft.com/windows/wsl/)\nusing Bash or Zsh are supported.\n\n## Global install\n\nAutocompletion works by configuring your terminal to invoke the Angular CLI on startup to load the\nsetup script. This means the terminal must be able to find and execute the Angular CLI, typically\nthrough a global install that places the binary on the user's `$PATH`. If you get\n`command not found: ng`, make sure the CLI is installed globally which you can do with the `-g`\nflag:\n\n```bash\nnpm install -g @angular/cli\n```\n",
"longDescription": "Setting up autocompletion configures your terminal, so pressing the `<TAB>` key while in the middle\nof typing will display various commands and options available to you. This makes it very easy to\ndiscover and use CLI commands without lots of memorization.\n\n![A demo of Angular CLI autocompletion in a terminal. The user types several partial `ng` commands,\nusing autocompletion to finish several arguments and list contextual options.\n](assets/images/guide/cli/completion.gif)\n\n## Automated setup\n\nThe CLI should prompt and ask to set up autocompletion for you the first time you use it (v14+).\nSimply answer \"Yes\" and the CLI will take care of the rest.\n\n```\n$ ng serve\n? Would you like to enable autocompletion? This will set up your terminal so pressing TAB while typing Angular CLI commands will show possible options and autocomplete arguments. (Enabling autocompletion will modify configuration files in your home directory.) Yes\nAppended `source <(ng completion script)` to `/home/my-username/.bashrc`. Restart your terminal or run:\n\nsource <(ng completion script)\n\nto autocomplete `ng` commands.\n\n# Serve output...\n```\n\nIf you already refused the prompt, it won't ask again. But you can run `ng completion` to\ndo the same thing automatically.\n\nThis modifies your terminal environment to load Angular CLI autocompletion, but can't update your\ncurrent terminal session. Either restart it or run `source <(ng completion script)` directly to\nenable autocompletion in your current session.\n\nTest it out by typing `ng ser<TAB>` and it should autocomplete to `ng serve`. Ambiguous arguments\nwill show all possible options and their documentation, such as `ng generate <TAB>`.\n\n## Manual setup\n\nSome users may have highly customized terminal setups, possibly with configuration files checked\ninto source control with an opinionated structure. `ng completion` only ever appends Angular's setup\nto an existing configuration file for your current shell, or creates one if none exists. If you want\nmore control over exactly where this configuration lives, you can manually set it up by having your\nshell run at startup:\n\n```bash\nsource <(ng completion script)\n```\n\nThis is equivalent to what `ng completion` will automatically set up, and gives power users more\nflexibility in their environments when desired.\n\n## Platform support\n\nAngular CLI supports autocompletion for the Bash and Zsh shells on MacOS and Linux operating\nsystems. On Windows, Git Bash and [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/)\nusing Bash or Zsh are supported.\n\n## Global install\n\nAutocompletion works by configuring your terminal to invoke the Angular CLI on startup to load the\nsetup script. This means the terminal must be able to find and execute the Angular CLI, typically\nthrough a global install that places the binary on the user's `$PATH`. If you get\n`command not found: ng`, make sure the CLI is installed globally which you can do with the `-g`\nflag:\n\n```bash\nnpm install -g @angular/cli\n```\n",
"aliases": [],
"deprecated": false,
"options": [
Expand Down
6 changes: 0 additions & 6 deletions adev/src/content/cli/help/extract-i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
"aliases": [],
"deprecated": false,
"options": [
{
"name": "browser-target",
"type": "string",
"deprecated": "Use 'buildTarget' instead.",
"description": "A browser builder target to extract i18n messages in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`."
},
{
"name": "build-target",
"type": "string",
Expand Down
6 changes: 6 additions & 0 deletions adev/src/content/cli/help/generate.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@
"default": false,
"description": "The declaring NgModule exports this component."
},
{
"name": "export-default",
"type": "boolean",
"default": false,
"description": "Use default export for the component instead of a named export."
},
{
"name": "flat",
"type": "boolean",
Expand Down
6 changes: 0 additions & 6 deletions adev/src/content/cli/help/serve.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
"type": "array",
"description": "List of hosts that are allowed to access the dev server. This option has no effect when using the 'application' or other esbuild-based builders."
},
{
"name": "browser-target",
"type": "string",
"deprecated": "Use 'buildTarget' instead.",
"description": "A browser builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`."
},
{
"name": "build-target",
"type": "string",
Expand Down
2 changes: 2 additions & 0 deletions adev/src/content/guide/image-optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ If you haven't used `sizes` before, a good place to start is to set it based on

If you find that the above does not cover your desired image behavior, see the documentation on [advanced sizes values](#advanced-sizes-values).

Note that `NgOptimizedImage` automatically prepends `"auto"` to the provided `sizes` value. This is an optimization that increases the accuracy of srcset selection on browsers which support `sizes="auto"`, and is ignored by browsers which do not.

By default, the responsive breakpoints are:

`[16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840]`
Expand Down
13 changes: 7 additions & 6 deletions adev/src/content/guide/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,13 @@ See [caniuse.com/trusted-types](https://caniuse.com/trusted-types) for the curre

To enforce Trusted Types for your application, you must configure your application's web server to emit HTTP headers with one of the following Angular policies:

| Policies | Detail |
| :---------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `angular` | This policy is used in security-reviewed code that is internal to Angular, and is required for Angular to function when Trusted Types are enforced. Any inline template values or content sanitized by Angular is treated as safe by this policy. |
| `angular#unsafe-bypass` | This policy is used for applications that use any of the methods in Angular's [DomSanitizer](api/platform-browser/DomSanitizer) that bypass security, such as `bypassSecurityTrustHtml`. Any application that uses these methods must enable this policy. |
| `angular#unsafe-jit` | This policy is used by the [Just-In-Time (JIT) compiler](api/core/Compiler). You must enable this policy if your application interacts directly with the JIT compiler or is running in JIT mode using the [platform browser dynamic](api/platform-browser-dynamic/platformBrowserDynamic). |
| `angular#bundler` | This policy is used by the Angular CLI bundler when creating lazy chunk files. |
| Policies | Detail |
| :----------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `angular` | This policy is used in security-reviewed code that is internal to Angular, and is required for Angular to function when Trusted Types are enforced. Any inline template values or content sanitized by Angular is treated as safe by this policy. |
| `angular#bundler` | This policy is used by the Angular CLI bundler when creating lazy chunk files. |
| `angular#unsafe-bypass` | This policy is used for applications that use any of the methods in Angular's [DomSanitizer](api/platform-browser/DomSanitizer) that bypass security, such as `bypassSecurityTrustHtml`. Any application that uses these methods must enable this policy. |
| `angular#unsafe-jit` | This policy is used by the [Just-In-Time (JIT) compiler](api/core/Compiler). You must enable this policy if your application interacts directly with the JIT compiler or is running in JIT mode using the [platform browser dynamic](api/platform-browser-dynamic/platformBrowserDynamic). |
| `angular#unsafe-upgrade` | This policy is used by the [@angular/upgrade](api/upgrade/static/UpgradeModule) package. You must enable this policy if your application is an AngularJS hybrid. |

You should configure the HTTP headers for Trusted Types in the following locations:

Expand Down
Loading
Loading