[code-infra] Allow specifying a custom error formatter module for error minifcation#45291
[code-infra] Allow specifying a custom error formatter module for error minifcation#45291Janpot merged 28 commits intomui:masterfrom
Conversation
Netlify deploy previewhttps://deploy-preview-45291--material-ui.netlify.app/ Bundle size report |
michaldudak
left a comment
There was a problem hiding this comment.
It looks solid. I'm going to test it with Base UI implementation.
|
I'm wondering if we have a way to clean up the extracted codes from stale entries |
|
By "stale entries", do you mean errors that have been in older versions of I think in general the rule should be that the error codes file is mostly append-only. Error messages can only be updated if their semantic meaning is unchanged, and the amount of parameters remains unchanged. Error messages can't be deleted, even if the latest version of |
|
I meant messages that we rephrased or edited typos. I suppose we can still do it manually in both the call site and extracted errors json. |
Yes, at the moment it's a manual process. With the current setup it can't be automatic because when a message is changed in the code, the error extractor doesn't know how to match it up with an existing message. The current method is quite safe though, there isn't much harm if a new error code is create for an existing message. |
This allows us to bring this plugin to other projects and let them use their own formatter. This is necessary to be able to create links to their own docs. Also making this option mandatory
runtimeModuleoption you can specify for the error formatter, Make sure it can resolve import specifiers in package.json.detectionoption to specify whether you want'opt-in'or'opt-out'behavior. Over time we'll move to opt-out behavior for all packages.