wray.pro

Another new site?

A less than smooth move from Gatsby and Prismic Legacy to Nuxt 3 and Prismic Slice Machine.
24 ∕ 09 ∕ 2024

Another half decade another new website!

With Gatsby practically dead and Prismic dropping support for it I thought it would be a good idea to see how Nuxt is doing these days and dive into Nuxt 3.

Unfortunately, that means updating my Prismic site from their legacy platform to their new "Slice Machine" - and things from the get-go looked complicated.

Although there are seemingly helpful video tutorials, they lack a lot of basic stuff like retrieving data from "Static Zones" and how to handle "Content Relationships".

Prismic's Slice Machine generates code for your selected technology stack (bare that in mind, Nuxt 3 is a supported platform), and automatically chooses TypeScript, however types are not generated for pages with Content Relationship data types and so every time I tried to use those relationships my code editor complained at me - not the best start.

Moving from Legacy Slices to Slice Machine was fairly simple, some Googling brought up a hidden feature to automatically move the Slices over to the new format - why isn't this turned on by default? For reference it's at http://localhost:9999/labs.

There aren't really enough code examples for Slices either. Some of the other Prismic docs, for Next.js as an example, have a lot of handy "How To" guides. These are surely very quick to create and publish for Prismic if they've tested their technology against the stack, so why are these missing?

I think the biggest grievance was Slice Machine generating bad code which they expect you to copy and paste to use. Any page using useAsyncData is missing an await before it, so that lead to a few hours of hydration error frustration.

Oh, and if you're blocking telemetry Slice Machine runs sooooo slowly.

I still like Prismic as a concept, and once I'd figured out the undocumented bits it works great!

Prismic seem like a good team. I like their product, but their docs really need looking at.

If you're reading this Prismic, I'd be more than happy to come on board and write your docs.