Skip to content

[WebLink] Hint that prerender is deprecated #60431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Symfony/Bridge/Twig/Extension/WebLinkExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function getFunctions(): array
/**
* Adds a "Link" HTTP header.
*
* @param string $rel The relation type (e.g. "preload", "prefetch", "prerender" or "dns-prefetch")
* @param string $rel The relation type (e.g. "preload", "prefetch", or "dns-prefetch")
* @param array $attributes The attributes of this link (e.g. "['as' => true]", "['pr' => 0.5]")
*
* @return string The relation URI
Expand Down Expand Up @@ -117,7 +117,11 @@ public function prefetch(string $uri, array $attributes = []): string
}

/**
* Indicates to the client that it should prerender this resource .
* Indicates to the client that it should prerender this resource.
*
* This feature is deprecated and superseded by the Speculation Rules API.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/prerender
*
* @param array $attributes The attributes of this link (e.g. "['as' => true]", "['pr' => 0.5]")
*
Expand Down
6 changes: 6 additions & 0 deletions src/Symfony/Component/WebLink/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ class Link implements EvolvableLinkInterface
public const REL_PREDECESSOR_VERSION = 'predecessor-version';
public const REL_PREFETCH = 'prefetch';
public const REL_PRELOAD = 'preload';

/**
* This feature is deprecated and superseded by the Speculation Rules API.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/prerender
*/
public const REL_PRERENDER = 'prerender';
public const REL_PREV = 'prev';
public const REL_PREVIEW = 'preview';
Expand Down
Loading