-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[x-license] Introduce usage telemetry #13530
base: master
Are you sure you want to change the base?
Conversation
Deploy preview: https://deploy-preview-13530--material-ui-x.netlify.app/ |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…emetry # Conflicts: # packages/x-license/package.json # pnpm-lock.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this! 🎉
packages/x-telemetry/README.md
Outdated
import { ponyfillGlobal } from "@mui/utils"; | ||
|
||
ponyfillGlobal.__MUI_X_TELEMETRY_ENABLED__ = true; | ||
// or | ||
ponyfillGlobal.__MUI_X_TELEMETRY_DISABLED__ = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of exposing ponyfillGlobal
, I would prefer exporting a function from @mui/x-telemetry
:
import { setTelemetryStatus } from "@mui/x-telemetry";
setTelemetryStatus(true);
// or
setTelemetryStatus(false);
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we would have this ability, which I've also documented in the readme file.
import { muiXTelemetrySettings } from '@mui/x-telemetry';
muiXTelemetrySettings.enableTelemetry();
// or
muiXTelemetrySettings.disableTelemetry();
The main problem why I've added the option with setting on the global object, is that in some cases when you would install only @mui/x-data-grid-pro,
some package managers (as pnpm
) would not allow you to access @mui/x-telemetry
package without adding it to your package.json:
![](https://private-user-images.githubusercontent.com/12295460/344613602-6a1810c3-f7b2-4f19-a403-4a4f170dd459.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE1NTkwMzQsIm5iZiI6MTcyMTU1ODczNCwicGF0aCI6Ii8xMjI5NTQ2MC8zNDQ2MTM2MDItNmExODEwYzMtZjdiMi00ZjE5LWE0MDMtNGE0ZjE3MGRkNDU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIxVDEwNDUzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA2YjYwM2VmYzM4ZTVkYTA5YWE5NmU4MDhkZmQwOWQ5ZWU5MjdmZjQzNDY5ZDRkZjkxYjI3MzljMzMyOWJiYjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.wDiHz2nBQzXXEDooWtZwbG2WY0mdwQyPXJ0KmwVyrXM)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the next major version, people using a commercial package will have to set their license using @mui/x-license
, they won't be able to do it through the commercial package.
And as you said they will have to install @mui/x-license
explicitly when using pnpm.
So if you need to expose something, you can always re-export it from @mui/x-license
👍
As long as the name is explicit enough outside of the telemetry package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flaviendelangle Yeah, this makes sense 👍🏻
However, this would only work for commercial users, while the telemetry should also cover non-commercial users, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mui/x-telemetry
being a dep of @mui/x-license
in this package and not a dep of the other packages, I took for granted that it was only targeting commercial users.
But if this is not the case then you are entirely right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mui/x-telemetry being a dep of @mui/x-license in this package and not a dep of the other packages, I took for granted that it was only targeting commercial users.
I didn't notice this and assumed that we were targeting all users 😅
Anyway, it's good that this question came up!
@joserodolfofreitas What do you think? Should we only target commercial users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should start targeting commercial users. In the future, it'd also be nice to collect data from the community plan, although it may be harder to convince our users to do that.
With the license validation there's almost an expectation that there's a connection with our servers at some point.
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…etry # Conflicts: # packages/x-license/package.json # packages/x-license/src/verifyLicense/verifyLicense.ts # pnpm-lock.yaml # tsconfig.json
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Goals
Background
MUI X was released almost 4 years ago, and the library has grown considerably in these 4 years, from new features to better defaults for all users. The way that we've been approaching this improvement process has been very much a manual one.
We're at MUI using the advanced components in some of our applications and plan to extend its usage across our codebases to dogfood MUI X internally more and make improvements based on our experiences.
On top of that, we actively engage with the community to gather feedback. For example, which components or features do you use mostly, ways to customise components, and more. This feedback is extremely valuable in steering feature development for MUI X.
However, there is a problem with this approach, which is that we can only collect feedback from a subset of users. This subset may have different needs and use-cases than you.
For this reason, we're currently exploring a more automated approach to collecting these points of feedback so that we can improve MUI X even more in the near future.
Furthermore, this will allow us to verify if improvements made to the components are improving the baseline of all applications.
Proposal
We're planning to add anonymized telemetry to the MUI X during the development process (excluding
NODE_ENV=production
). We'll provide an optional opt-out through an environment variable or CLI command. For the start, it will be disabled by default for all users with the ability to opt-in so we would be able to test it.When enabled the CLI will collect telemetry at development and build time, when telemetry is collected we'll show a message explaining that telemetry is being collected with a link to documentation.
When telemetry is collected it'll be possible to add a flag to see the exact values being sent. These values, as said before, will be completely anonymized.
Its focus is on complete anonymity, and allows users to opt-in to send anonymous data (by default, it's disabled now).
Once the initial implementation has landed, we can investigate exposing the results to the community through public dashboards.
Demo preview
https://codesandbox.io/p/devbox/mui-x-telemetry-demo-522zyz
There's quite a few open source projects that take a similar approach, most notably: