Skip to content

rclnodejs v1.7.0

Latest

Choose a tag to compare

@minggangw minggangw released this 26 Nov 05:19
· 112 commits to develop since this release

rclnodejs v1.7.0 Release Notes (2025-11-26)

Overview

We're excited to announce rclnodejs v1.7.0! This release brings significant improvements to the developer experience with promise-based APIs, comprehensive error handling, and powerful parameter management capabilities.

🎉 Major Features

1. Promise-Based Service Calls (#1311)

  • Added sendRequestAsync() method for promise-based service calls
  • Support for async/await syntax, making code more readable and maintainable
  • Timeout support: Specify request timeouts with { timeout: milliseconds }
  • Cancellation support: Use AbortSignal to cancel pending requests
  • Full backward compatibility: Existing callback-based API remains unchanged
  • Improved error handling with specific error types (TimeoutError, AbortError)

Example:

const response = await client.sendRequestAsync(request, { 
  timeout: 5000,
  signal: abortController.signal 
});

2. ParameterClient for Remote Parameter Access (#1318)

  • New ParameterClient class for accessing parameters on remote nodes
  • Full API for parameter operations:
    • getParameters() - Retrieve parameter values
    • setParameters() - Modify parameter values
    • listParameters() - List available parameters
    • describeParameters() - Get parameter metadata
  • Async/await support with timeout and cancellation
  • Clean API: node.createParameterClient(remoteNodeName) / node.destroyParameterClient()
  • Exported parameterTypeFromValue() utility for parameter type detection

3. ParameterWatcher for Real-Time Monitoring (#1326)

  • New ParameterWatcher class for real-time parameter change notifications
  • Monitor specific parameters on remote nodes
  • Event-driven architecture using Node.js EventEmitter
  • Dynamic parameter management with addParameters() / removeParameters()
  • Async/await support for initial parameter retrieval
  • Proper lifecycle management and automatic cleanup

Example:

const watcher = node.createParameterWatcher(remoteNodeName);
watcher.on('change', ({ parameterName, value }) => {
  console.log(`${parameterName} changed to:`, value);
});
await watcher.start(['my_param']);

4. Structured Error Handling with Class Hierarchy (#1320)

  • 21 new error classes providing rich context and type safety
  • Base class: RclNodeError with contextual information (code, nodeName, entityType, timestamp, details)
  • Validation Errors: TypeValidationError, RangeValidationError, NameValidationError
  • Operation Errors: TimeoutError, AbortError, ServiceNotFoundError, NodeNotFoundError
  • Parameter Errors: ParameterNotFoundError, ParameterTypeError, ReadOnlyParameterError
  • Topic/Action Errors: PublisherError, SubscriptionError, GoalRejectedError, ActionServerNotFoundError
  • Native Errors: NativeError wraps C++ exceptions with additional context
  • All errors include toJSON() method for structured logging
  • Fully backward compatible: All new errors extend Error

🔧 Improvements

Node.js Compatibility

  • AbortSignal.any() polyfill (#1322) for Node.js < 20.3.0
  • Fixed AbortSignal.timeout(0) behavior for Node.js < 18.20

CI/CD

  • Re-enabled ARM64 platform testing (#1323)
  • Updated actions/checkout to v6.0.0 (#1328)

🙏 Acknowledgments

Thanks to @mahmoud-ghalayini who made this release possible!


Full Changelog: 1.6.0...1.7.0