Developing slices with variations (without Slice machine)

We've got some slices that we need to adjust and wanted to utilise Variations, is there a way to develop this without using Slice machine (we're using Gatsby)?

I haven't tested it whatsoever and that's a wild idea that popped into my head, but have you tried updating the JSON in the Prismic custom type builder to match the JSON format inside Slice Machine?

Hey @thejuniperstudio,

This is a good question. You can't create variations in the Prismic web app. And, unfortunately, @kris's suggestion won't work. The JSON structure is fundamentally different for variable Slices, and there's no support in the web app interface.

So, the workaround:

slice-machine-ui is meant to create both technology-specific Slice components in your codebase and a corresponding Slice model in your Prismic repo. (And Gatsby support is forthcoming.) However, it should be possible to use slice-machine-ui just to create the model in Prismic.

You should be able to create an sm.json file with

{ "apiEndpoint": "", "libraries": ["~/dummy"] }

And then create Slices in the UI.

You would need to make sure that your repository is on a Slice Machine repo. We also don't have a migration process, yet, so you would need to manually copy old Slices in Slice Machine.

You might have trouble with Storybook, since we haven't debugged the Storybook–Gatsby–Slice Machine integration, and that could be a blocker.

I hope this helps! Let me know if you have any questions about this.

Sam

@thejuniperstudio A follow-up:

One of our developers just told me that our Gatsby plugin doesn't yet support shared Slices (which area the Slices produced by slice-machine-ui). He said he's working on a fix, which should get merged next week. At that point, this should theoretically be possible, though it's uncharted territory.

Sam

1 Like

Definitely up for road-testing that. Where can we watch the release?

@thejuniperstudio I think this is the branch where they're working on it:

I'll share your message with the team so that they can get in touch about beta testing if needed, and I'll follow-up when the shared Slices support is merged.

Sam