Skip to content
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

Open up previewUrl access #6267

Open
markomitranic opened this issue Apr 9, 2024 · 0 comments
Open

Open up previewUrl access #6267

markomitranic opened this issue Apr 9, 2024 · 0 comments
Labels

Comments

@markomitranic
Copy link

markomitranic commented Apr 9, 2024

Is your feature request related to a problem? Please describe.
There is a productionUrl config option that lets us define our own route resolution logic, as well as our own draft API location across multiple domains or even server actions.

The value is stored within the document context and we may import it and use it. In the Sanity code however, there is a 2 year old comment that says that this should remain hidden, signaling that it is unstable - which forces plugin authors (even yourselves, sanity, fx within preview plugins) from using it, so people start making their own, parallel, route resolution systems.

https://github.com/sanity-io/sanity/blob/next/packages/sanity/src/structure/panes/document/DocumentPaneProvider.tsx#L191

Describe the solution you'd like
Perhaps a different comment with a clarification, or removal of the weird comment, or a deprecation in favour of a different system that is being considered?

Describe alternatives you've considered

We can currently use it, as it is exposed. I use it as such:

import { useDocumentPane } from "sanity/structure";
const { previewUrl } = useDocumentPane();
@linear linear bot added the SDX label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant