Hello!
Our team recently spun up a new NextJS project that uses the latest versions of @prismicio/react
and @prismicio/next
, but we have a few questions about Prismic Toolbar.
There is no edit button as advertised
We are able to see the preview toolbar successfully, but we do not see the "Edit" button that is shown on the Prismic marketing site.
Our website:
Prismic marketing website:
I also noticed in the Prismic NextJS Youtube tutorial that is embedded on this documentation page, the edit button is not visible here either.
Can someone clarify if the Prismic website does not accurately depict the state of Prismic Toolbar, or are the tutorials missing a step? I read this thread in the Prismic Community but it does not seem like the explanations given pertain to our application.
Why is the Prismic Toolbar taking screenshots?
In poking at the Prismic Toolbar Github repository, I noticed there was code to screenshot a page and upload it to Amazon S3. Can someone from the Prismic team explain what is happening here?
Why does the Prismic Toolbar not use versions or hash integrity?
The Prismic Toolbar Github repository explicitly calls out that it switched from being an npm package to a CDN hosted script,
Isn't anymore on npm. Include script static.cdn.prismic.io/prismic.min.js instead
This script then gets dynamically loaded on the page by @prismicio/react
.
I would like to better understand why the Prismic team chose to do this. From my perspective, not having versions makes the Prismic Toolbar much riskier, as you can ship an update directly to our production website that inadvertently breaks something, whereas with versioned updates we can bring them into our application at our own pace. There are many other well documented risks with using a CDN over a versioned package, and it's just odd given the rest of the Prismic ecosystem is a versioned package.
Additionally, the CDN script tag you're constructing does not abide by common security standards such as integrity hashes. You can see this used by popular libraries such as Bootstrap,
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.min.js" integrity="sha384-ODmDIVzN+pFdexxHEHFBQH3/9/vQ9uori45z4JjnFsRydbmQbmL5t1tQ0culUzyK" crossorigin="anonymous"></script>