Skip to content

Commit fc2b792

Browse files
committed
minor #3049 [LiveComponent] Clean versionadded (smnandre)
This PR was merged into the 2.x branch. Discussion ---------- [LiveComponent] Clean versionadded | Q | A | ------------- | --- | Bug fix? | yes/no | New feature? | yes/no <!-- please update src/**/CHANGELOG.md files --> | Docs? | yes | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT (they predate the first stable release...) Commits ------- 9d3bd0f [Docs][LiveComponent] Clean oldies version added
2 parents c6ad4f7 + 9d3bd0f commit fc2b792

File tree

1 file changed

+8
-60
lines changed

1 file changed

+8
-60
lines changed

src/LiveComponent/doc/index.rst

Lines changed: 8 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -275,21 +275,11 @@ Add an input to the template:
275275
<strong>{{ this.randomNumber }}</strong>
276276
</div>
277277

278-
.. versionadded:: 2.5
279-
280-
Before version 2.5, you needed to also set ``value="{{ max }}"``
281-
on the ``<input>``. That is now set automatically for all
282-
"data-model" fields.
283278

284279
The key is the ``data-model`` attribute. Thanks
285280
to that, when the user types, the ``$max`` property on
286281
the component will automatically update!
287282

288-
.. versionadded:: 2.3
289-
290-
Before version 2.3, you also needed a ``data-action="live#update"``
291-
attribute. That attribute should now be removed.
292-
293283
How? Live components *listens* to the ``input`` event and
294284
sends an Ajax request to re-render the component with the
295285
new data!
@@ -734,10 +724,6 @@ persisted entities, which dehydrate to an ``id``).
734724
Using DTO's on a LiveProp
735725
~~~~~~~~~~~~~~~~~~~~~~~~~
736726

737-
.. versionadded:: 2.12
738-
739-
The automatic (de)hydration of DTO objects was introduced in LiveComponents 2.12.
740-
741727
You can also use a DTO (i.e. data transfer object / any simple class) with LiveProp as long as the property has the correct type::
742728

743729
class ComponentWithAddressDto
@@ -818,10 +804,6 @@ and ``dehydrateWith`` options on ``LiveProp``::
818804
Hydration Extensions
819805
~~~~~~~~~~~~~~~~~~~~
820806

821-
.. versionadded:: 2.8
822-
823-
The ``HydrationExtensionInterface`` system was added in LiveComponents 2.8.
824-
825807
If you frequently hydrate/dehydrate the same type of object, you can create a custom
826808
hydration extension to make this easier. For example, if you frequently hydrate
827809
a custom ``Food`` object, a hydration extension might look like this::
@@ -939,12 +921,6 @@ of the change:
939921
Adding a Stimulus Controller to your Component Root Element
940922
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
941923

942-
.. versionadded:: 2.9
943-
944-
The ability to use the ``defaults()`` method with ``stimulus_controller()``
945-
was added in TwigComponents 2.9 and requires ``symfony/stimulus-bundle``.
946-
Previously, ``stimulus_controller()`` was passed to ``attributes.add()``.
947-
948924
To add a custom Stimulus controller to your root component element:
949925

950926
.. code-block:: html+twig
@@ -1315,10 +1291,6 @@ shortcuts. We even added a flash message!
13151291
Uploading files
13161292
---------------
13171293

1318-
.. versionadded:: 2.11
1319-
1320-
The ability to upload files to actions was added in version 2.11.
1321-
13221294
Files aren't sent to the component by default. You need to use a live action
13231295
to handle the files and tell the component when the file should be sent:
13241296

@@ -1385,7 +1357,9 @@ The files will be available in a regular ``$request->files`` files bag::
13851357
Downloading files
13861358
-----------------
13871359

1388-
Currently, Live Components do not natively support returning file responses directly from a LiveAction. However, you can implement file downloads by redirecting to a route that handles the file response.
1360+
Currently, Live Components do not natively support returning file responses
1361+
directly from a LiveAction. However, you can implement file downloads by
1362+
redirecting to a route that handles the file response.
13891363

13901364
Create a LiveAction that generates the URL for the file download and returns a ``RedirectResponse``::
13911365

