Skip to content

Commit 2defab2

Browse files
committed
feature #1419 [Live][Stimulus] Prepping the LiveComponent Stable Release 🚀 (weaverryan)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Live][Stimulus] Prepping the LiveComponent Stable Release 🚀 | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Issues | None | License | MIT Hi! LiveComponents has, really, been quite stable for a long time, but it's kept its experimental status. Removing that is really about deciding that we'll protect backwards-compatibility. It's time to do that :). This is planned as the 2.15.0 release near the end of Feb (assuming we get the items below done before then). TODOs: * #1418 * Possibly remove Twig 2.x compat * #1428 * #1392 * Moving `Idiomorph` to a peer dependency would be great, but blocked by bigskysoftware/idiomorph#35 - **still need a tag** for the PR merge * #1426 as it may include some edge-case BC breaks. If there's anything else on your mind before stable, now is the time to mention it :). Cheers! Commits ------- 7932a9d [Live][Stimulus] Prepping the LiveComponent Stable Release 🚀
2 parents b72aeaa + 7932a9d commit 2defab2

File tree

64 files changed

+36
-127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+36
-127
lines changed

src/LiveComponent/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# Live Components
22

3-
**EXPERIMENTAL** This component is currently experimental and is
4-
likely to change, or even change drastically.
5-
63
Live components work with the [TwigComponent](https://symfony.com/bundles/ux-twig-component/current/index.html)
74
library to give you the power to automatically update your
85
Twig components on the frontend as the user interacts with them.
96
Inspired by [Livewire](https://laravel-livewire.com/) and
107
[Phoenix LiveView](https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html).
118

12-
Want a demo? Check out https://github.com/weaverryan/live-demo.
9+
Want a demo? Check out https://ux.symfony.com/live-component.
1310

1411
**This repository is a READ-ONLY sub-tree split**. See
1512
https://github.com/symfony/ux to create issues or submit pull requests.

src/LiveComponent/assets/dist/live_controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,9 +1374,9 @@ function executeMorphdom(rootFromElement, rootToElement, modifiedFieldElements,
13741374
if (modifiedFieldElements.includes(fromEl)) {
13751375
setValueOnElement(toEl, getElementValue(fromEl));
13761376
}
1377-
if (fromEl === document.activeElement
1378-
&& fromEl !== document.body
1379-
&& null !== getModelDirectiveFromElement(fromEl, false)) {
1377+
if (fromEl === document.activeElement &&
1378+
fromEl !== document.body &&
1379+
null !== getModelDirectiveFromElement(fromEl, false)) {
13801380
setValueOnElement(toEl, getElementValue(fromEl));
13811381
}
13821382
const elementChanges = externalMutationTracker.getChangedElement(fromEl);

src/LiveComponent/assets/src/morphdom.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ export function executeMorphdom(
110110
// We skip this for non-model elements and allow this to either
111111
// maintain the value if changed (see code above) or for the
112112
// morphing process to update it to the value from the server.
113-
if (fromEl === document.activeElement
114-
&& fromEl !== document.body
115-
&& null !== getModelDirectiveFromElement(fromEl, false)
113+
if (
114+
fromEl === document.activeElement &&
115+
fromEl !== document.body &&
116+
null !== getModelDirectiveFromElement(fromEl, false)
116117
) {
117118
setValueOnElement(toEl, getElementValue(fromEl));
118119
}

src/LiveComponent/doc/index.rst

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
Live Components
22
===============
33

4-
.. caution::
5-
6-
This component is currently experimental and is likely to change, or even
7-
change drastically.
8-
94
Live components builds on top of the `TwigComponent`_ library
105
to give you the power to automatically update your Twig components on
116
the frontend as the user interacts with them. Inspired by
@@ -3528,8 +3523,10 @@ This bundle aims at following the same Backward Compatibility promise as
35283523
the Symfony framework:
35293524
https://symfony.com/doc/current/contributing/code/bc.html
35303525

3531-
However it is currently considered `experimental`_, meaning it is not
3532-
bound to Symfony's BC policy for the moment.
3526+
For JavaScript files, the public API (i.e. documented features and exports
3527+
from the main JavaScript file) is protected by the backward compatibility
3528+
promise. However, any internal implementation in the JavaScript files
3529+
(i.e. exports from internal files) is not protected.
35333530

35343531
.. _`TwigComponent`: https://symfony.com/bundles/ux-twig-component/current/index.html
35353532
.. _TwigComponent documentation: https://symfony.com/bundles/ux-twig-component/current/index.html
@@ -3538,7 +3535,6 @@ bound to Symfony's BC policy for the moment.
35383535
.. _`Twig Component`: https://symfony.com/bundles/ux-twig-component/current/index.html
35393536
.. _`Twig Component mount documentation`: https://symfony.com/bundles/ux-twig-component/current/index.html#the-mount-method
35403537
.. _`Symfony form`: https://symfony.com/doc/current/forms.html
3541-
.. _`experimental`: https://symfony.com/doc/current/contributing/code/experimental.html
35423538
.. _`dependent form fields`: https://ux.symfony.com/live-component/demos/dependent-form-fields
35433539
.. _StimulusBundle configured in your app: https://symfony.com/bundles/StimulusBundle/current/index.html
35443540
.. _`attributes variable`: https://symfony.com/bundles/ux-twig-component/current/index.html#component-attributes

src/LiveComponent/src/Attribute/AsLiveComponent.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
* @see https://symfony.com/bundles/ux-live-component
2121
*
2222
* @author Kevin Bond <[email protected]>
23-
*
24-
* @experimental
2523
*/
2624
#[\Attribute(\Attribute::TARGET_CLASS)]
2725
final class AsLiveComponent extends AsTwigComponent

src/LiveComponent/src/Attribute/LiveAction.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* An attribute to register a LiveAction method.
1616
*
1717
* @see https://symfony.com/bundles/ux-live-component/current/index.html#actions
18-
*
19-
* @experimental
2018
*/
2119
#[\Attribute(\Attribute::TARGET_METHOD)]
2220
class LiveAction

src/LiveComponent/src/Attribute/LiveArg.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* @see https://symfony.com/bundles/ux-live-component/current/index.html#actions-arguments
1818
*
1919
* @author Tomas Norkūnas <[email protected]>
20-
*
21-
* @experimental
2220
*/
2321
#[\Attribute(\Attribute::TARGET_PARAMETER)]
2422
final class LiveArg

src/LiveComponent/src/Attribute/LiveListener.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
* method and re-render the component.
1919
*
2020
* @see https://symfony.com/bundles/ux-live-component/current/index.html#listeners
21-
*
22-
* @experimental
2321
*/
2422
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
2523
class LiveListener extends LiveAction

src/LiveComponent/src/Attribute/LiveProp.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* An attribute to mark a property as a "LiveProp".
1616
*
1717
* @see https://symfony.com/bundles/ux-live-component/current/index.html#liveprops-stateful-component-properties
18-
*
19-
* @experimental
2018
*/
2119
#[\Attribute(\Attribute::TARGET_PROPERTY)]
2220
final class LiveProp

src/LiveComponent/src/Attribute/PostHydrate.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
/**
1515
* An attribute to register a PostHydrate hook.
16-
*
17-
* @experimental
1816
*/
1917
#[\Attribute(\Attribute::TARGET_METHOD)]
2018
final class PostHydrate

0 commit comments

Comments
 (0)