![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@react-native-windows/automation-channel
Advanced tools
@react-native-windows/automation-channel adds support for remote procedure calls from a node client to react-native-windows server on the same machine.
@react-native-windows/automation-channel adds support for remote procedure calls from a node client to react-native-windows server on the same machine.
node app
import {waitForConnection} from '@react-native-windows/automation-channel'
const rpcConnection = await waitForConnection({port: 8305});
const result = await rpcConnection.invoke("add", [2, 2])
react-native-windows app
#include "winrt/AutomationChannel.Server.h"
// AutomationChannel::CommandHandler allows registering methods
winrt::AutomationChannel::CommandHandler handler();
// Binding to a simple method
handler.BindOperation("add", [](const JSonValue& params) noexcept {
auto addends = params.GetArray();
auto sum = 0;
for (const auto& addend : addends) {
sum += addend.GetNumber();
}
return JSonValue::CreateNumberValue(sum);
});
// Methods may be bound to IAsyncAction or IAsyncOperation
handler.BindAsyncAction("performAsyncOperation", [](const JSonValue& params) noexcept -> IAsyncAction {
co_await performLongOperation();
});
// Start server
winrt::AutomationChannel::Server rpcServer(handler);
co_await rpcServer.ProcessAllClientRequests(8305, 50ms);
@react-native-windows/automation-channel supports auto-linking to allow installation into react-native-windows applications.
Reverse TCP server: Traditional server/client roles are reversed, where the node client creates a TCP server to connect to. This helps to bypass restrictions on inbound loopback traffic to UWP apps. This low-effort solution allows bypassing the UWP AppContainer.
net.socket
. It is possible to create a named pipe from a UWP process which a Win32 process can then connect to, allowing traditional server/client roles. Doing this requires locating the resource local to the AppContainer, using an API like GetAppContainerNamedObjectPath
. This likely requires FFI (with node-gyp) or native extenssions.@react-native-windows/automation-channel uses a TCP channel, sending JSON messages across the wire prefixed with length. Messages themselves are conformant to the JSON-RPC version 2.0 protocol.
FAQs
@react-native-windows/automation-channel adds support for remote procedure calls from a node client to react-native-windows server on the same machine.
The npm package @react-native-windows/automation-channel receives a total of 496 weekly downloads. As such, @react-native-windows/automation-channel popularity was classified as not popular.
We found that @react-native-windows/automation-channel demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.