Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- JS/TS server: Fix the JSDoc `@returns` type on generated factory functions to name the class they actually return ([#871](https://github.com/mozilla/glean_parser/pull/871))

## 22.0.0

- JS/TS server: Add support for `server-deletion-request` ping. Server apps can now add `server-deletion-request` to `send_in_pings` on identifier metrics (e.g. user IDs) ([DENG-4079](https://mozilla-hub.atlassian.net/browse/DENG-4079))
Expand Down
2 changes: 1 addition & 1 deletion glean_parser/templates/javascript_server.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class {{ ping|event_class_name(metrics_by_type) }} {
* @param {string} appDisplayVersion - The application display version.
* @param {string} channel - The channel.
* @param {Object} logger_options - The logger options.
* @returns {EventsServerEventLogger} An instance of EventsServerEventLogger.
* @returns {{ "{" }}{{ ping|event_class_name(metrics_by_type) }}{{ "}" }} An instance of {{ ping|event_class_name(metrics_by_type) }}.
*/
{% if module_spec == "commonjs" %}
module.exports.{{ ping|factory_method(metrics_by_type) }} = function ({
Expand Down
2 changes: 2 additions & 0 deletions tests/test_javascript_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def test_parser_js_server(tmp_path):
with (tmp_path / "server_events.js").open("r", encoding="utf-8") as fd:
content = fd.read()
assert "'event.name': event_name" in content
# JSDoc return type must match the class the factory returns
assert "@returns {AccountsEventsServerEvent}" in content


def test_generate_ping_factory_method():
Expand Down
Loading