From 7520c08430ff9bdd8947cd1492291c922c0c0c2f Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 20 Jun 2024 19:49:04 +0000 Subject: [PATCH 1/5] doc: recommend not using libuv node-api function - update documentation recommend not using the napi_get_uv_event_loop function. It should not be need for most if not all uses cases now that the API is more complete. Signed-off-by: Michael Dawson --- doc/api/n-api.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 6f4d9b00205e1c..932312e41e9c66 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -6241,6 +6241,10 @@ NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_nogc_env env, * `[in] env`: The environment that the API is invoked under. * `[out] loop`: The current libuv loop instance. +Note while libuv has been relatively stable over time, it does +not provide an ABI stability guarrantee. Avoid using this fuction. +Its use may result in an addon that does not work across Node.js versions. + ## Asynchronous thread-safe function calls JavaScript functions can normally only be called from a native addon's main From 69234b8a8461cd9b0d21599cdb1ad1a3b9f16d6b Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Fri, 21 Jun 2024 14:14:27 -0400 Subject: [PATCH 2/5] Update doc/api/n-api.md Co-authored-by: Gabriel Schulhof --- doc/api/n-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 932312e41e9c66..6c2882eacd0630 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -6242,7 +6242,7 @@ NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_nogc_env env, * `[out] loop`: The current libuv loop instance. Note while libuv has been relatively stable over time, it does -not provide an ABI stability guarrantee. Avoid using this fuction. +not provide an ABI stability guarrantee. Use of this function should be avoided. Its use may result in an addon that does not work across Node.js versions. ## Asynchronous thread-safe function calls From 51bc6377c241e2ad9ddea682e96e98503a68e358 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Fri, 21 Jun 2024 14:14:34 -0400 Subject: [PATCH 3/5] Update doc/api/n-api.md Co-authored-by: Gabriel Schulhof --- doc/api/n-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 6c2882eacd0630..a84bf3469d7de9 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -6241,7 +6241,7 @@ NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_nogc_env env, * `[in] env`: The environment that the API is invoked under. * `[out] loop`: The current libuv loop instance. -Note while libuv has been relatively stable over time, it does +Note: While libuv has been relatively stable over time, it does not provide an ABI stability guarrantee. Use of this function should be avoided. Its use may result in an addon that does not work across Node.js versions. From 29e95f61f78adc362d5b22c01fe22b67104cb163 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Fri, 21 Jun 2024 14:16:22 -0400 Subject: [PATCH 4/5] Update n-api.md --- doc/api/n-api.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index a84bf3469d7de9..347d6e95e49631 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -6244,6 +6244,8 @@ NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_nogc_env env, Note: While libuv has been relatively stable over time, it does not provide an ABI stability guarrantee. Use of this function should be avoided. Its use may result in an addon that does not work across Node.js versions. +[asynchronous-thread-safe-function-calls](https://nodejs.org/docs/latest/api/n-api.html#asynchronous-thread-safe-function-calls) +are an alternative for many use cases. ## Asynchronous thread-safe function calls From b232a4c81e1e6e2c75afed1f071a58a2141bd4b4 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 24 Jun 2024 14:29:39 -0400 Subject: [PATCH 5/5] Update doc/api/n-api.md Co-authored-by: Mohammed Keyvanzadeh --- doc/api/n-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 347d6e95e49631..a9387733eb7c66 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -6242,7 +6242,7 @@ NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_nogc_env env, * `[out] loop`: The current libuv loop instance. Note: While libuv has been relatively stable over time, it does -not provide an ABI stability guarrantee. Use of this function should be avoided. +not provide an ABI stability guarantee. Use of this function should be avoided. Its use may result in an addon that does not work across Node.js versions. [asynchronous-thread-safe-function-calls](https://nodejs.org/docs/latest/api/n-api.html#asynchronous-thread-safe-function-calls) are an alternative for many use cases.