-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Notifier] Add mercure bridge #39342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
57546cd
to
7b886bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add files
- phpunit.xml.dist
- README.md
f366f12
to
b1cb35d
Compare
src/Symfony/Component/Notifier/Bridge/Mercure/MercureTransportFactory.php
Show resolved
Hide resolved
b1cb35d
to
7c4465b
Compare
friendly ping @dunglas 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for working on this! I think we can make this transport a bit more generic, but it's almost good!
src/Symfony/Component/Notifier/Bridge/Mercure/MercureTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mercure/MercureTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mercure/MercureTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mercure/MercureTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mercure/MercureTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mercure/MercureTransportFactory.php
Show resolved
Hide resolved
faa0539
to
f2af0e1
Compare
In order to make it work, symfony/mercure-bundle#36 has to be merged. |
f2af0e1
to
69d6bb3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for consistency
src/Symfony/Component/Notifier/Bridge/Mercure/MercureTransport.php
Outdated
Show resolved
Hide resolved
0ecb759
to
f9ed6b8
Compare
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mercure/MercureOptions.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mercure/MercureTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mercure/MercureTransportFactory.php
Outdated
Show resolved
Hide resolved
9695088
to
564a77f
Compare
src/Symfony/Component/Notifier/Bridge/Mercure/Tests/MercureTransportFactoryTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mercure/Tests/MercureTransportTest.php
Outdated
Show resolved
Hide resolved
564a77f
to
19c6544
Compare
Thanks Mathias for working on this feature, this is much appreciated. |
This PR was merged into the 5.3-dev branch. Discussion ---------- [Notifier] Add Mercure notifier documentation Documentation related to symfony/symfony#39342. Commits ------- 475a87d [Notifier] Add Mercure notifier documentation
This PR was merged into the 2.x branch. Discussion ---------- [Notify] Add Notify bundle | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Tickets | | License | MIT In Symfony 5.3, Notifier was shipped with a Mercure bridge (symfony/symfony#39342) Then, with a simple `$this->notifier->send(new Notification('My message', ['chat/mercure']));` (and a running Mercure server), it'll be easy to create "Server-Sent-Events". Therefore, the Notify bundle idea is to listen to these events using JavaScript event sourcing and convert them as native HTML5 notifications (using the `{{ stream_notifications() }}` Twig function). (The "Notify" name was the first that came to my mind a could/should be challenged) Commits ------- e02a362 [Notify] Add Notify library
This PR was merged into the 2.x branch. Discussion ---------- [Notify] Add Notify bundle | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Tickets | | License | MIT In Symfony 5.3, Notifier was shipped with a Mercure bridge (symfony/symfony#39342) Then, with a simple `$this->notifier->send(new Notification('My message', ['chat/mercure']));` (and a running Mercure server), it'll be easy to create "Server-Sent-Events". Therefore, the Notify bundle idea is to listen to these events using JavaScript event sourcing and convert them as native HTML5 notifications (using the `{{ stream_notifications() }}` Twig function). (The "Notify" name was the first that came to my mind a could/should be challenged) Commits ------- e02a362 [Notify] Add Notify library
Add a Notifier bridge for Mercure.
In this PR, Mercure is considered as a chatter (I'm still wondering if it's the most appropriate type).
The first approach for the DSN is
mercure://jwtToken@host:port/hubPath?topic=/foo/1&secure=false
with:topic
optional (defaults tonull
)secure
optional (defaults totrue
)I'm not sure about the current way to deal with http/https. Maybe we can just replace the
mercure
scheme byhttp|https
?The notification representation is following Activity Streams
#SymfonyHackday