Skip to content

Leverage Template literals to replace dot#1297

Merged
minggangw merged 2 commits into
RobotWebTools:developfrom
minggangw:fix-1296
Oct 17, 2025
Merged

Leverage Template literals to replace dot#1297
minggangw merged 2 commits into
RobotWebTools:developfrom
minggangw:fix-1296

Conversation

@minggangw

@minggangw minggangw commented Oct 17, 2025

Copy link
Copy Markdown
Member

This PR replaces the doT template engine with native JavaScript template literals for generating ROS2 message/service wrapper classes. The change migrates from external template files to pure JavaScript functions, improving maintainability and performance.

  • Removed dependency on doT template engine and replaced with native JavaScript template literals
  • Created new template generator functions for messages, services, actions, and service events
  • Updated the IDL generator to use the new template functions instead of doT templates

Reference:

Fix: #1297

Copilot AI review requested due to automatic review settings October 17, 2025 07:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the doT template engine with native JavaScript template literals for generating ROS2 message/service wrapper classes. The change migrates from external template files to pure JavaScript functions, improving maintainability and performance.

  • Removed dependency on doT template engine and replaced with native JavaScript template literals
  • Created new template generator functions for messages, services, actions, and service events
  • Updated the IDL generator to use the new template functions instead of doT templates

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
rosidl_gen/templates/service_event.dot Removed doT template for service event generation
rosidl_gen/templates/service.dot Removed doT template for service generation
rosidl_gen/templates/service-template.js Added native JavaScript template for service generation
rosidl_gen/templates/service-event-template.js Added native JavaScript template for service event generation
rosidl_gen/templates/message.dot Removed large doT template for message generation
rosidl_gen/templates/message-template.js Added comprehensive native JavaScript template for message generation
rosidl_gen/templates/action.dot Removed doT template for action generation
rosidl_gen/templates/action-template.js Added native JavaScript template for action generation
rosidl_gen/idl_generator.js Updated to use new template functions instead of doT
package.json Removed doT dependency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread rosidl_gen/templates/message-template.js
@coveralls

coveralls commented Oct 17, 2025

Copy link
Copy Markdown

Coverage Status

coverage: 83.18%. remained the same
when pulling 2496e80 on minggangw:fix-1296
into 2622779 on RobotWebTools:develop.

@minggangw minggangw changed the title Leverage built-in Template literals to replace dot Leverage Template literals to replace dot Oct 17, 2025
@minggangw minggangw merged commit 57b29e8 into RobotWebTools:develop Oct 17, 2025
18 checks passed
@minggangw minggangw mentioned this pull request Oct 17, 2025
minggangw added a commit that referenced this pull request Oct 30, 2025
This PR replaces the doT template engine with native JavaScript template literals for generating ROS2 message/service wrapper classes. The change migrates from external template files to pure JavaScript functions, improving maintainability and performance.

- Removed dependency on doT template engine and replaced with native JavaScript template literals
- Created new template generator functions for messages, services, actions, and service events
- Updated the IDL generator to use the new template functions instead of doT templates

**Reference**: 
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

Fix: #1297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants