Skip to content

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Aug 31, 2025

⚡️ What's your motivation?

Because the message stream simply writes all messages, the report is
larger than it needs to be. By filtering out step definitions, hooks and
parameter types the report becomes smaller (but not much).

Closes: #414

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)

📋 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.

@mpkorstanje mpkorstanje force-pushed the filter-unused-messages branch from bb4bb73 to 11430d5 Compare August 31, 2025 19:02
Because the message stream simply writes all messages, the report is
larger than it needs to be. By filtering out step definitions, hooks and
parameter types the report becomes smaller (but not much).
@mpkorstanje mpkorstanje force-pushed the filter-unused-messages branch from 11430d5 to 138ee9a Compare August 31, 2025 19:14
@@ -138,6 +138,10 @@ export class CucumberHtmlStream extends Transform {
}

private writeMessage(envelope: messages.Envelope) {
if (envelope.stepDefinition || envelope.hook || envelope.parameterType) {
Copy link
Contributor Author

@mpkorstanje mpkorstanje Aug 31, 2025

Choose a reason for hiding this comment

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

@davidjgoss in #414 (comment) you said:

Before implementing the specific solution suggested here I think it would make sense to strip out all messages that are not used by the html report.

Agreed. As it stands we can do without:

* `source`

* `stepDefinition`

But source is used by react components. Instead I got this set of messages as unused from Cucumber JVM (filesize workaround).

Does this make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yes, source is currently used, although I am getting rid of that soon in cucumber/react-components#396.

hook is definitely used in the components to look up the name and other details of the defined hook.

But stepDefinition and parameterType can definitely be filtered out for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. I'll wait for cucumber/react-components#396 then.

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.

HTML report are really heavy as they embed the whole messages stream
2 participants