Skip to content

Default protocol_version to 1.0 - #130

Merged
dunglas merged 3 commits into
mainfrom
protocol-1.0-default
Oct 7, 2026
Merged

dunglas merged 3 commits into
mainfrom
protocol-1.0-default

Conversation

@dunglas

@dunglas dunglas commented Oct 7, 2026

Copy link
Copy Markdown
Member

Mercure hub 1.0 is stable, so protocol_version now defaults to 1.0. Set protocol_version: 0.x to keep talking to a 0.x hub.

The default cookie name becomes __Secure-mercure_access_token, except when kernel.debug is on: there it is mercure_access_token. Browsers drop __Secure- cookies over plain HTTP, and mercure_access_token is the name the hub uses in playground mode.

BC break: jwt.secret hubs without jwt.claims (iss, sub, client_id) now fail at container compile time.

Related:

Companion of symfony/mercure#143

@@ -98,12 +98,12 @@ public function getConfigTreeBuilder(): TreeBuilder
->scalarNode('bus')->info('Name of the Messenger bus where the handler for this hub must be registered. Default to the default bus if Messenger is enabled.')->end()
->enumNode('protocol_version')
->values(array_column(ProtocolVersion::cases(), 'value'))

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.

this should probably use enumFqcn() instead of values to support the PHP enum fully (supporting both its backing value and the enum cases themselves, which provides a better PHP API).

Note that this would also remove the need for ProtocolVersion::from in the DI extension as the value becomes the enum instance, not its string value.

Comment thread CHANGELOG.md
CHANGELOG
=========

0.6.0

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.

should this become a version 1.0 of the bundle ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure, we were also talking about merging it in the main monorepo at some point. Maybe could we at least release a 1.0 version with all deprecations dropped later?

Mercure hub 1.0 is now stable. Set "protocol_version: 0.x" to keep
talking to a 0.x hub.
Browsers drop "__Secure-" cookies over plain HTTP, which breaks local
setups such as a hub exposed on port 80 for the Symfony CLI. The
prefix-less name also matches the hub's "playground" default.
enumFqcn() on symfony/config 7.3+, enum values normalized from their backing value on 6.4.
@dunglas
dunglas force-pushed the protocol-1.0-default branch from 233b20b to 1dee2df Compare October 7, 2026 10:10
@dunglas
dunglas merged commit 7202917 into main Oct 7, 2026
19 checks passed
@dunglas
dunglas deleted the protocol-1.0-default branch October 7, 2026 13:03
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.

2 participants