From 0c05b0d06ce4c401cb5128a45cc0aeb5767842cb Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 20 Jun 2024 19:49:04 +0000 Subject: [PATCH] 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 PR-URL: https://github.com/nodejs/node/pull/53521 Reviewed-By: Luigi Pinca Reviewed-By: Chengzhong Wu Reviewed-By: Gabriel Schulhof Reviewed-By: Marco Ippolito --- doc/api/n-api.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index a33d86542208ef..e0f91e6673be80 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -6229,6 +6229,12 @@ 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 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. + ## Asynchronous thread-safe function calls JavaScript functions can normally only be called from a native addon's main