Skip to content

[POC] Minified context error message in prod#1248

Closed
atomiks wants to merge 1 commit intomui:masterfrom
atomiks:core/minified-error-messages
Closed

[POC] Minified context error message in prod#1248
atomiks wants to merge 1 commit intomui:masterfrom
atomiks:core/minified-error-messages

Conversation

@atomiks
Copy link
Contributor

@atomiks atomiks commented Dec 30, 2024

Part of #1246

@atomiks atomiks added the core 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 😬

@atomiks
Copy link
Contributor Author

atomiks commented Feb 20, 2025

Replaced by #1463

@atomiks atomiks closed this Feb 20, 2025
@atomiks atomiks deleted the core/minified-error-messages branch February 20, 2025 05:18
@oliviertassinari oliviertassinari added internal Behind-the-scenes enhancement. Formerly called “core”. and removed core labels Aug 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Behind-the-scenes enhancement. Formerly called “core”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants