Skip to content

[Breaking change]: Serverside generated preview URLsΒ #27

@kjac

Description

@kjac

Description

Umbraco supports two types of preview:

  • Internal: A preview that is handled by Umbraco. This will usually be the built-in preview expecience.
  • External: A preview that is handled off-site. Usually this is part of a headless setup.

Moving forward, the URL providers will be responsible for generating URLs for both types of previews.

Among other things, this will become the replacement for the "additional preview URLs" concept in Umbraco 13.

Version

Umbraco 17

Previous behavior

The backoffice client was responsible for generating the internal preview URL, whilst external preview URLs were generated by means of the (now removed) SendingContentNotification.

New behavior

Preview URLs are generated by the IUrlProvider implementations.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
  • Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.

Reason for change

There are several reasons.

First and foremost, the SendingContentNotification was removed in V14. Since then we have been missing a viable (built-in) solution for external preview environments.

Secondly, the SendingContentNotification based solution was always meant to be a temporary quick-fix, because we didn't know what kind of uptake an external preview environment would gain. As it turns out, it is a requested feature, and thus we need to support it properly.

Lastly, by moving all preview URL generation to the IUrlProvider, we open up for the eventual option to remove the default preview from the backoffice, simply by unregistering the default URL provider implementation. This requires a fair amount of custom coding to achive today.

Recommended action

If you have custom URL provider implementations, implement the new part(s) of the IUrlProvider.

If you need external preview environments, create an IUrlProvider implementation that generates the appropriate preview URLs.

Specifics can be found in this PR.

Affected APIs

IUrlProvider and UrlInfo.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions