Migrate sanity and try to fix preview issue #202
Draft
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.
Description
The preview functionality is currently set up in a way that builds and deploys (unpublished) draft pages that has previously been published. This pr attempts to fix this by updating package versions and refactoring code structure.
Status
Sanity has been updated to v3 according to this guide, but it seems the guide hasn't been followed from this section and onward. Also, currently
npm run dev
script is not working, possibly due to some remaining packages not mentioned in the guide are dependent on uninstalled@sanity/core
.next-sanity
has been updated to v2 and migration according to this guide has been made. Due to the missing steps in migrating Sanity it is difficult to say if thenext-sanity
related refactoring is satisfactory. There are also more refactoring needed throughout the site in order for this to be fully completed. One big change is thatcreatePreviewSubscriptionHook
is replaced withdefinePreview
.With that said, it's difficult to say if this will solve the problem at hand. But still these changed are needed.
References