-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[docs-infra] Move ads to the @mui/docs
package
#42944
Conversation
Netlify deploy previewhttps://deploy-preview-42944--material-ui.netlify.app/ Bundle size report |
I don't know why moving those files to the package results in the following error
Not proud of my fix: 0aa6cf4 |
Have you tried adding a reference to |
It did not worked (or I don't know how to do it correctly) After some code commenting, it appears that the issue does not come from the It's just the |
/** | ||
* The ratio of "ad display" event sent to Google Analytics. | ||
* Used to avoid an exceed on the Google Analytics quotas. | ||
* @default 0.1 |
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'm not following why this should be configurable. Can we hardcode it as a constant?
* @default 0.1 |
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.
We may want it to be different for different products? e.g. Toolpad docs has a lot less traffic.
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'm not really seeing the use case.
I have introduced this sampling because we didn't need to get all the events, we need enough to get statistical significance in the data. I started to collect this data to know the actual distribution of the ad display types. It's meant to make sure that reality matches the configuration intent.
I had surprises once I looked at the data in GA, there were bugs, and the actual ad displayed types were different from what I tried to implement. It took me some time, but I eventually found the bugs. For this, it doesn't matter if the ad is shown in toolpad, base ui, as long as we don't allow toolpad, base ui, etc. to configure the ad display types.
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.
👍 All fine for me, I'm just stating a potential use-case. Personally I don't care for it neither.
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 don't see lot of usecases, so I'm ok to revert this. But IMO this migration to a dedicated package is an opportunity to find (and remove) all the hardcoded piece of code, and find clean way to make them configurable
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.
all the hardcoded piece of code, and find clean way to make them configurable
@alexfauquette I agree with the strategy. In the tactics we use to do this, I think we should focus on looking at MUI X, Toolpad, Base UI docs in this order:
- see what we had to duplicate because we couldn't configure it. Very clear signal.
- see what we wish we were able to duplicate but couldn't, and this led to problematic UX. Clear signal.
- see what we might need to configure in the future. Weak signal. Only worth it if there are no doubts?
This ad constant seems to be case 3.
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.
Only worth it if there are no doubts?
I've seen it as a nice room for experimentation. If this implementation is causing trouble, we can easily replace it by a dumb constant. If the customization was needed for toolpad, base, or X it would be a bigger issue to fix.
@@ -44,6 +44,7 @@ | |||
"devDependencies": { | |||
"@mui/icons-material": "workspace:*", | |||
"@mui/material": "workspace:*", | |||
"@types/gtag.js": "^0.0.20", |
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/code-infra WDYT, would it make sense to specify such types in dependencies
to avoid the need for explicit definition on the consuming side? 🤔
https://github.com/mui/mui-x/pull/13999/files#diff-adfa337ce44dc2902621da20152a048dac41878cf3716dfc4cc56d03aa212a56
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 it could make sense once @mui/docs
adopts the _document.js
implementation (or wherever the GA script is initialized). I'd avoid it to have dependencies declare global variables on dependant projects withoit guaranteeing those will exist.
Followup of #42842
commits
https://github.com/mui/mui-toolpad/blob/4298328c314621b0533974590284eb70f3dfffd9/docs/src/modules/components/SchemaReference.tsx#L4