DavidWells / DavidWells/analytics

Vue plugin

Open
#110 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.7k
Forks
267
PR merge metrics
No merged PRs in 30d

Description

Hi,

I've made a Vue plugin for the analytics package.

  • Plugin registration and the instance inheritance within Vue components is based on how Vuetify does it.
    • This means all components inherit the same instance, but any component can have its instances overriden, and in that case all children will use the new instance instead.
    • It also means that the plugin remembers if it was already installed for a particular Vue constructor.
  • Plugin adds $analytics to Vue instance
  • Additions to Vue instance are covered by TypeScript
  • Integrated with vue-router
    • The plugin auto-tracks route changes if router is passed as an option to Vue.use()
The usage is like so
import Vue from 'vue';
import VueAnalytics from './analytics-vue-plugin';

import router from './router';

// Install plugin
Vue.use(VueAnalytics, {
  // Pass router to track route changes
  router,
});

// Configure analytics
const analytics = new VueAnalytics({
  mixpanelToken,
});

new Vue({
  // Pass to Vue instance
  analytics,
  router,
  vuetify,
  render: (h: CreateElement): VNode => h(App),
}).$mount('#root');

I would like to contribute it to the project.

Does that fall within the scope of the project?

What would be the best course of action? Would it be fine to make a branch with it as suggested here https://github.com/DavidWells/analytics/blob/master/CONTRIBUTING.md?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review CONTRIBUTING.md and the proposed analytics-vue-plugin entry point described in the issue. First confirm whether a Vue integration is within the project's scope and how contributions should be structured; completion criteria are not defined because the issue only asks for maintainer guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.