Add error code extract and transform#138
Conversation
|
testing this out..
|
swyxio
left a comment
There was a problem hiding this comment.
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.jsonin the root of tsdx directory on the first run, anything that uses a function call ofinvariantwill be extracted../errors/ErrorDev.jsand./errors/ErrorProd.js. Once generated, user can freely edit them. To regenerate, just delete and run a build or watch.buildcalled--extractErrors