GithubHelp home page GithubHelp logo

vaadin-usage-statistics's Issues

Missing export with "npm i --ignore-script"

Hello,

When installing a project with npm install --ignore-script, the usageStatistics method is not exported in the vaadin-usage-statistics.js file. This is the actual content:

import './vaadin-usage-statistics-collect.js';

Thus, making it unusable as soon as you want to build a project using a vaadin component.

A solution could be to change the default content to the following:

export { usageStatistics } from './vaadin-usage-statistics-collect.js';

What do you think ?
I'd tried to make a PR myself, but I'm a little lost on how/which file I should modify to commit the changes. How vaadin-usage-statistics-collect.html is transpiled into vaadin-usage-statistics-collect.js ?
Thanks for reading my issue and keep up the good work !

Output message only once per installation

With the latest Flow, that uses shrinkwrap packages, you see the info message three times during npm install

> @vaadin/[email protected] postinstall .../node_modules/@vaadin/vaadin-core-shrinkwrap/node_modules/@vaadin/vaadin-usage-statistics
> node check.js


    Vaadin collects development time usage statistics to improve this product. To opt-out, either run:
    npm explore @vaadin/vaadin-usage-statistics -- npm run disable
    to store disable statistics for the machine, or add
    "vaadin": { "disableUsageStatistics": true }
    to the project package.json and re-run npm install to disable statistics for the project.

    For more details, see https://github.com/vaadin/vaadin-usage-statistics
  

> @vaadin/[email protected] postinstall .../node_modules/@vaadin/vaadin-shrinkwrap/node_modules/@vaadin/vaadin-usage-statistics
> node check.js


    Vaadin collects development time usage statistics to improve this product. To opt-out, either run:
    npm explore @vaadin/vaadin-usage-statistics -- npm run disable
    to store disable statistics for the machine, or add
    "vaadin": { "disableUsageStatistics": true }
    to the project package.json and re-run npm install to disable statistics for the project.

    For more details, see https://github.com/vaadin/vaadin-usage-statistics
  

> @vaadin/[email protected] postinstall .../node_modules/@vaadin/vaadin-usage-statistics
> node check.js


    Vaadin collects development time usage statistics to improve this product. To opt-out, either run:
    npm explore @vaadin/vaadin-usage-statistics -- npm run disable
    to store disable statistics for the machine, or add
    "vaadin": { "disableUsageStatistics": true }
    to the project package.json and re-run npm install to disable statistics for the project.

    For more details, see https://github.com/vaadin/vaadin-usage-statistics

Using optout branch with bower --force-latest.

It seems Bower with --force-latest has problems to use the optout branch, even when we define the commit hash in resolutions.

Excerpt from bower.json:

{
  "dependencies": {
    "vaadin-grid": "vaadin/vaadin-grid#5.0.4",
    "vaadin-usage-statistics": "vaadin/vaadin-usage-statistics#optout"
  },
  "resolutions": {
    "vaadin-usage-statistics": "e-tag:61ea340"
  }
}

Remove list of Vaadin elements

There is no way that this can work if you list Vaadin elements to check for. The list is already outdated / missing elements.

options in package.json

It would be nice to have an option in the package.json file to avoid using the vaadin-stats module instead of running a command.

Exemple: package.json

{
  ...
  anonymousStatistics: false     // or vaadinStats: false
  ...
}

Even disabled, vaadin-usage-statistics pollutes `window.localStorage`

Per the instructions on how to opt-out, the vaadin-usage-statistics.js file is indeed empty:

$ cat ./node_modules/@vaadin/vaadin-usage-statistics/vaadin-usage-statistics.js 
export const usageStatistics = function() {
  /* do nothing */
};

However, in the browser, the window.localStorage object continues to have usage statistics inserted. Running the following code in the console reveals the violation:

for (let i = 0; i < localStorage.length; i++) {
  console.log(i, localStorage.key(i));
}

Console output:

0 vaadin.statistics.firstuse
1 vaadin.statistics.basket

Missing script disable in 2.1.1

In npm package version 2.1.1 there is no disable script in package.json. As a result, opting out via command npm explore @vaadin/vaadin-usage-statistics -- npm run disable fails with error missing script: disable

Optout instructions for npm

There should be instructions in the README about how to opt out when using npm. Preferrably with a method similar to the one for Bower and for Flow

optout + build failed

Hi,

While running:

npm install --production
npm explore @vaadin/vaadin-usage-statistics -- npm run disable
polymer build
...
�[31merror�[39m:	Promise rejection: Error: Could not load @vaadin/vaadin-usage-statistics/vaadin-usage-statistics.js (imported by node_modules/%40vaadin/vaadin-element-mixin/vaadin-element-mixin.js): ENOENT: no such file or directory, open '@vaadin/vaadin-usage-statistics/vaadin-usage-statistics.js'
�[31merror�[39m:	Error: Could not load @vaadin/vaadin-usage-statistics/vaadin-usage-statistics.js (imported by node_modules/%40vaadin/vaadin-element-mixin/vaadin-element-mixin.js): ENOENT: no such file or directory, open '@vaadin/vaadin-usage-statistics/vaadin-usage-statistics.js'

If I enable the stats again, the build works

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.