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

[POC] Minified context error message in prod #1248

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atomiks
Copy link
Contributor

@atomiks atomiks commented Dec 30, 2024

Part of #1246

@atomiks atomiks added the core Infrastructure work going on behind the scenes label Dec 30, 2024
Comment on lines +1 to +3
export function productionContextError(): never {
throw new Error('Base UI: Invalid component tree');
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React's minified errors link to a webpage that details the error, but this seems unnecessary for invalid component trees since it's certain to be encountered while developing beforehand

@mui-bot
Copy link

mui-bot commented Dec 30, 2024

Netlify deploy preview

https://deploy-preview-1248--base-ui.netlify.app/

Generated by 🚫 dangerJS against 427710e

@michaldudak
Copy link
Member

This will surely shave off a few bytes but looks quite bad in source code. Have you considered using a similar solution to what's in Material UI? We have a Babel macro that minifies these messages.

@atomiks
Copy link
Contributor Author

atomiks commented Jan 2, 2025

Have you considered using a similar solution to what's in Material UI? We have a Babel macro that minifies these messages.

Do you have a link/example of the source?

@mj12albert
Copy link
Member

link/example of the source

Check out this PR mui/material-ui#43904 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants