8000 minor #60431 [WebLink] Hint that prerender is deprecated (dunglas) · symfony/symfony@255d35f · GitHub
[go: up one dir, main page]

Skip to content

Commit 255d35f

Browse files
minor #60431 [WebLink] Hint that prerender is deprecated (dunglas)
This PR was merged into the 6.4 branch. Discussion ---------- [WebLink] Hint that prerender is deprecated | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | n/a | License | MIT [`prerender` ](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/prerender) has been deprecated. Add a hint in the PHPDoc not to use it. I decided not to deprecate the constant and the function itself because even if the keyword is deprecated in the web platform, it can be useful. Commits ------- fc10d48 [WebLink] Hint that prerender is deprecated
2 parents ca85f5f + fc10d48 commit 255d35f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Symfony/Bridge/Twig/Extension/WebLinkExtension.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getFunctions(): array
4646
/**
4747
* Adds a "Link" HTTP header.
4848
*
49-
* @param string $rel The relation type (e.g. "preload", "prefetch", "prerender" or "dns-prefetch")
49+
* @param string $rel The relation type (e.g. "preload", "prefetch", or "dns-prefetch")
5050
* @param array $attributes The attributes of this link (e.g. "['as' => true]", "['pr' => 0.5]")
5151
*
5252
* @return string The relation URI
@@ -117,7 +117,11 @@ public function prefetch(string $uri, array $attributes = []): string
117117
}
118118
8000
119119
/**
120-
* Indicates to the client that it should prerender this resource .
120+
* Indicates to the client that it should prerender this resource.
121+
*
122+
* This feature is deprecated and superseded by the Speculation Rules API.
123+
*
124+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/prerender
121125
*
122126
* @param array $attributes The attributes of this link (e.g. "['as' => true]", "['pr' => 0.5]")
123127
*

src/Symfony/Component/WebLink/Link.php

+6
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ class Link implements EvolvableLinkInterface
9898
public const REL_PREDECESSOR_VERSION = 'predecessor-version';
9999
public const REL_PREFETCH = 'prefetch';
100100
public const REL_PRELOAD = 'preload';
101+
102+
/**
103+
* This feature is deprecated and superseded by the Speculation Rules API.
104+
*
105+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/prerender
106+
*/
101107
public const REL_PRERENDER = 'prerender';
102108
public const REL_PREV = 'prev';
103109
public const REL_PREVIEW = 'preview';

0 commit comments

Comments
 (0)
0