Skip to content

Conversation

valtzu
Copy link
Contributor

@valtzu valtzu commented Aug 3, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues Related to #57288
License MIT

Show requests originated from js EventSource (Server-Sent Events) in the web debug toolbar.

By using custom event type we should be able to avoid interfering with any app logic.

@valtzu
Copy link
Contributor Author

valtzu commented Aug 3, 2025

Some screenshots below

In progress

image

Finished successfully

image

Exception thrown while streaming

image

@valtzu valtzu changed the title [WebProfilerBundle] Show EventStreams in debug toolbar [WebProfilerBundle] Show Server-Sent Events in debug toolbar Aug 3, 2025
@valtzu valtzu force-pushed the web-profiler-event-stream branch from ef33ff6 to 3d3cd2d Compare August 3, 2025 13:48
@valtzu valtzu changed the title [WebProfilerBundle] Show Server-Sent Events in debug toolbar [WebProfilerBundle] Show EventSource requests in debug toolbar Aug 3, 2025
@valtzu valtzu force-pushed the web-profiler-event-stream branch from 3d3cd2d to 339be35 Compare August 4, 2025 17:22
@valtzu valtzu force-pushed the web-profiler-event-stream branch from 339be35 to a4ed7af Compare August 4, 2025 17:23
@chalasr
Copy link
Member

chalasr commented Aug 4, 2025

👍 Good idea

$response->setCallback(static function () use ($callback, $response) {
$response->sendEvent(new ServerEvent(
[
$response->headers->get('X-Debug-Token') ?? '',
Copy link
Member

Choose a reason for hiding this comment

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

this data is static, so why repeat it for every message?

Copy link
Contributor Author

@valtzu valtzu Aug 5, 2025

Choose a reason for hiding this comment

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

Hmm what do you mean? It's only included once per stream/request: $callback() outputs all the messages user yielded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants