react-docgen
react-docgen copied to clipboard
6.0.0
PR #494
- [x] Resolve imported proptypes and types (#464)
- [ ] Add support for enabling import feature in cli
- [x] Migrate to TS 🎉
- [x] Migrate from ast-types to babel toolchain. We use estree AST for historic reasons and it is only used internally and in external resolvers/handlers. So switching to babel (non-estree) AST has several advantages:
- We are not dependent on
ast-typesanymore, which seems barely maintained - We can use all new syntax features in babel out-of-the-box, before estree has decided how to represent the syntax in the AST spec
- Potentially performance improvement, because the estree plugin in the babel parser is additional work, which gets eliminated.
- Big Downside and Breaking Change is that probably all custom handlers/resolvers will need an update.
- Related: #569, #570
- PR: #638
- We are not dependent on
- [x] Include #475 tests now that ast-types is gone.
- [x] Maybe new API for resolvers and handlers which allows checking for correct react-docgen version.
- While working on the babel migration it became clear this has to be done
- Thinking about a new API object being passed to resolvers and handlers with
traverse(),parser(), and more - Also a new FileObject that holds source code and options so we do not need to attach them to the AST.
- in PR: #638
- [ ] Maybe allow multiple resolvers aka ChainResolver. For example should allow to find one exported component (first resolver) OR any @nnotated component (second resolver).
- [ ] Integrate new resolver to find @nnotated components (https://github.com/Jmeyering/react-docgen-annotation-resolver)
- [ ] Implement changes from https://github.com/nerdlabs/react-docgen-displayname-handler
- [x] Migrate from Travis to GH Actions
- [x] Split into two packages
react-docgen&react-docgen-cli, removes unnecessary dependencies if you do not need the cli - [ ] Migrate from commander to yargs or update commander
- [x] Rename
masterbranch tomain - [ ] Create MIGRATE.md
- [ ] Create tests for TODOs in code
- [ ] add react-bootstrap to benchmark
- [ ] try new version in react-styleguidist
Post-Release:
- [ ] New website with playground and also documentation about APIs and configuration as well as examples. Not sure what system to use for this, but I guess there are some good website/docu frameworks, similar to what jest/reactjs/babel is using.
If you want to help feel free to comment. I'm nearly done with the first two tasks, which is the biggest chunk of work here so far.
If there are other ideas for major changes feel free to suggest. Now is the right time.
Thats great!
Hi, it seems that maybe progress against 6.0 might have stalled out? Is there maybe a reduced set of features/changes which could constitute a 6.0 release, so that it can leave the alpha stage and start being used by some projects?
Hi, it seems that maybe progress against 6.0 might have stalled out? Is there maybe a reduced set of features/changes which could constitute a 6.0 release, so that it can leave the alpha stage and start being used by some projects?
Yes the migration to pure babel is harder than expected, most stuff is done, but a lot of features need to be rebuild because babel works differently than ast-types. I will see what I can do.
@danez if you wanted to make a set of issues or list of things to still be done on those conversions I may have time to jump in and work on some as well
A quick update: I tried splitting up the first task but it somehow is all pretty intertwined.
- Switching to
babelfromast-typesbut not yet changing to a non-estree-AST does not work because babel can only handle non-estree-ASTs. - Switching to a non-estree-AST but not yet to babel does not work, because
ast-typesstops working and is not able to build a proper scope tree.
What I figured now is that I can slowly rebuild some features before continuing the migrating to babel. This way most blockers can probably be removed before I can continue the migration. #569 and #570 are the first two PRs that remove builders from ast-types for example.
Version 6.0.0-alpha.4 is out! This was quite a journey. There will be probably one more alpha, before moving into a more non-breaking territory.
Meanwhile the new website is also coming alive here https://react-docgen.dev But almost all important content is still missing. :)
We're having a hard time updating this package in Storybook now that it is ESM only. :( We've had to pin to alpha.3 for now.