@@ -342,11 +342,6 @@ clients. There are two main ways to receive the updates:
342342Forms
343343^^^^^
344344
345- .. versionadded :: 2.1
346-
347- Prior to 2.1, ``TurboStreamResponse::STREAM_FORMAT `` was used instead of ``TurboBundle::STREAM_FORMAT ``.
348- Also, one had to return a new ``TurboStreamResponse() `` object as the third argument to ``$this->render() ``.
349-
350345Let's discover how to use Turbo Streams to enhance your `Symfony forms `_::
351346
352347 // src/Controller/TaskController.php
@@ -383,7 +378,6 @@ Let's discover how to use Turbo Streams to enhance your `Symfony forms`_::
383378 return $this->redirectToRoute('task_success', [], Response::HTTP_SEE_OTHER);
384379 }
385380
386- // Symfony 6.2+
387381 return $this->render('task/new.html.twig', [
388382 'form' => $form,
389383 ]);
@@ -500,7 +494,7 @@ Then, enable the "mercure stream" controller in ``assets/controllers.json``:
500494 "mercure-turbo-stream": {
501495 + "enabled": true,
502496 - "enabled": false,
503- "fetch": "lazy "
497+ "fetch": "eager "
504498 }
505499 },
506500
@@ -512,14 +506,19 @@ If you use Symfony Flex, the configuration has been generated for you,
512506be sure to update the ``MERCURE_URL `` in the ``.env `` file to point to a
513507Mercure Hub (it's not necessary if you are using Symfony Docker).
514508
515- Otherwise, configure Mercure Hub(s) to use :
509+ Otherwise, configure Mercure Hub(s) as explained in the documentation :
516510
517511.. code-block :: yaml
518512
519- # config/packages/turbo.yaml
520- turbo :
521- mercure :
522- hubs : [default]
513+ # config/packages/mercure.yaml
514+ mercure :
515+ hubs :
516+ default :
517+ url : ' %env(MERCURE_URL)%'
518+ public_url : ' %env(MERCURE_PUBLIC_URL)%'
519+ jwt :
520+ secret : ' %env(MERCURE_JWT_SECRET)%'
521+ publish : ' *'
523522
524523 Let's create our chat::
525524
@@ -785,13 +784,6 @@ the following configuration:
785784 url : https://hub2.example.net/.well-known/mercure
786785 jwt : snip
787786
788- .. code-block :: yaml
789-
790- # config/packages/turbo.yaml
791- turbo :
792- mercure :
793- hubs : [hub1, hub2]
794-
795787 Use the appropriate Mercure ``HubInterface `` service to send a change
796788using a specific transport::
797789
0 commit comments