Download the PHP package raneomik/nette-mercure without Composer
On this page you can find all versions of the php package raneomik/nette-mercure. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download raneomik/nette-mercure
More information about raneomik/nette-mercure
Files in raneomik/nette-mercure
Package nette-mercure
Short Description 🚀 Nette Mercure Extension: nette wrapper around https://github.com/symfony/mercure
License MIT
Homepage https://github.com/raneomik/nette-mercure
Informations about the package nette-mercure
Nette Mercure Extension
Work In Progress
🚀 Nette Mercure Extension: wrapper for symfony/mercure to use Mercure in Nette framework
Mercure is a protocol allowing to push data updates to web browsers and other HTTP clients in a convenient, fast, reliable and battery-efficient way. It is especially useful to publish real-time updates of resources served through web APIs, to reactive web and mobile apps.
Getting Started
Configuration
JWT options to set. Secret, publish & subscribe can be configured at jwt.io
Publish messages
Subscribe to updates
Generate mercure url in Latte templates, setup your JavaScript client to listen to Mercure updates and render them in selected containers :
When working with JWT token in Authorisation Header, you may need a polyfill.
Subscribe using discovery
You can subscribe to specific topic(s) and hub using Discovery mechanism.
-
Setup a
/subscribeendpoint : - Setup the listening client :
Broadcast & Subscribe to turbo-streams
You can also subscribe to turbo-streams :
-
Server side :
- Client side :
Resources
- Based on symfony/mercure / Documentation
Mercure
FrankenPHP Real-time and Hot-Reload
Nette,
Latte,
Tester,
Tracy
Known issues
-
"anonymous" option for mercure in Caddy configuration seems to work only with Symfony\Mercure\FrankenPhpHub and the FrankenPHP built-in
mercure_publishfunction. HttpClient shows errors such as "405 Method Not Allowed" in this case. - TODO
All versions of nette-mercure with dependencies
php Version >=8.3
lcobucci/jwt Version ^5.6.0
nette/http Version ^2.0|^3.3
symfony/mercure Version ^0.7.2