vue-pouch
vue-pouch copied to clipboard
Add TypeScript support and examples
I couldn't get it to work in Vue.js TypeScript project.
Nor could I. I'm digging into this issue now. I'm trying to use pouch in a Vue.js PWA/TypeScript project using the new Vue CLI 3.
I'll come back with some more details.
I've added a TypeScript example that's working for me. It's probably not great, but it's a start:
https://github.com/assemblethis/pouch-vue/blob/master/README.md
Nice, thank you! But ignoring tslint errors is not very good...
Are you referring to the @ts-ignore syntax:? I read the following article "Don’t let TypeScript slow you down" (https://medium.com/@vitalyb/dont-let-typescript-slow-you-down-92d394ec8c9f) and it suggested using the @ts-ignore syntax with third party libraries that don't natively support typescript since add-on packages can get out of date and cause further problems. It made an argument that: "If you’re using a library that natively supports TypeScript this shouldn’t concern you. If the library doesn’t, then just use it without types."
Yes, I'm referring to the @ts-ignore
. I think I will use it as you wrote, but I'm waiting for TypeScript support :)
If you improve upon the example, please share. I'm new to TypeScript.
I'm new to TypeScript too :)
I switched over to the recommended fork of this project at https://github.com/MDSLKTR/pouch-vue
My TypeScript example still works with the fork. Some reason called pouch-vue now instead of vue-pouch.
I'm going to test out authentication this week. I'll let you know how it goes.
Two auth issues uncovered with the fork at https://github.com/MDSLKTR/pouch-vue
- Closed: https://github.com/MDSLKTR/pouch-vue/issues/3
- Open: https://github.com/MDSLKTR/pouch-vue/issues/4
So far so good, outlook is hopeful that auth will work as needed for my PWA project.
I'm contemplating creating an ES6 module for the fork and including typings for TS.
I've got a pull request to include typescript support for the pouch-vue project which is the successor to this project: https://github.com/MDSLKTR/pouch-vue/pull/9
It might have what you need.