@prismicio/slice-simulator-vue Deprecation Guide

@prismicio/slice-simulator-vue is deprecated. Its functionalities are now distributed through @slicemachine/adapter-nuxt2.

@prismicio/slice-simulator-vue, a package providing a component to simulate Slices in Slice Machine UI and the Page Builder, is deprecated. Its functionalities are now distributed through @slicemachine/adapter-nuxt2.

Update packages in package.json

  • Remove @prismicio/slice-simulator-vue from your package.json.
package.json
  {
    "devDependencies": {
-     "@prismicio/slice-simulator-vue": "^0.2.0"
    }
  }
  • Update your package.json to use the latest version of @slicemachine/adapter-nuxt2.
package.json
  {
    "devDependencies": {
+     "@slicemachine/adapter-nuxt2": "^0.3.0"
    }
  }
  • Update your installed packages with npm.
npm install

Handling breaking changes

The following changes are required when upgrading your simulator to @slicemachine/adapter-nuxt2 v0.

Replace imports

Replace imports for @prismicio/slice-simulator-vue with @slicemachine/adapter-nuxt2 on your simulator page.

./pages/slice-simulator.vue
- import { SliceSimulator } from '@prismicio/slice-simulator-vue/dist/simulator.cjs'
+ import { SliceSimulator } from '@slicemachine/adapter-nuxt2/dist/simulator.cjs'

Remove state prop if still present

The deprecated state prop from @prismicio/slice-simulator-vue has been removed with @slicemachine/adapter-nuxt2. If you were still using it, you now have to remove it:

./pages/slice-simulator.vue
  <template>
  	<SliceSimulator
- 	  :state="state"
			v-slot="{ slices }"
	  >
  		<SliceZone :slices="slices" :components="components" />
  	</SliceSimulator>
  </template>

  <script>
  import { SliceSimulator } from '@slicemachine/adapter-nuxt2/dist/simulator.cjs'
- import state from '~~/.slicemachine/libraries-state.json'
  import { components } from '~/slices'

  export default {
  	components: {
  		SliceSimulator,
  	},
  	data () {
  		return {
- 		  state,
			  components
			 }
  	}
  }
</script>