Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[usage-statistics] Move logic related to anonymous usage statistics to separate package #5682

Open
web-padawan opened this issue Mar 17, 2023 · 1 comment
Labels
internal Lit Lit conversion issue refactor Internal improvement

Comments

@web-padawan
Copy link
Member

web-padawan commented Mar 17, 2023

Describe your motivation

The current version of the statistics checker has been implemented around 2018 and it has some issues.
In particular, the fact that this code relies on executing JS from the comment using eval() is just weird.

Now when we support modern browsers with import.meta we could consider re-implementing it.

Describe the solution you'd like

  1. Create a new @vaadin/usage-statistics package in the web components monorepo for 24.1,
  2. Re-implement the actual logic using import.meta if possible, e.g. using Vite as an inspiration,
  3. Make sure only stats are collected and sent as described, and everything works as expected,
  4. Consider also adding UsageStatisticsMixin instead of the ElementMixin for transparency.
@web-padawan web-padawan added internal refactor Internal improvement v24.1 labels Mar 17, 2023
@vursen
Copy link
Contributor

vursen commented Mar 23, 2023

Note, the usage statistics package is included in @vaadin/bundles which is built with Webpack. Webpack doesn't fully support import.meta by default, see webpack/webpack#15833. If somebody uses this package in an app based on Webpack, it won't work. It can probably be worked around by setting up DefinePlugin but that requires manual configuration.

@web-padawan web-padawan added the Lit Lit conversion issue label Mar 27, 2023
@web-padawan web-padawan removed the v24.1 label Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Lit Lit conversion issue refactor Internal improvement
Projects
None yet
Development

No branches or pull requests

2 participants