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

feat: refresh data client-side on preview updates #29

Closed
wants to merge 4 commits into from

Conversation

angeloashmore
Copy link
Member

@angeloashmore angeloashmore commented May 25, 2022

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 allows a page to refresh its preview content without reloading the whole page. This happens when a document is edited + saved while a preview session is open.

When a document is published, the page will continue to perform a full refresh as it did before this PR. A full refresh is currently the only way to hide/reset the Prismic toolbar.

The changes in this PR should result in slightly quicker preview updates and a less jarring preview experience.

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

Merging #29 (b37ab54) into main (9527e85) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #29   +/-   ##
=======================================
  Coverage   99.84%   99.85%           
=======================================
  Files          11       11           
  Lines         661      668    +7     
  Branches       31       31           
=======================================
+ Hits          660      667    +7     
  Partials        1        1           
Impacted Files Coverage Δ
src/PrismicPreview.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9527e85...b37ab54. Read the comment docs.

@github-actions
Copy link

github-actions bot commented May 25, 2022

size-limit report 📦

Path Size
./dist/index.cjs 5.93 KB (+0.27% 🔺)
./dist/index.js 2.76 KB (+0.57% 🔺)

@angeloashmore angeloashmore changed the title feat: refresh data client-side on preview updates and exit feat: refresh data client-side on preview updates Oct 13, 2022
@angeloashmore
Copy link
Member Author

This functionality has been built into PR #63.

@angeloashmore angeloashmore deleted the aa/client-side-refresh-2 branch May 26, 2023 00:39
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