Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

chore: run sync-api for 18.9.0 docs #2759

Merged
merged 1 commit into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions content/api/v18/addons.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
title: 'addons'
displayTitle: 'C++ addons'
category: 'api'
editPage: 'https://github.com/nodejs/node/blob/v18.8.0/doc/api/addons.md'
editPage: 'https://github.com/nodejs/node/blob/v18.9.0/doc/api/addons.md'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside, this could probable be guess/calculated at build time to reduce git noise

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing the i18n part of the file path right now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing the i18n part of the file path right now

WDYM? The source has no i18n. The i18n is done here.

Copy link
Member

@ovflowd ovflowd Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside, this could probable be guess/calculated at build time to reduce git noise

Sure, but this PR is not the right place (IMHO) to talk about this. I'd recommend opening an issue with all your suggestions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see it's on the node repo. The URL doesn't actually take you to an editable page though, because you can't edit files on a tag path

version: 'v18'
---

<Metadata version="v18.8.0" data={{"update":{"type":"introduced_in","version":["v0.10.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"introduced_in","version":["v0.10.0"]}}} />

<Metadata version="v18.8.0" data={{"type":"misc"}} />
<Metadata version="v18.9.0" data={{"type":"misc"}} />

_Addons_ are dynamically-linked shared objects written in C++. The
[`require()`][require] function can load addons as ordinary Node.js modules.
Addons provide an interface between JavaScript and C/C++ libraries.

There are three options for implementing addons: Node-API, nan, or direct
use of internal V8, libuv and Node.js libraries. Unless there is a need for
use of internal V8, libuv, and Node.js libraries. Unless there is a need for
direct access to functionality which is not exposed by Node-API, use Node-API.
Refer to [C/C++ addons with Node-API](n-api.md) for more information on
Node-API.
Expand Down Expand Up @@ -46,7 +46,7 @@ involving knowledge of several components and APIs:

* Node.js includes other statically linked libraries including OpenSSL. These
other libraries are located in the `deps/` directory in the Node.js source
tree. Only the libuv, OpenSSL, V8 and zlib symbols are purposefully
tree. Only the libuv, OpenSSL, V8, and zlib symbols are purposefully
re-exported by Node.js and may be used to various extents by addons. See
[Linking to libraries included with Node.js][] for additional information.

Expand Down Expand Up @@ -242,7 +242,7 @@ NODE_MODULE_INIT(/* exports, module, context */) {

##### Worker support

<Metadata version="v18.8.0" data={{"changes":[{"version":["v14.8.0","v12.19.0"],"pr-url":"https://github.com/nodejs/node/pull/34572","description":"Cleanup hooks may now be asynchronous."}]}} />
<Metadata version="v18.9.0" data={{"changes":[{"version":["v14.8.0","v12.19.0"],"pr-url":"https://github.com/nodejs/node/pull/34572","description":"Cleanup hooks may now be asynchronous."}]}} />

In order to be loaded from multiple Node.js environments,
such as a main thread and a Worker thread, an add-on needs to either:
Expand Down Expand Up @@ -392,7 +392,7 @@ try {

#### Linking to libraries included with Node.js

Node.js uses statically linked libraries such as V8, libuv and OpenSSL. All
Node.js uses statically linked libraries such as V8, libuv, and OpenSSL. All
addons are required to link to V8 and may link to any of the other dependencies
as well. Typically, this is as simple as including the appropriate
`#include <...>` statements (e.g. `#include <v8.h>`) and `node-gyp` will locate
Expand Down Expand Up @@ -441,7 +441,7 @@ illustration of how it can be used.

### Node-API

<Metadata version="v18.8.0" data={{"stability":{"level":2,"text":" - Stable"}}} />
<Metadata version="v18.9.0" data={{"stability":{"level":2,"text":" - Stable"}}} />

Node-API is an API for building native addons. It is independent from
the underlying JavaScript runtime (e.g. V8) and is maintained as part of
Expand Down
120 changes: 68 additions & 52 deletions content/api/v18/assert.en.md

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions content/api/v18/async_context.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
title: 'async_context'
displayTitle: 'Asynchronous context tracking'
category: 'api'
editPage: 'https://github.com/nodejs/node/blob/v18.8.0/doc/api/async_context.md'
editPage: 'https://github.com/nodejs/node/blob/v18.9.0/doc/api/async_context.md'
version: 'v18'
---

<Metadata version="v18.8.0" data={{"update":{"type":"introduced_in","version":["v16.4.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"introduced_in","version":["v16.4.0"]}}} />

<Metadata version="v18.8.0" data={{"stability":{"level":2,"text":" - Stable"}}} />
<Metadata version="v18.9.0" data={{"stability":{"level":2,"text":" - Stable"}}} />

<Metadata version="v18.8.0" data={{"source_link":"lib/async_hooks.js"}} />
<Metadata version="v18.9.0" data={{"source_link":"lib/async_hooks.js"}} />

### Introduction

Expand All @@ -33,7 +33,7 @@ const { AsyncLocalStorage, AsyncResource } = require('node:async_hooks');

### <DataTag tag="C" /> `AsyncLocalStorage`

<Metadata version="v18.8.0" data={{"changes":[{"version":"v16.4.0","pr-url":"https://github.com/nodejs/node/pull/37675","description":"AsyncLocalStorage is now Stable. Previously, it had been Experimental."}],"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
<Metadata version="v18.9.0" data={{"changes":[{"version":"v16.4.0","pr-url":"https://github.com/nodejs/node/pull/37675","description":"AsyncLocalStorage is now Stable. Previously, it had been Experimental."}],"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />

This class creates stores that stay coherent through asynchronous operations.

Expand Down Expand Up @@ -116,16 +116,16 @@ with each other's data.

#### <DataTag tag="M" /> `new AsyncLocalStorage()`

<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />

Creates a new instance of `AsyncLocalStorage`. Store is only provided within a
`run()` call or after an `enterWith()` call.

#### <DataTag tag="M" /> `asyncLocalStorage.disable()`

<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />

<Metadata version="v18.8.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
<Metadata version="v18.9.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />

Disables the instance of `AsyncLocalStorage`. All subsequent calls
to `asyncLocalStorage.getStore()` will return `undefined` until
Expand All @@ -144,7 +144,7 @@ in the current process.

#### <DataTag tag="M" /> `asyncLocalStorage.getStore()`

<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />

* Returns: [`any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types)

Expand All @@ -155,9 +155,9 @@ returns `undefined`.

#### <DataTag tag="M" /> `asyncLocalStorage.enterWith(store)`

<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.11.0","v12.17.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.11.0","v12.17.0"]}}} />

<Metadata version="v18.8.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
<Metadata version="v18.9.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />

* `store` [`any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types)

Expand Down Expand Up @@ -201,7 +201,7 @@ asyncLocalStorage.getStore(); // Returns the same object

#### <DataTag tag="M" /> `asyncLocalStorage.run(store, callback[, ...args])`

<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />

* `store` [`any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types)
* `callback` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
Expand Down Expand Up @@ -237,9 +237,9 @@ try {

#### <DataTag tag="M" /> `asyncLocalStorage.exit(callback[, ...args])`

<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />

<Metadata version="v18.8.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
<Metadata version="v18.9.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />

* `callback` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
* `...args` [`any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types)
Expand Down Expand Up @@ -306,7 +306,7 @@ probably responsible for the context loss.

### <DataTag tag="C" /> `AsyncResource`

<Metadata version="v18.8.0" data={{"changes":[{"version":"v16.4.0","pr-url":"https://github.com/nodejs/node/pull/37675","description":"AsyncResource is now Stable. Previously, it had been Experimental."}]}} />
<Metadata version="v18.9.0" data={{"changes":[{"version":"v16.4.0","pr-url":"https://github.com/nodejs/node/pull/37675","description":"AsyncResource is now Stable. Previously, it had been Experimental."}]}} />

The class `AsyncResource` is designed to be extended by the embedder's async
resources. Using this, users can easily trigger the lifetime events of their
Expand Down Expand Up @@ -410,7 +410,7 @@ class DBQuery extends AsyncResource {

#### Static method: `AsyncResource.bind(fn[, type[, thisArg]])`

<Metadata version="v18.8.0" data={{"changes":[{"version":"v17.8.0","pr-url":"https://github.com/nodejs/node/pull/42177","description":"Changed the default when `thisArg` is undefined to use `this` from the caller."},{"version":"v16.0.0","pr-url":"https://github.com/nodejs/node/pull/36782","description":"Added optional thisArg."}],"update":{"type":"added","version":["v14.8.0","v12.19.0"]}}} />
<Metadata version="v18.9.0" data={{"changes":[{"version":"v17.8.0","pr-url":"https://github.com/nodejs/node/pull/42177","description":"Changed the default when `thisArg` is undefined to use `this` from the caller."},{"version":"v16.0.0","pr-url":"https://github.com/nodejs/node/pull/36782","description":"Added optional thisArg."}],"update":{"type":"added","version":["v14.8.0","v12.19.0"]}}} />

* `fn` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) The function to bind to the current execution context.
* `type` [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) An optional name to associate with the underlying
Expand All @@ -424,7 +424,7 @@ the `AsyncResource` to which the function is bound.

#### <DataTag tag="M" /> `asyncResource.bind(fn[, thisArg])`

<Metadata version="v18.8.0" data={{"changes":[{"version":"v17.8.0","pr-url":"https://github.com/nodejs/node/pull/42177","description":"Changed the default when `thisArg` is undefined to use `this` from the caller."},{"version":"v16.0.0","pr-url":"https://github.com/nodejs/node/pull/36782","description":"Added optional thisArg."}],"update":{"type":"added","version":["v14.8.0","v12.19.0"]}}} />
<Metadata version="v18.9.0" data={{"changes":[{"version":"v17.8.0","pr-url":"https://github.com/nodejs/node/pull/42177","description":"Changed the default when `thisArg` is undefined to use `this` from the caller."},{"version":"v16.0.0","pr-url":"https://github.com/nodejs/node/pull/36782","description":"Added optional thisArg."}],"update":{"type":"added","version":["v14.8.0","v12.19.0"]}}} />

* `fn` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) The function to bind to the current `AsyncResource`.
* `thisArg` [`any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types)
Expand All @@ -436,7 +436,7 @@ the `AsyncResource` to which the function is bound.

#### <DataTag tag="M" /> `asyncResource.runInAsyncScope(fn[, thisArg, ...args])`

<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v9.6.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v9.6.0"]}}} />

* `fn` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) The function to call in the execution context of this async
resource.
Expand Down
18 changes: 9 additions & 9 deletions content/api/v18/async_hooks.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
title: 'async_hooks'
displayTitle: 'Async hooks'
category: 'api'
editPage: 'https://github.com/nodejs/node/blob/v18.8.0/doc/api/async_hooks.md'
editPage: 'https://github.com/nodejs/node/blob/v18.9.0/doc/api/async_hooks.md'
version: 'v18'
---

<Metadata version="v18.8.0" data={{"update":{"type":"introduced_in","version":["v8.1.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"introduced_in","version":["v8.1.0"]}}} />

<Metadata version="v18.8.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
<Metadata version="v18.9.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />

<Metadata version="v18.8.0" data={{"source_link":"lib/async_hooks.js"}} />
<Metadata version="v18.9.0" data={{"source_link":"lib/async_hooks.js"}} />

The `node:async_hooks` module provides an API to track asynchronous resources.
It can be accessed using:
Expand Down Expand Up @@ -137,7 +137,7 @@ function promiseResolve(asyncId) { }

### <DataTag tag="M" /> `async_hooks.createHook(callbacks)`

<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v8.1.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v8.1.0"]}}} />

* `callbacks` [`Object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) The [Hook Callbacks][] to register
* `init` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) The [`init` callback][].
Expand Down Expand Up @@ -574,7 +574,7 @@ does not depend on garbage collection, then this will not be an issue.

##### <DataTag tag="M" /> `promiseResolve(asyncId)`

<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v8.6.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v8.6.0"]}}} />

* `asyncId` [`number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type)

Expand Down Expand Up @@ -603,7 +603,7 @@ init for PROMISE with id 6, trigger id: 5 # the Promise returned by then()

#### <DataTag tag="M" /> `async_hooks.executionAsyncResource()`

<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.9.0","v12.17.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.9.0","v12.17.0"]}}} />

* Returns: [`Object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) The resource representing the current execution.
Useful to store data within the resource.
Expand Down Expand Up @@ -693,7 +693,7 @@ const server = createServer((req, res) => {

#### <DataTag tag="M" /> `async_hooks.executionAsyncId()`

<Metadata version="v18.8.0" data={{"changes":[{"version":"v8.2.0","pr-url":"https://github.com/nodejs/node/pull/13490","description":"Renamed from `currentId`."}],"update":{"type":"added","version":["v8.1.0"]}}} />
<Metadata version="v18.9.0" data={{"changes":[{"version":"v8.2.0","pr-url":"https://github.com/nodejs/node/pull/13490","description":"Renamed from `currentId`."}],"update":{"type":"added","version":["v8.1.0"]}}} />

* Returns: [`number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) The `asyncId` of the current execution context. Useful to
track when something calls.
Expand Down Expand Up @@ -760,7 +760,7 @@ the section on [promise execution tracking][].

#### <DataTag tag="M" /> `async_hooks.asyncWrapProviders`

<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v17.2.0","v16.14.0"]}}} />
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v17.2.0","v16.14.0"]}}} />

* Returns: A map of provider types to the corresponding numeric id.
This map contains all the event types that might be emitted by the `async_hooks.init()` event.
Expand Down
Loading