Subscribe on changes!

Pinia for Vue SFC Playground

avatar
Dec 1st 2022

What problem does this feature solve?

Lets users experiment with Pinia on the Vue SFC Playground.

What does the proposed API look like?

import { defineStore } from 'pinia'
__modules__['App.vue'] is undefined
avatar
Dec 1st 2022

pinia.esm-browser dependency on @vue/devtools-api which seems not have a esm-browser version.

avatar
Dec 1st 2022

@jacekkarczmarczyk oh~ It's my fault. It works

avatar
Dec 1st 2022

@jacekkarczmarczyk oh~ It's my fault. It works

Almost:

Error resolving module specifier “pinia”. Relative module specifiers must start with “./”, “../” or “/”.. Tip: add an "import-map.json" file to specify import paths for dependencies.

avatar
Dec 1st 2022

@vanillajonathan this error happens to me only in Firefox and is not related to devtool-api as it happens also with initial empty sfc playground

avatar
Dec 1st 2022

Yeah, I tried to use Firefox. It works in Chrome and Edge though.

Could Vuex, Vue Router and Bootstrap be added too?

Failed to resolve module specifier "vuex". Tip: add an "import-map.json" file to specify import paths for dependencies.

Failed to resolve module specifier "vue-router". Tip: add an "import-map.json" file to specify import paths for dependencies.

Failed to resolve module specifier "bootstrap". Tip: add an "import-map.json" file to specify import paths for dependencies.

avatar
Dec 2nd 2022

Yeah, I tried to use Firefox. It works in Chrome and Edge though.

Could Vuex, Vue Router and Bootstrap be added too?

Failed to resolve module specifier "vuex". Tip: add an "import-map.json" file to specify import paths for dependencies.

Failed to resolve module specifier "vue-router". Tip: add an "import-map.json" file to specify import paths for dependencies.

Failed to resolve module specifier "bootstrap". Tip: add an "import-map.json" file to specify import paths for dependencies.

Try enabling dom.importMaps.enabled

image

avatar
Dec 2nd 2022

With disabled dom.importMaps.enabled set to false:

can't access property "default", modules['App.vue'] is undefined

With disabled dom.importMaps.enabled set to true:

The specifier “pinia” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.

avatar
Dec 16th 2022

I've opened a PR to make using Pinia with the SFC Playground a little less troublesome: #7311. See the example link at the top of the PR.

avatar
Dec 16th 2022

Firefox 108 now supports import maps. :+1: https://www.mozilla.org/en-US/firefox/108.0/releasenotes/