Skip to content

Commit 9e297d3

Browse files
committed
minor #2524 [Turbo] Remove obselete Mercure configuration (docs) (smnandre)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Turbo] Remove obselete Mercure configuration (docs) | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes/no <!-- please update src/**/CHANGELOG.md files --> | Issues | Fix #2518 | License | MIT This PR replaces #2519 (that did not use current config format) and add the changes missing on the same page. - [Update Mercure bundle documentation](ef688d4) - [Fix Mercure controller configuration](f221d4d) - [Remove obselete Mercure turbo/hub configuration](a8403c0) - [Remove very old versionadded warning](c8dcb5e) - [Remove Symfony 6.2+ comment](3a88f32) Commits ------- 369f345 [Turbo] Remove obselete Mercure configuration (docs)
2 parents 90a2eb1 + 369f345 commit 9e297d3

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

src/Turbo/doc/index.rst

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,6 @@ clients. There are two main ways to receive the updates:
342342
Forms
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-
350345
Let'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,
512506
be sure to update the ``MERCURE_URL`` in the ``.env`` file to point to a
513507
Mercure 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
796788
using a specific transport::
797789

0 commit comments

Comments
 (0)