Leverage Template literals to replace dot#1297
Merged
Merged
Conversation
There was a problem hiding this comment.
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.
Closed
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Reference:
Fix: #1297