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

[code-infra] Setup error message minification #1463

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Feb 18, 2025

Port core error minification infrastructure:

  • Built on top of [code-infra] Allow specifying a custom error formatter module for error minifcation material-ui#45291
  • Add error extractor in babel
  • Extract all errors, make the behavior opt-out with
    throw /* minify-error-disabled */ new Error('unminified error message');
  • Remove unused babel macros plugin
  • Add production-error page in the docs, use <FormattedErrorMessage /> inside of the mdx to render the formatted error message
    • Statically prerenders all pages for errors. The args are passed through searchParams so they can only be interpolated client side.
  • This PR just demonstrates one minified error. We can expand after review.
  • example
  • example with inerpolation

Questions:

  • Is it ok to use conditional imports for retargeting the error formatter?

@Janpot Janpot added the scope: code-infra Specific to the code-infra product label Feb 18, 2025
Copy link

netlify bot commented Feb 19, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 82ab7de
🔍 Latest deploy log https://app.netlify.com/sites/base-ui/deploys/67b7681662253d00088587c3
😎 Deploy Preview https://deploy-preview-1463--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Janpot Janpot changed the title [code-infra] Initial setup for minified error messages (WIP) [code-infra] Setup error message minification Feb 20, 2025
@Janpot Janpot marked this pull request as ready for review February 20, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the code-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant