Open jquense opened 5 years ago
Do you have an example?
We currently supply the parse method to handlers, resolvers as the last argument. Adding the whole ast-types package there would be a little bit risky and every update for ast-types would be potentially breaking also for react-docgen then.
I'm not sure i have a quick reproducible example but i've seen it consistently in gatsby and our our own usages. Effectively any handler that uses a different version of ast-types
than react-docgen
runs the risk of hitting an indiscernable error. We saw this with ast-types
0.13. I upgraded in gatsby and then react-docgen
was using it's own 0.12 version and you'd get a stack overflow in recast trying to loop through a cyclical node.
It doesn't seem possible for third party resolvers or handlers, use different versions of ast-types with react-docgen since it's all operating on the same ast. If someone uses the latest
0.13.0
with react-docgen it breaks, presumable b/c of a change in how visit or parsing works between0.12.x
and0.13.0
.To address we should probably make
ast-types
a peer dep or rexport ast-types for consuming third party resolvers/handlers