Commit graph

675 commits

Author SHA1 Message Date
Alan Agius
9d1fb33f5e fix(core): introduce BootstrapContext for improved server bootstrapping (#63640)
This commit introduces a number of changes to the server bootstrapping process to make it more robust and less error-prone, especially for concurrent requests.

Previously, the server rendering process relied on a module-level global platform injector. This could lead to issues in server-side rendering environments where multiple requests are processed concurrently, as they could inadvertently share or overwrite the global injector state.

The new approach introduces a `BootstrapContext` that is passed to the `bootstrapApplication` function. This context provides a platform reference that is scoped to the individual request, ensuring that each server-side render has an isolated platform injector. This prevents state leakage between concurrent requests and makes the overall process more reliable.

BREAKING CHANGE:
The server-side bootstrapping process has been changed to eliminate the reliance on a global platform injector.

Before:
```ts
const bootstrap = () => bootstrapApplication(AppComponent, config);
```

After:
```ts
const bootstrap = (context: BootstrapContext) =>
  bootstrapApplication(AppComponent, config, context);
```

A schematic is provided to automatically update `main.server.ts` files to pass the `BootstrapContext` to the `bootstrapApplication` call.

In addition, `getPlatform()` and `destroyPlatform()` will now return `null` and be a no-op respectively when running in a server environment.

(cherry picked from commit 8bf80c9d2314b4f2bcf3df83ae01552a6fc49834)

PR Close #63640
2025-09-09 10:46:27 -07:00
Angular Robot
32512de80d docs: update Angular CLI help [18.2.x] (#59767)
Updated Angular CLI help contents.

PR Close #59767
2025-01-29 10:53:21 -08:00
prasantht96
c6cec5eefa docs: angular dev v18 page issue fix (#58848)
PR Close #58848
2024-11-26 14:48:54 +00:00
marktechson
88072c879d docs: add v19 developer event banner (#58721)
PR Close #58721
2024-11-18 12:48:46 -08:00
Guillaume MOREAU
6fef9b5e0f docs: fix typo in build system migration doc (#58668)
PR Close #58668
2024-11-14 14:18:13 -08:00
Jens Kuehlers
d9009c12eb docs: add State of JS 2024 banner (#58649)
PR Close #58649
2024-11-14 14:53:19 +00:00
Julio Massano Santos
8e5228f584 docs: adds interceptor testing (#57568)
PR Close #57568
2024-11-14 14:50:42 +00:00
ashish
caeeee7fad docs(docs-infra): Fixed grammatical error (#58611)
PR Close #58611
2024-11-12 14:48:11 +00:00
Matthieu Riegler
90603ec601 docs: fix link in 6-property-binding tutorial (#58594)
fixes #58588

PR Close #58594
2024-11-12 14:44:59 +00:00
Anner Visser
2fbc7f077f docs: Fix menu label for ng cache clean, clear -> clean (#58560)
PR Close #58560
2024-11-08 17:28:03 +00:00
Teun Willems
f3567cc29e docs: remove foreach from testing.md as it's not a JS function (#58565)
Foreach was present in the documentation even though it's not valid Javascript

PR Close #58565
2024-11-08 17:16:43 +00:00
Alan Agius
3d8f827ec7 fix(docs-infra): retain function keyword in API definitions (#58561)
**Before:**
```ts
animate(
  timings: string | number,
  styles?: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata | null
): AnimationAnimateMetadata;
```

**Now:**
```ts
function animate(
  timings: string | number,
  styles?: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata | null
): AnimationAnimateMetadata;
```

PR Close #58561
2024-11-08 17:16:05 +00:00
Alan Agius
4c38160853 fix(compiler-cli): correct extraction of generics from type aliases (#58548)
**Before:**
```ts
type HttpEvent = | HttpSentEvent
  | HttpHeaderResponse
  | HttpResponse<T>
  | HttpProgressEvent
  | HttpUserEvent<T>
```

**After:**
```ts
type HttpEvent<T> = | HttpSentEvent
  | HttpHeaderResponse
  | HttpResponse<T>
  | HttpProgressEvent
  | HttpUserEvent<T>
```

PR Close #58548
2024-11-08 17:15:08 +00:00
Alan Agius
9199dd9a87 docs(docs-infra): update default generic values and add constraints for type parameters in functions (#58548)
Before
```typescript
createNodeRequestHandler(
  handler: T
): T;
```

```typescript
class NgIf<T> {
  @Input() set ngIf(value: T);
  @Input() set ngIfThen(value: TemplateRef<NgIfContext<T>> | null);
  @Input() set ngIfElse(value: TemplateRef<NgIfContext<T>> | null);
  static ngTemplateGuard_ngIf: "binding";
  static ngTemplateContextGuard<T>(dir: NgIf<T>, ctx: any): boolean;
}
```

Now
```typescript
createNodeRequestHandler<T extends NodeRequestHandlerFunction>(
  handler: T
): T;
```

```typescript
class NgIf<T = unknown> {
  @Input() set ngIf(value: T);
  @Input() set ngIfThen(value: TemplateRef<NgIfContext<T>> | null);
  @Input() set ngIfElse(value: TemplateRef<NgIfContext<T>> | null);
  static ngTemplateGuard_ngIf: "binding";
  static ngTemplateContextGuard<T>(dir: NgIf<T>, ctx: any): boolean;
}
```

PR Close #58548
2024-11-08 17:15:07 +00:00
Alan Agius
5a236c2c5c docs(docs-infra): add support for @remarks (#58523)
In TSDoc, we currently handle the `@usageNotes` annotation, but this is not a standard TSDoc tag. Instead, the `@remarks` annotation is the correct standard, which is used in the Angular CLI repo and on the SSR package.

This change ensures that `@remarks` is treated the same as `@usageNotes` during the transform process.

PR Close #58523
2024-11-07 15:49:14 +00:00
Madhu Ranjan
6c80778576 docs: fix example for pipe operator precedence by removing extra parenthesis (#58488)
PR Close #58488
2024-11-06 07:00:40 +01:00
Koyejo
21a4c027e2 docs: fix grammatical error in template binding documentation (#58491)
This update corrects a grammatical error in the "CSS style properties" section of the template binding documentation. The sentence "You must create a new object instance when you modify these values in order to Angular to apply any updates" was updated to read correctly as "You must create a new object instance when you modify these values in order for Angular to apply any updates." This clarification helps improve readability and ensures the documentation communicates instructions accurately for readers.
PR Close #58491
2024-11-04 17:15:38 +01:00
Shannon V.C.
a249d0b857 docs: fix external link in NG0100 error page (#58462)
Fixes external link for 'Everything you need to know about the "ExpressionChangedAfterItHasBeenCheckedError" error' on the NG0100 error page.
Domain has changed from indepth.dev to angularindepth.com

PR Close #58462
2024-11-01 14:34:30 +00:00
Alan Agius
582858568a fix(docs-infra): reduce margin-block-start from doc anchor headers (#58431)
This change reduces the spacing between headers, which is currently excessive.

PR Close #58431
2024-10-31 09:15:35 +01:00
george looshch
29660f2df9 docs: remove an unnecessary whitespace (#58388)
Remove an unnecessary whitespace between an opening parenthesis and a
word in the documentation on lifecycle.

Closes #58380

PR Close #58388

PR Close #58388
2024-10-28 12:49:37 -07:00
george looshch
7d67bd3067 docs: fix backtick escaping in a Markdown file (#58387)
Fix backtick escaping for the template string example in the
documentation on expression syntax.

Closes #58382

PR Close #58387

PR Close #58387
2024-10-28 12:49:00 -07:00
Jeevan Mahesha
1feaa9fd25 docs: update ProfileEditorComponent to use inject() for FormBuilder (#58378)
PR Close #58378
2024-10-28 12:48:28 -07:00
Matthieu Riegler
7e933d8486 docs(docs-infra): fix CLI commands (#58294)
With this commit the CLI doc will display the correct arguments for the subcommands

fixes #58279

PR Close #58294
2024-10-22 07:42:22 -07:00
Todd Palmer
ac6e977663 docs: fix typo in tutorial - change style.css to styles.css to correct style sheet file name (#58269)
PR Close #58269
2024-10-19 17:43:20 +02:00
Daniel Kimmich
b63c2edd76 docs: update default asset paths (#58246)
PR Close #58246
2024-10-18 14:35:31 +00:00
wlotherington
98c9ac8f92 docs(docs-infra): fix playground terminal/console (#58257)
xterm was not resizing correctly when terminal/console component was resized.
- Load fitAddon for each terminal instance to enable resize.
- Use `ResizeObserver` to detect changes to the component size changes (window resize does not catch `as-split` events).
- Move padding from `.xterm-screen` to `.xterm` ancestor to fix text alignment.

Fixes #52645

PR Close #58257
2024-10-18 09:25:36 +00:00
wlotherington
e60d016f46 docs(docs-infra): change mermaid diagram colors (#58223)
Change diagram colors to:

- Better match the overall site theme.
- Improve dark theme.
- Make the diagram easier to understand. "Unchecked" nodes have no color and "Checked" nodes match the color of the "Event" node that triggered the change detection.

Fixes #56314

PR Close #58223
2024-10-16 16:46:17 +00:00
Alan Agius
06f45c3d59 docs: update browserslist config to include last 2 Android major versions (#58186)
See: https://github.com/angular/angular-cli/pull/28620 for more context.

PR Close #58186
2024-10-15 16:48:59 +00:00
Daniel Kimmich
c1f4a47457 docs: remove word repetition (#58187)
PR Close #58187
2024-10-14 13:19:42 +00:00
Steven Tucker
00de13c909 docs: Updated event-listeners.md doc to use correct term, even -> every (#57964)
event time -> every time

PR Close #57964
2024-10-10 12:36:41 +00:00
arturovt
79a89f7742 refactor(docs-infra): allow table of contents to be GCed (#58034)
This commit updates the table of contents functionality to clean up correctly whenever the user
navigates to other pages and nodes are removed from the DOM.

Currently, calling `renderComponent` with the `TableOfContents` keeps creating a new table of contents
component without removing the previous one, as they are created manually.

This leads to memory leaks because the components cannot be collected properly, even if the user
navigates to the home page where there is no TOC component.

PR Close #58034
2024-10-10 12:33:51 +00:00
reosablo
da0e6b1eee docs(core): fix description about signal value equality (#56472)
PR Close #56472
2024-10-10 10:24:33 +00:00
Jaime González Fábregas
45a788b0b7 docs(docs-infra): substitute string interpolation on json data with actual value (#57626)
substitute "${this.baseUrl}" with "https://angular.dev/assets/images/tutorials/common" in the photo url on the json data provided on the hands on tutorial in the webpage "https://angular.dev/tutorials/first-app/14-http". The previous json content caused the images to fail loading.

PR Close #57626
2024-10-10 10:22:34 +00:00
ColinJolivet
9f2726bb43 refactor(docs-infra): add tooltip to the download button in playground (#58065)
Add a material tooltip to the download button in the playground in order to clarify what this button does

PR Close #58065
2024-10-08 09:28:37 -07:00
Lang
490786af10 docs: complete the example in use InjectionToken section (#57839)
PR Close #57839
2024-10-08 09:27:23 -07:00
Luan Gong
7eb264a017 docs: use correct heading in templates guide (#58101)
PR Close #58101
2024-10-07 08:22:46 -07:00
Matthieu Riegler
0e225ce16b docs(docs-infra): Add NgModule exports for directives. (#58071)
This information is extracted from the @NgModule Jsdoc tag.

fixes #57906

PR Close #58071
2024-10-04 14:46:17 -07:00
JoostK
39a851fa55 refactor: change security issue redirect to angular.dev (#58070)
Ensure the security issue template points to the correct location.

PR Close #58070
2024-10-04 10:57:43 -07:00
Stanka Kopalova
91874a7c41 docs: add better title name (#58060)
PR Close #58060
2024-10-04 10:57:08 -07:00
Stanka Kopalova
3b06a09df2 docs: fix wrong title of section (#58060)
PR Close #58060
2024-10-04 10:57:08 -07:00
Jeevan Mahesha
44cb2f8131 docs: add documentation for lazy loading a standalone component (#57620)
Added a new section in the documentation explaining how to lazy load a standalone component using `loadComponent`. This includes a code example demonstrating the setup in Angular routes.

PR Close #57620
2024-10-04 13:31:52 +00:00
vladboisa
694fe3faab fix(docs-infra): fix calculation of height editor (#54128)
Apply the min() function for set the smallest height

fix(docs-infra): move height into editor-wrapper

Move the calculation rule of height edit into editor-wrapper selector

fix(docs-infra): change has selector

Change the has selector

fix(docs-infra): change selector's for child

Changing the selector for test this solution

Fix

PR Close #54128
2024-10-03 16:43:03 +00:00
vladboisa
ca5bc0c5bd feat(docs-infra): add transition on editor wrapper (#54128)
Add the smooth animation when height of the container is changing

PR Close #54128
2024-10-03 16:43:03 +00:00
vladboisa
3d1fd3442e fix(docs-infra): max-height IDE error panel visibility (#54128)
Remove max-height: 200px in ul child inline-errors-box, add the overflow & max-height in percentages to the parent for correct visualization

Fixes #52760

refactor(docs-infra): correct typo
Correct typo in comment

feat(docs-infra): modify the height of the editor
If error box are displayed, modify the height of the editor

PR Close #54128
2024-10-03 16:43:03 +00:00
Andrew Seguin
8f6560857c docs: reword when to use model inputs (#57648)
PR Close #57648
2024-10-03 16:42:18 +00:00
arturovt
dc911c635a refactor(docs-infra): cleanup AfterRenderSequence for reference list (#58030)
In this commit, we're replacing the provided injector in `afterNextRender` with a node injector
because it was previously mistakenly passing an `EnvironmentInjector`. The `EnvironmentInjector`
resolves `DestroyRef` to itself, meaning that `AfterRenderSequence` is essentially never destroyed
(since the environment injector is not destroyed either).

PR Close #58030
2024-10-02 18:01:31 +00:00
Suat Oğulcan Özcan
c48816e123 docs: remove whitespace (#58042)
PR Close #58042
2024-10-02 11:26:28 +00:00
Sam Verschueren
70591e7de0 docs: use proper workdir for tutorial and playground (#56063)
PR Close #56063
2024-10-01 16:09:54 +00:00
arturovt
a21867df6a fix(docs-infra): allow tutorial component to be GCed (#58028)
This commit updates the tutorial component's functionality to unsubscribe from the route
data observable and stop monitoring the resizer element when the component is destroyed.
This is necessary because `monitor` adds event listeners that prevent the element and
component from being garbage collected.

PR Close #58028
2024-10-01 13:51:06 +00:00
ilir.beqiri
8d8fb44ec1 docs: update the name of the sub-navigation item at error encyclopedia menu (#57997)
PR Close #57997
2024-10-01 08:32:09 +00:00