From 39d2ea0a4d7c221921ff8bd9d29bd2db69fae641 Mon Sep 17 00:00:00 2001 From: Matthieu Riegler Date: Fri, 28 Apr 2023 10:00:57 +0200 Subject: [PATCH] docs: remove mentions of the WebWorker platform (#50059) The webworker platform was dropped in v11. PR Close #50059 --- aio/content/guide/testing-utility-apis.md | 2 +- packages/core/src/linker/element_ref.ts | 13 +------------ packages/core/src/render/api.ts | 2 -- .../src/render3/instructions/element_validation.ts | 2 +- packages/core/src/render3/interfaces/document.ts | 2 +- 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/aio/content/guide/testing-utility-apis.md b/aio/content/guide/testing-utility-apis.md index b015faaee27..5cbe94f96b3 100644 --- a/aio/content/guide/testing-utility-apis.md +++ b/aio/content/guide/testing-utility-apis.md @@ -135,7 +135,7 @@ Here are the most useful `DebugElement` members for testers, in approximate orde | Members | Details | |:--- |:--- | -| `nativeElement` | The corresponding DOM element in the browser \(null for WebWorkers\). | +| `nativeElement` | The corresponding DOM element in the browser | | `query` | Calling `query(predicate: Predicate)` returns the first `DebugElement` that matches the [predicate](#query-predicate) at any depth in the subtree. | | `queryAll` | Calling `queryAll(predicate: Predicate)` returns all `DebugElements` that matches the [predicate](#query-predicate) at any depth in subtree. | | `injector` | The host dependency injector. For example, the root element's component instance injector. | diff --git a/packages/core/src/linker/element_ref.ts b/packages/core/src/linker/element_ref.ts index 83e0b97900e..a54cf23ea7f 100644 --- a/packages/core/src/linker/element_ref.ts +++ b/packages/core/src/linker/element_ref.ts @@ -49,25 +49,14 @@ export function createElementRef(tNode: TNode, lView: LView): ElementRef { // and could do better codegen in the future. export class ElementRef { /** - * The underlying native element or `null` if direct access to native elements is not supported - * (e.g. when the application runs in a web worker). - * *
*
Use with caution
*

* Use this API as the last resort when direct access to DOM is needed. Use templating and * data-binding provided by Angular instead. Alternatively you can take a look at {@link - * Renderer2} - * which provides API that can safely be used even when direct access to native elements is not - * supported. - *

- *

- * Relying on direct DOM access creates tight coupling between your application and rendering - * layers which will make it impossible to separate the two and deploy your application into a - * web worker. + * Renderer2} which provides an API that can be safely used. *

*
- * */ public nativeElement: T; diff --git a/packages/core/src/render/api.ts b/packages/core/src/render/api.ts index 35479d429af..24abf933116 100644 --- a/packages/core/src/render/api.ts +++ b/packages/core/src/render/api.ts @@ -139,7 +139,6 @@ export abstract class Renderer2 { * in the host element's DOM. * @param node The child node to query. * @returns The parent node, or null if there is no parent. - * For WebWorkers, always returns true. * This is because the check is synchronous, * and the caller can't rely on checking for null. */ @@ -148,7 +147,6 @@ export abstract class Renderer2 { * Implement this callback to get the next sibling node of a given node * in the host element's DOM. * @returns The sibling node, or null if there is no sibling. - * For WebWorkers, always returns a value. * This is because the check is synchronous, * and the caller can't rely on checking for null. */ diff --git a/packages/core/src/render3/instructions/element_validation.ts b/packages/core/src/render3/instructions/element_validation.ts index ec21d974508..8eac61106a9 100644 --- a/packages/core/src/render3/instructions/element_validation.ts +++ b/packages/core/src/render3/instructions/element_validation.ts @@ -145,7 +145,7 @@ export function isPropertyValid( if (schemas === null) return true; // The property is considered valid if the element matches the schema, it exists on the element, - // or it is synthetic, and we are in a browser context (web worker nodes should be skipped). + // or it is synthetic. if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) { return true; } diff --git a/packages/core/src/render3/interfaces/document.ts b/packages/core/src/render3/interfaces/document.ts index 34a71644555..ab12a2dde28 100644 --- a/packages/core/src/render3/interfaces/document.ts +++ b/packages/core/src/render3/interfaces/document.ts @@ -19,7 +19,7 @@ * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to * tell ivy what the global `document` is. * - * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`) + * Angular does this for us in each of the standard platforms (`Browser` and `Server`) * by calling `setDocument()` when providing the `DOCUMENT` token. */ let DOCUMENT: Document|undefined = undefined;