TGrid is a robust TypeScript framework designed for building grid computing applications and facilitating real-time network communication across various environments. It provides abstractions for Remote Procedure Call (RPC), Remote Function Call (RFC), and Remote Object Call (ROC), enabling developers to create distributed systems that leverage WebSockets, Web Workers, Shared Workers, and integrate seamlessly with NestJS. The current stable version is 1.2.1, with a release cadence that focuses on incremental improvements, bug fixes, and documentation enhancements, rather than frequent major breaking changes. Its key differentiators include comprehensive TypeScript type safety, unified API for diverse communication protocols, and a strong emphasis on simplifying complex network paradigms into an intuitive Object-Oriented Network (OON) model. TGrid aims to reduce boilerplate and complexity associated with developing high-performance, distributed applications.
npm install tgridVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to establish a WebSocket connection with a TGrid server and perform remote procedure calls (RPC) using a type-safe interface. It connects to a hypothetical 'calculator' service and invokes arithmetic operations.
Review the TGrid v1.0.0 changelog and documentation to adapt to the new class names and API structures for WebSocket interactions.
Test error handling paths and update catch blocks or error inspection logic to conform to the new uniform error pattern introduced in v1.0.2.
Check custom `Communicator` implementations or usages of `on()` to ensure they align with the updated method signature and event type handling, especially if type inference or custom event objects are involved.
When using `WorkerConnector`, explicitly define `cwd` if your worker script is not in the default working directory, or ensure paths are absolute for clarity. Pay close attention to how your bundler or runtime resolves worker script paths.
Ensure the TGrid server process is active and verify that the client's connection URL/parameters (e.g., 'ws://127.0.0.1:37000/composite') precisely match the server's configured listening address and port.
Review the interface (`ICalculator` in the quickstart) and the actual provider object instantiated on the server/worker side. Ensure the method (`someMethod`) is correctly implemented and passed to `connector.accept()`.
Run `npm install tgrid` to install the package. For TypeScript, ensure `compilerOptions.esModuleInterop` is set to `true` and that `compilerOptions.moduleResolution` is appropriate (e.g., `NodeNext` or `Node`).
Verify that the WebSocket URL path (e.g., `/composite` in the quickstart) precisely matches the path configured on the `WebSocketAcceptor` or equivalent server-side setup.
No dependency data recorded yet.