|
1 | 1 | # Changelog
|
2 | 2 |
|
| 3 | +## 6.0.0-alpha.4 |
| 4 | + |
| 5 | +### Major Changes |
| 6 | + |
| 7 | +- 96d6e9e: Rename `flowTypeHandler` to `codeTypeHandler` because it handles Flow and TypeScript |
| 8 | +- 96d6e9e: Simplify `resolveObjectValuesToArray` and remove type handling. None of the code that was handling types was actually used. |
| 9 | +- caae6bf: The return values of `resolveObjectValuesToArray` are now in the order they are defined in the source code. |
| 10 | +- 96d6e9e: Migrate react-docgen to ES modules. Please read [this](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) |
| 11 | +- 3b28f6e: The CLI was removed from `react-docgen` into its own package `@react-docgen/cli`. |
| 12 | + |
| 13 | + Check out https://react-docgen.dev/cli for the documentation. |
| 14 | + |
| 15 | +- 96d6e9e: Main `parse` API was changed |
| 16 | + |
| 17 | + The main API changed and now includes only 2 arguments. |
| 18 | + |
| 19 | + ```diff |
| 20 | + -parse(src, resolver, handlers, importer, options) |
| 21 | + +parse(src, { resolver, handlers, importer, ... }) |
| 22 | + ``` |
| 23 | + |
| 24 | +- 96d6e9e: Renamed some of the main exports for clarity. |
| 25 | + |
| 26 | + Renamed `handlers` to `builtinHandlers` |
| 27 | + Renamed `resolver` to `builtinResolvers` |
| 28 | + Renamed `importers` to `builtinImporters` |
| 29 | + |
| 30 | +- 96d6e9e: Migrated to babel toolchain |
| 31 | + |
| 32 | + This is one of the big changes in this new version of react-docgen. It made the code a lot more robust |
| 33 | + because there are now finally working TypeScript types for the ASTs. |
| 34 | + |
| 35 | + Another benefit from this change that react-docgen is now a lot faster. 🚀 In some |
| 36 | + tests an improvement of nearly 50% was seen in comparison to version 5. |
| 37 | + |
| 38 | +- d4c27d4: Improve performance of file system importer. |
| 39 | + |
| 40 | + The file system importer now also caches resolving of files in addition to parsing files. |
| 41 | + If the importer is used in an environment where files do change at runtime (like a watch |
| 42 | + command) then the caches will need to be cleared on every file change. |
| 43 | + |
| 44 | +- 96d6e9e: Changed the minimum Node.js version to 14.17.0 |
| 45 | + |
| 46 | +### Minor Changes |
| 47 | + |
| 48 | +- 96d6e9e: Add support for `.cts` and `.mts` extension when using typescript |
| 49 | +- 96d6e9e: Treat functions returning `React.Children.map` as components |
| 50 | +- 96d6e9e: Improve performance by creating all visitors only once |
| 51 | +- 96d6e9e: Support all possible kinds of functions in the `displayNameHandler` |
| 52 | +- 96d6e9e: Support all literal types in typescript |
| 53 | +- 96d6e9e: Support flow qualified type names |
| 54 | +- 96d6e9e: Support class and function declarations without identifier |
| 55 | +- 96d6e9e: Support resolving of destructurings in `resolveToValue` |
| 56 | +- 96d6e9e: Improve performance drastically by making changes to AST traversal |
| 57 | + |
| 58 | + Visitors are now pre-exploded and are cached in the module scope instead of creating them on every call. |
| 59 | + This change brought the benchmark from 170ops/s to 225ops/sec |
| 60 | + |
| 61 | +- 96d6e9e: Add codes to errors to be able to easily detect them |
| 62 | + |
| 63 | + There is a new export `ERROR_CODES` that contains all possible error codes. |
| 64 | + The two errors that have codes right now are: |
| 65 | + |
| 66 | + - `MISSING_DEFINITION`: No component found in file |
| 67 | + - `MULTIPLE_DEFINITIONS`: Multiple components found in one files |
| 68 | + |
| 69 | +- 96d6e9e: Support handling `useImperativeHandle` correctly |
| 70 | + |
| 71 | +### Patch Changes |
| 72 | + |
| 73 | +- 96d6e9e: Handle `React.forwardRef` calls without a function |
| 74 | +- 96d6e9e: Handle some edge cases in resolveToValue |
| 75 | +- 96d6e9e: Remove trailing commas and semicolons from raw values in the documentation |
| 76 | +- 96d6e9e: Parse jsdoc comments for TypeScript structs |
| 77 | +- 96d6e9e: Correctly handle ObjectProperties in `isReactComponentMethod` |
| 78 | +- 96d6e9e: Add support for TSAsExpressions when trying to stringify expressions |
| 79 | + |
3 | 80 | ## [6.0.0-alpha.3](https://github.com/reactjs/react-docgen/compare/v6.0.0-alpha.2...v6.0.0-alpha.3) (2022-06-13)
|
4 | 81 |
|
5 | 82 | ### Bug Fixes
|
|
0 commit comments