Real-time Drupal with Drupack

One reason I want Drupal to standardize on FrankenPHP is so we can build on top of the built-in mercure server and unlock a whole new range of applications for Drupal. Of course we can do all this today, provided you maintain a separate server (most likely a nodejs server of some kind), write the integration code and make sure everything keeps working… I'm all about reducing the cost of ownership, it's not ideal to have to deal with that. We could standardize the building blocks in Drupal Core and help all the ecosystem integrate real-time features seamlessly. 

The latest version of Drupack make it possible to use the built-in mercure server. It will be available at /.well-known/mercure once your project composer.json adds: 

{"extra": {"drupack": {"mercure": true}}}

I wanted to use Display Builder to demonstrate the benefits. Display Builder has a collaboration feature since last year, users can see in real time the layout changes. The current implementation is very limited in how many users it can support. Perfect use case for a mercure hub. With a few hundreds lines of JS and PHP we can make Display Builder use the mercure hub to publish and consume updates to the layout so that real-time collaboration is significantly faster while supporting 5x to 10x more users.

Here is a quick video comparing the current implementation with a mercure-based one.

Fichier vidéo

The browser gets the notification immediately and refresh the page way before the current implementation. With this a performant chatbot in Drupal is possible. Chat based interfaces have been getting popular again, we can make the implementation easier. I've seen people build games on top of Drupal, that could be pretty useful there too.