Preview tokens 3: Preview URL refactoring #6823
Merged
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.
🚨 Merge first
Description
Summary of changes
A PR with three related refactoring changes to the existing preview URL logic.
Reasoning
$page->previewUrl()
and$site->previewUrl()
would become even more in following PRs if we wouldn't DRY ittoken
query param in draft preview URLs to_token
as the generation logic of those tokens will change anyway (in PR 8)Additional context
$page->previewUrl()
and$site->previewUrl()
can stay as aliases/shortcuts as they do no harm and might be useful to devs as well.Changelog
Housekeeping
$page->previewUrl()
and$site->previewUrl()
in$version->url()
(with aliases to the existing methods)Breaking changes
token
query param for preview URLs to_token
for consistency with the new_version
paramBreaking changes (since alphas)
$page->previewUrl($version)
to$page->previewUrl($versionId)
for consistency with other methodsReady?
For review team
Add lab and/or sandbox examples (wherever helpful)