Closed rdunk closed 4 days ago
The latest updates on your projects. Learn more about Vercel for Git βοΈ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
live-visual-editing-next | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 18, 2024 5:28pm |
visual-editing-astro | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 18, 2024 5:28pm |
visual-editing-next | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 18, 2024 5:28pm |
visual-editing-next-with-i18n | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 18, 2024 5:28pm |
visual-editing-nuxt | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 18, 2024 5:28pm |
visual-editing-page-builder-demo | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 18, 2024 5:28pm |
visual-editing-remix | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 18, 2024 5:28pm |
visual-editing-storybook | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 18, 2024 5:28pm |
visual-editing-svelte | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 18, 2024 5:28pm |
This is kind of a fix dressed up as a feat.
Accessing optimistic document snapshots is currently error prone as it is assumed the snapshot will be available, in actual fact it may not be as snapshots have to be fetched from Content Lake via Presentation tool. In most situations this is fine as user interaction is required to trigger some document snapshot getter and so will likely not occur immediately
doc.get()
returns a snapshot and throws if the snapshot is unavailable. This is now deprecated.doc.getSnapshot()
replaces it. It returns a promise which is resolved when the snapshot is actually returned.As a result the Context Menu now has a loading state (video below demonstrates this with an artificial 5s delay added to snapshot fetching), and interactions like drag and drop will await the snapshot resolution before patches are applied, rather than just throwing.
Similarly
doc.patch((context) => {...}
will currently throw if used before snapshots have been fetched. In this PRsnapshot
is deprecated but still available on this context object, however the property has been replaced with a getter so that it will not throw unless explicitly accessed.snapshot
is replaced withgetSnapshot
which similarly returns a promise.https://github.com/user-attachments/assets/38ad7c1b-68b8-4d17-95f9-da2ee5523ff3