You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/LiveComponent/src/EventListener/DeferLiveComponentSubscriber.php
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -33,16 +33,23 @@ public function onPostMount(PostMountEvent $event): void
33
33
$data = $event->getData();
34
34
35
35
if (\array_key_exists('defer', $data)) {
36
-
trigger_deprecation('symfony/ux-live-component', '2.17', 'The "defer" attribute is deprecated and will be removed in 3.0. Use the "loading" attribute instead set to the value "defer"');
36
+
trigger_deprecation('symfony/ux-live-component', '2.17', 'The "defer" attribute is deprecated and will be removed in 3.0. Use the "loading" attribute instead set to the value "defer".');
37
37
if ($data['defer']) {
38
38
$event->addExtraMetadata('loading', 'defer');
39
39
}
40
40
unset($data['defer']);
41
41
}
42
42
43
43
if (\array_key_exists('loading', $data)) {
44
-
if (\in_array($data['loading'], ['defer', 'lazy'], true)) {
$this->expectDeprecation('Since symfony/ux-live-component 2.17: The "defer" attribute is deprecated and will be removed in 3.0. Use the "loading" attribute instead.');
47
+
$this->expectDeprecation('Since symfony/ux-live-component 2.17: The "defer" attribute is deprecated and will be removed in 3.0. Use the "loading" attribute instead set to the value "defer".');
48
48
49
49
$subscriber->onPostMount($event);
50
50
@@ -62,7 +62,7 @@ public function testDeferAttributeTriggerDeprecation()
62
62
'defer' => true,
63
63
]);
64
64
65
-
$this->expectDeprecation('Since symfony/ux-live-component 2.17: The "defer" attribute is deprecated and will be removed in 3.0. Use the "loading" attribute instead.');
65
+
$this->expectDeprecation('Since symfony/ux-live-component 2.17: The "defer" attribute is deprecated and will be removed in 3.0. Use the "loading" attribute instead set to the value "defer".');
66
66
67
67
$subscriber->onPostMount($event);
68
68
}
@@ -83,6 +83,31 @@ public function testLoadingAttributesAreRemoved()
0 commit comments