-
Notifications
You must be signed in to change notification settings - Fork 507
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
Add error code extract and transform #138
Conversation
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.
Looks cool!
testing this out..
|
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.
accidentally approved, should have requested changes. anyway im fixing this
We need to generate the files and roll it up so it either needs to be a separate runtime package or we need to inject it So it can be a relative import. The reason we need to generate it is so we can say “Minified Blank” error and have a custom url. Putting it in a dot folder could cause confusion. One possibility is for use to make an errors directory outside of src where this all lives. |
i dont feel strongly enough about it to do anything tbh :) anyway i think this is good to go. can work on more docs in a separate issue. |
Slept on it. I think we should move everything to an errors directory |
i still want this i think. any blockers in your mind? i can resolve merge conflicts later |
I just not sure it should be the default? Then again, it only does magical stuff if you use invariant() so idk. Maybe we just document the crap out of it |
i think it is already opt in tho? you made that change. needs people to actively run the errorExtraction flag. and maybe add a bit more logging so people dont get surprised there is a new file. |
Lol I totally forgot. I've been crazy busy working on Formik 2 + the thing that's not out yet. Yeah let's merge this lil guy |
@sw-yx made some changes. I think this is g2g |
Formik World |
Closes #78
./errors/codes.json
in the root of tsdx directory on the first run, anything that uses a function call ofinvariant
will be extracted../errors/ErrorDev.js
and./errors/ErrorProd.js
. Once generated, user can freely edit them. To regenerate, just delete and run a build or watch.build
called--extractErrors