Giter Club home page Giter Club logo

speedcurve-module's Introduction

@nuxtjs/speedcurve

npm version npm downloads Github Actions CI Codecov License

Speedcurve LUX integration for Nuxt 2

Features

  • Collect performance metrics from real users
  • See Javascript errors in your Speedcurve dashboard
  • Add user data to visits to cross reference cohorts and performance
  • Create custom performance markers for deep insights
  • Minimal configuration with sensible defaults
  • On-the-fly runtime config support

Setup

  1. Add @nuxtjs/speedcurve dependency to your project
yarn add @nuxtjs/speedcurve # or npm install @nuxtjs/speedcurve
  1. Add @nuxtjs/speedcurve to the modules section of nuxt.config.js
{
  modules: [
    // Simple usage
    '@nuxtjs/speedcurve',

    // With options
    ['@nuxtjs/speedcurve', { /* module options */ }]
  ]
}

or add options to the lux property in your nuxt.config.js

{
  modules: ['@nuxtjs/speedcurve'],

  lux: {
    // id: 'YOUR_LUX_ID'
    // debugMode: false,
    // enabled: true,
    // logFirstHit: true,
    // sampleRate: 100,
    // translateBool: true,
    // autoStartOnNav: true
  }
}

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using npm run dev

License

MIT License

Copyright (c) Josh Deltener [email protected]

speedcurve-module's People

Contributors

atinux avatar harlan-zw avatar hecktarzuli avatar pi0 avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

speedcurve-module's Issues

Inject LUX to the head

As mentioned in both start guide and notice about tag managers, we should start performance measurement as soon as possible. Before the hydration starts and nuxt executes plugins, almost all scripts are already prefetched, parsed or executed so we may have miss CPU timings (this at least noticed in docs)

Where to insert the snippet
The lux.js script is loaded asynchronously so it won't harm the performance of your site. It's best to put the LUX snippet as early in the page as possible, i.e., at the top of the HEAD element.

Possible Solutions

  1. One way would be using vue-meta and push script within module like this:
  this.options.head.script.push({
    hid: 'lux',
    innerHTML: '<long script>'
  })
  1. It can be also done at runtime via plugin (SSR) to inject but is little bit tricky. An example is here. This is required if snippet is depending on some config (like current runtimeConfig possibility)

  2. Not sticking with original snippet may be hacky and breaking in the future but since we are already doing, we may partially inject option independent lines (here) which just initialize PerformanceObserver and then we can do rest of stuff in plugin.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Using npm packages for Renovate presets is now deprecated. Please migrate to repository-based presets instead.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/setup-node v1
  • actions/cache v1
  • codecov/codecov-action v1
npm
docs/package.json
  • @nuxt/content-theme-docs ^0.5.4
  • nuxt ^2.14.4
package.json
  • semver ^7.3.2
  • @nuxt/content-theme-docs ^0.5.4

  • Check this box to trigger a request for Renovate to run again on this repository

Nuxt 3

Does this module also work for Nuxt 3?

Nuxt 3 Support

Hey ๐Ÿ‘‹ It looks like this module hasn't been updated for Nuxt 3. In an effort to improve the developer experience of modules, I've updated the module to clarify that it only supports Nuxt 2.

If Nuxt 3 support is added it will be moved to the https://github.com/nuxt-modules organisation.

@hecktarzuli Is Nuxt 3 support something you have planned? If not, perhaps we can deprecate this module?

Please let us know and thanks for your work!

Head doesn't reset per page generation when using classic static + nuxt 2.11, but does in 2.14.4

When using this module on a Nuxt 2.11 site (target: server, mode: 'universal', 'generate') the metas don't seem to be reset per page generation.

It's almost like we need to manually check for the meta to exist ourselves which is strange.
https://github.com/nuxt-community/speedcurve-module/blob/master/lib/templates/plugin.js#L80

image

After updating my site to Nuxt 2.14.4, it looks fine. Did something change since 2.11?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.