ktquez / vue-disqus

Integrate Disqus count and comments in your application Vue 3, with support for SPA
https://ktquez.github.io/vue-disqus/
MIT License
253 stars 26 forks source link

Add umd to umd #3

Closed myst729 closed 7 years ago

myst729 commented 7 years ago

The major change is in vue-disqus.js. With umd support, the component is adaptive to more use cases.

There are some breaking changes though:

  1. Since it's umd ready, the main field in package.json is pointed to the JS file now. This favors people that don't use webpack or browserify in their projects.

  2. As Disqus has occupied the namespace DISQUS, for concerns of clearness, the component's name is altered to vue-disqus (was disqus), and the global variable is VueDisqus. The changes has been reflected in the README.

myst729 commented 7 years ago

I think a better way is to use a build tool to generate the JS file. So that we don't have to manually maintain two files.

I have a similar project that wraps LiveRe into a vue component, which is using webpack. Then I only need to maintain the *.vue file and build the JS dist file.

Also, the dist JS only exports the component's content. The developer who uses it need to register the component in his code. This makes the developer's project dependencies more readable.

How about this approach?

ktquez commented 7 years ago

Perfect! Thanks for this contribution, I will merge and push a new version already with its changes. Actually this change to support UMD is really necessary, making it even easier.

Thanks