Is there a command to delete custom slices using the CLI? I ran prismic sm --help but did not see that as an option. Or is there a way to do this in the SliceMachine and/or Storybook UI?
Else, I think I managed to delete manually by deleting the slice folder + import from the slice/index.js — anything else I should consider?
There is no command yet to delete a slice. You need to delete it manually by deleting the folder. I understand how important it is to delete a created slice, but Slice-machine is still in beta, and our team is working on it to improve its feature.
I have few other questions regarding this issue. As described, I managed to delete a custom slice manually by deleting/updating the following files from my local folder:
updated: slices/index.js (removed 'export { default as MySliceName } from "./MySliceName";'
Since deleting these files, the slice is no longer visible in my StoryBook or SliceMachine UI (as expected). However, it still shows up inside of my editor in Prismic under shared slices (see screenshot). Is there another step I need to do to remove this from Prismic? (FYI: I did also try clearing the browser cache/opening in private mode (Chrome), but the result was the same).
This is all you need to do. But once the slices have pushed to the Prismic UI, they will always be available in the shared tab even though you have deleted them from the code. I'll discuss this with my dev team to include this in their future improvements and will let you know what they think.
I have discussed this with the team and this is something planned for future improvements yes! Being able to fully delete a slice, renaming it.
There will be a custom-type API where you will be able to update, delete shared slices, and documentation will release soon. You can check the progress here.
Thanks,
Priyanka
1 Like
system
(system)
closed as resolved, flag & select 'Something Else' to reopen.
9
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
At the moment if I want to delete a slice, I need to go in my codebase and delete all files/mentions of the slice I want to delete. Having a button within the web dashboard will be great!
We will be kicking off our sessions next week. The session will be run through Google Meet and will take around 45 minutes to complete. As a thank you for your time, we'll provide you with an $35 USD gift card.
What to expect during the session:
We will show you a design prototype for Custom Type deletion.
You’ll share your screen with us and talk us through how you’d expect to use this feature.
We’ll also ask you some questions based on the prototype and your particular use case.