You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[rosidl_gen] Refactor the dot used to generate the JavaScript messages (#1014)
`rclnodejs` leverages [`dot`](https://www.npmjs.com/package/dot) to generate the JavaScript classes, representing the ROS messages and wrapping the [`ref`](https://www.npmjs.com/package/@rclnodejs/ref-napi) objects that can read/write from C++ pointer. For a long time, we changed the implementation along with new features introduced into ROS2, so it makes the template itself messy and hard to understand.
This patch tries to refactor the template to make it more readable and maintainable, including:
1. Add proper indents for `for`/`if` used by the template to make it easy to understand.
2. Abstract some functionalities into separate functions, like `_setDefaults()`.
3. Add more meaningful comments by ```{{/* */}}```.
4. Remove the consistency checking.
Besides, the following changes are made accordingly:
1. Remove the `willCheckConsistency` usage from current JS files.
2. Remove tests related to consistency checking in `test-compound-msg-type-check.js` and `test-security-related.js`.
3. Use `prettier` to format the generated JavaScript files.
4. Pump the generator version to `0.4.0`.
Fix: #1015
0 commit comments