Skip to content

Create Dart Implementation#431

Open
Fried-man wants to merge 58 commits into
cucumber:mainfrom
Fried-man:feature/dart_implementation
Open

Create Dart Implementation#431
Fried-man wants to merge 58 commits into
cucumber:mainfrom
Fried-man:feature/dart_implementation

Conversation

@Fried-man

@Fried-man Fried-man commented May 22, 2026

Copy link
Copy Markdown

🤔 What's changed?

Adds an initial Dart implementation for Cucumber Messages

⚡️ What's your motivation?

There is currently no officially maintained Dart implementation of Cucumber Messages. I'd like to use a Dart implementation to build out Gherkin dart support.

🏷️ What kind of change is this?

  • 📖 Documentation (improvements without changing code)
  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

If the API surface needs updates to better conform with the other language implementations.

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@Fried-man Fried-man changed the title Feature/dart implementation Create Dart Implementation May 22, 2026

@mpkorstanje mpkorstanje left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Heya, thanks for the PR!

I've given this a quick look for big problems. I didn't spot any, but I'll have to give it a more detailed look later.

Some general remarks:

  1. I assume you're aware of cucumber/gherkin#30 and cucumber/gherkin#29.

  2. We currently don't publish the Gherkin parser. I assume that is something you'd like to see happen in the future. That can be arranged though but might take some work.

  3. I see that you've chosen to set default values for all required fields. Perhaps copied from the JavaScript implementation. We are trying to get rid of those for JavaScript (#285). It would make sense not copy that mistake into Dart. Ideally the constructor would throw an exception when trying to create message with missing required fields.

  4. The generated messages sit in the same folder as the support code. This makes reviewing code quite annoying. And this may cause issues in the future if introduce a message that clashes with the support code. Can we separate these?

A few more detailed remarks below.

Comment thread codegen/generators/dart.rb Outdated
Comment thread codegen/generators/dart.rb Outdated
Comment thread dart/lib/src/generated/duration.g.dart
Comment thread dart/lib/src/id_generator.dart Outdated
Comment thread dart/lib/src/ndjson_message_stream.dart Outdated
Comment thread dart/CHANGELOG.md
Comment thread .github/workflows/test-dart.yml Outdated
Comment thread dart/Makefile Outdated
Comment thread .github/workflows/test-dart.yml Fixed
Comment thread .github/workflows/test-dart.yml Fixed
Comment thread dart/Makefile Outdated
@Fried-man Fried-man requested a review from mpkorstanje June 2, 2026 22:29
Fried-man added 5 commits June 2, 2026 21:01
…the Cucumber message protocol. Enhance clarity by including descriptions for properties and methods across various message types.
…or message types in Cucumber's message protocol, enhancing clarity and accessibility of schema references.
@Fried-man

Copy link
Copy Markdown
Author

Done with changes.

Responded to feedback, added funding link, and updated the code generation for dart generated files to include public docs from JSON schema.

Comment thread dart/CHANGELOG.md
@@ -0,0 +1,7 @@
# Changelog

## 0.0.1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note to self: Change this with polyglot-release.

Comment thread dart/pubspec.yaml
@@ -0,0 +1,26 @@
name: cucumber_messages
description: JSON schema-based messages for Cucumber inter-process communication.
version: 0.0.1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note to self: Change this in polyglot-release.

Comment thread dart/README.md Outdated
Comment thread dart/README.md Outdated
Comment thread dart/README.md Outdated

@mpkorstanje mpkorstanje left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alright. Last few nitpicks and we're done. Please check all unresolved discussions.

@mpkorstanje mpkorstanje mentioned this pull request Jun 8, 2026
7 tasks
@Fried-man

Copy link
Copy Markdown
Author

Done & passing on my CI

@mpkorstanje

Copy link
Copy Markdown
Member

Cheers! All good. I'll merge this once I got publishing sorted.

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