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

fix(kit): support previews using a /preview/ route prefix #16

Merged
merged 3 commits into from
Oct 13, 2023

Conversation

angeloashmore
Copy link
Member

@angeloashmore angeloashmore commented Oct 13, 2023

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This PR updates the existing @prismicio/svelte/kit preview functions and components to support a new, cleaner method of integrating Prismic previews.

  • redirectToPreviewURL() now prefixes routes with /preview/ (configurable), which enables server rendering.
  • <PrismicPreview> now adds a special navigation handler to prefix links with /preview/ (configurable), which enables server rendering.

Documentation on the recommended SvelteKit app setup and @prismicio/svelte/kit's API will be published soon.

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

@codecov-commenter
Copy link

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (b88da24) 98.00% compared to head (776b359) 98.00%.

❗ Current head 776b359 differs from pull request most recent head 2508778. Consider uploading reports for the commit 2508778 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #16   +/-   ##
=======================================
  Coverage   98.00%   98.00%           
=======================================
  Files          11       11           
  Lines         600      600           
=======================================
  Hits          588      588           
  Misses         12       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@angeloashmore angeloashmore changed the title fix(kit): support previews using a route prefix strategy fix(kit): support previews using a /preview/ route prefix Oct 13, 2023
@angeloashmore angeloashmore merged commit 56646d1 into master Oct 13, 2023
12 checks passed
@angeloashmore angeloashmore deleted the aa/refine-previews branch October 13, 2023 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants