-
-
Notifications
You must be signed in to change notification settings - Fork 123
[code-infra] Setup error message minification #1463
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
It looks good, aside from a typo I found.
@atomiks, do you see anything missing from this implementation?
In the future, we could create an error throw helper function to ensure consistency in our messages.
I'm wondering how big the bundle size savings will be and if the minification is really worth the hassle.
docs/src/app/(public)/(content)/production-error/[code]/ErrorDisplay.tsx
Outdated
Show resolved
Hide resolved
…isplay.tsx Co-authored-by: Michał Dudak <[email protected]> Signed-off-by: Jan Potoms <[email protected]>
docs/src/app/(public)/(content)/production-error/[code]/PageContent.mdx
Outdated
Show resolved
Hide resolved
Ideally we'd have the bundle size checker in base repo. I can fix that up and port next? We could also postpone merging this PR until then if you want, |
Co-authored-by: atomiks <[email protected]> Signed-off-by: Jan Potoms <[email protected]>
…ntent.mdx Co-authored-by: atomiks <[email protected]> Signed-off-by: Jan Potoms <[email protected]>
I checked it manually and it turns out that this PR (with the lastest master merged in) produces a larger package than what's on master. I ran This PR: master: I expect it to look different when we add more components and have more error messages, but for now there seems to be no point in making this change (unless my methodology is wrong). We can also have additional gains in the minifier-less implementation by creating the error helper I mentioned in #1463 (review) |
The installed size will indeed be larger as it contains a new function and the error codes alongside the dev messages. But that's not what ends up in user's applications. You need to bundle the package with |
Putting this on hold until we've ported the bundle size checker and can assess the impact. |
Port core error minification infrastructure:
<FormattedErrorMessage />
inside of the mdx to render the formatted error message