@@ -1410,7 +1384,9 @@ Create a LiveAction that generates the URL for the file download and returns a `
14101384

14111385
.. tip::
14121386

1413-
When Turbo is enabled, if a LiveAction response redirects to another URL, Turbo will make a request to prefetch the content. Here, adding ``data-turbo="false"`` ensures that the download URL is called only once.
1387+
When Turbo is enabled, if a LiveAction response redirects to another URL,
1388+
Turbo will make a request to prefetch the content. Here, adding ``data-turbo="false"``
1389+
ensures that the download URL is called only once.
14141390

14151391

14161392
.. _forms:
@@ -1781,10 +1757,6 @@ To fix this, set the ``always_empty`` option to ``false`` in your form::
17811757
Resetting the Form
17821758
~~~~~~~~~~~~~~~~~~
17831759

1784-
.. versionadded:: 2.10
1785-
1786-
The ``resetForm()`` method was added in LiveComponent 2.10.
1787-
17881760
After submitting a form via an action, you might want to "reset" the form
17891761
back to its initial state so you can use it again. Do that by calling
17901762
``resetForm()`` in your action instead of redirecting::
@@ -2379,10 +2351,6 @@ as soon as the page loads (``defer``) or when the component becomes visible
23792351
Loading "defer" (Ajax on Load)
23802352
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23812353

2382-
.. versionadded:: 2.13.0
2383-
2384-
The ability to defer loading a component was added in Live Components 2.13.
2385-
23862354
If a component is heavy to render, you can defer rendering it until after
23872355
the page has loaded. To do this, add a ``loading="defer"`` attribute:
23882356

@@ -2402,10 +2370,6 @@ real component once the page has loaded.
24022370
Loading "lazy" (Ajax when Visible)
24032371
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24042372

2405-
.. versionadded:: 2.17.0
2406-
2407-
The ability to load a component "lazily" was added in Live Components 2.17.
2408-
24092373
The ``lazy`` option is similar to ``defer``, but it defers the loading of
24102374
the component until it's in the viewport. This is useful for components that
24112375
are far down the page and are not needed until the user scrolls to them.
@@ -2442,9 +2406,9 @@ You can define some content to be rendered while the component is loading, eithe
24422406
inside the component template (the ``placeholder`` macro) or from the calling template
24432407
(the ``loading-template`` attribute and the ``loadingContent`` block).
24442408

2445-
.. versionadded:: 2.16.0
2409+
.. versionadded:: 2.16
24462410

2447-
Defining a placeholder macro into the component template was added in Live Components 2.16.0.
2411+
Defining a placeholder macro into the component template was added in Live Components 2.16.
24482412

24492413
In the component template, define a ``placeholder`` macro, outside of the
24502414
component's main content. This macro will be called when the component is deferred:
@@ -2562,10 +2526,6 @@ You can also trigger a specific "action" instead of a normal re-render:
25622526
Changing the URL when a LiveProp changes
25632527
----------------------------------------
25642528

2565-
.. versionadded:: 2.14
2566-
2567-
The ``url`` option was introduced in Live Components 2.14.
2568-
25692529
If you want the URL to update when a ``LiveProp`` changes, you can do that with the ``url`` option::
25702530

25712531
// src/Twig/Components/SearchModule.php
@@ -3710,10 +3670,6 @@ Then specify this new route on your component:
37103670
use DefaultActionTrait;
37113671
}
37123672
3713-
.. versionadded:: 2.14
3714-
3715-
The ``urlReferenceType`` option was added in LiveComponents 2.14.
3716-
37173673
You can also control the type of the generated URL:
37183674

37193675
.. code-block:: diff
@@ -3733,10 +3689,6 @@ You can also control the type of the generated URL:
37333689
Add a Hook on LiveProp Update
37343690
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37353691

3736-
.. versionadded:: 2.12
3737-
3738-
The ``onUpdated`` option was added in LiveComponents 2.12.
3739-
37403692
If you want to run custom code after a specific LiveProp is updated,
37413693
you can do it by adding an ``onUpdated`` option set to a public method name
37423694
on the component::
@@ -3836,10 +3788,6 @@ The `Twig Component debug command`_ can help you.
38363788
Test Helper
38373789
-----------
38383790

3839-
.. versionadded:: 2.11
3840-
3841-
The test helper was added in LiveComponents 2.11.
3842-
38433791
Interact With Live-Components
38443792
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38453793

0 commit comments

Comments
 (0)