Repository navigation
Conversation
Browsers no longer prerender pages for rel=prerender: Chromium only prefetches the resource and moved prerendering to the Speculation Rules API, Firefox and Safari never supported it. The helper is deprecated for removal in 5.0. modulepreload, the relation for ES modules, had no helper and gets one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Browsers no longer prerender pages for
rel=prerender: Chromium only prefetches the resource ("NoState Prefetch") and moved prerendering to the Speculation Rules API, while Firefox and Safari never supported it. At the same time the package has no helper formodulepreload, the relation for ES modules.This PR:
PreloadManager::prerender()for removal in 5.0 (@deprecatedplustrigger_deprecation());link($uri, 'prerender')keeps working for anyone who still wants the header entry;PreloadManager::modulepreload();symfony/deprecation-contracts(^2|^3, as in joomla/event) torequirefortrigger_deprecation().Testing Instructions
php vendor/bin/phpunit.testModulepreloadcovers the new helper;testPrerendernow also expects the deprecation message (#[IgnoreDeprecations]+expectUserDeprecationMessage()). Both fail without the change insrc/.Documentation Changes Required
docs/classes/PreloadManager.md: new "Preload a JavaScript module" section, deprecation note in "Prerender a resource". The removal itself is documented indocs/v4-to-v5-update.mdby the 5.x PR that removes the method.The owner's docs PR #12 says in
docs/overview.md("Things to know before you build on this" →modulepreloadis missing.) that there is no helper and recommendslink($uri, 'modulepreload'), and listsprerenderamong the helpers; that paragraph needs adjusting when the second of the two PRs is merged.Related to #14 (both add
use PHPUnit\Framework\Attributes\TestDox;at the same place intests/PreloadManagerTest.php; expect a small conflict there when the second one is merged).🤖 Generated with Claude Code