A CLI and library to extract information from React component files for documentation generation purposes.
MIT License
Bot releases are visible (Hide)
Published by danez over 4 years ago
forwardRef
(#435)displayName
given forwardRef
node (#436)Published by danez over 4 years ago
empty
type for flow (#431)Published by danez over 4 years ago
Published by danez almost 5 years ago
Published by danez almost 5 years ago
Program
AST node as first param and recast
as second param. The new signature receives the File
AST node as first argument and the preconfigured parser as second argument.resolver(ast: ASTNode, parser: { parse: (string) => AST })
@computed#
.React.forwardRef
(#350).ts
, .tsx
). If you have babel
already setup for TypeScript in your project then all you need to do is supply the filename via the parse options. In the output there will be a new property called tsType
which will include the documentation extracted from TypeScript.parse
function can now receive a string
or a Buffer
.handler(documentation: Documentation, path: NodePath, parser: { parse: (string) => AST })
Published by danez over 5 years ago
The first prerelease of yet another breaking version, but it comes with a lot of nice goodies and three massive changes.
recast
dependency and using babel
directly for parsing the code. In our measurements we saw a 20% to 25% performance increase. If you are testing this new prerelease let us now if you see any improvement in your project.And there are more helpful changes to come till the final. Stay tuned.
This release includes all changes up to v4.1.1.
Program
AST node as first param and recast
as second param. The new signature receives the File
AST node as first argument and the preconfigured parser as second argument.resolver(ast: ASTNode, parser: { parse: (string) => AST })
@computed#
.React.forwardRef
(#350).ts
, .tsx
). If you have babel
already setup for TypeScript in your project then all you need to do is supply the filename via the parse options. In the output there will be a new property called tsType
which will include the documentation extracted from TypeScript.parse
function can now receive a string
or a Buffer
.handler(documentation: Documentation, path: NodePath, parser: { parse: (string) => AST })
Published by danez over 5 years ago
Published by danez over 5 years ago
envName
, babelrc
, root
, rootMode
, configFile
and babelrcRoots
in the programatic API. To see what this options do head over to the babel documentation
Thanks @jquense.
Published by danez over 5 years ago
elementType
in proptypes correctly (#330)Thanks to @eps1lon for fixing it.
Published by danez over 5 years ago
In this version we focused on allowing our internals to be more flexible when it comes to allowing different configurations for @babel/parser
. This will make it easier to introduce support for different javascript flavors (like TypeScript ๐) in the future.
Thanks to @jquense for working on this changes.
--legacy-decorators
and --decorators-before-export
. (#327)legacyDecorators
and decoratorsBeforeExport
. (#327)parserOptions
option you could still set this configuration, for example: react-docgen.parse(code, null, null, {
- decoratorsBeforeExport: true
+ parserOptions: {
+ plugins: [
+ ["decorators", { decoratorsBeforeExport: true }],
+ ],
+ },
});
@babel/parser
we use. This was a necessary step as a lot of recent proposals in babel have configuration options, so we cannot simply activate everything. This change is not breaking unless your babel configuration is broken and does not enable all necessary features (which should throw already in your project).fs
, net
and module
are correctly mocked, as babel uses them. (see our website configuration)fileName
(#320)cwd
(#320)process.cwd()
.@babel/parser
options through the react-docgen
API with the newly added option parserOptions
. See our README for more information.Published by danez over 5 years ago
forwardRef
as a valid component definition (#311)$Keys
to union when typeParameter is an ObjectTypeAnnotation
(#290)PropTypes.exact
Object.values()
in PropType.oneOf()
(#318)babylon@5
to @babel/parser@7
. This should not break anything, but will support a lot more newer javascript syntax features as well as newer flow syntaxes.--legacy-decorators
or the programmatic options { legacyDecorators: true }
passed as 4th parameter to ReactDocgen.parse().Published by danez almost 6 years ago
Published by danez almost 6 years ago
Published by danez over 6 years ago
--legacy-decorators
or the programmatic options { legacyDecorators: true }
passed as 4th parameter to ReactDocgen.parse()
.@extends React.Component
support to mark classes which do not extend from React.Component
as valid react components (#269)Published by danez over 6 years ago
@extends React.Component
support to isReactComponentClass (#269)Published by danez over 6 years ago
Published by danez over 6 years ago
Published by danez almost 7 years ago
(merged changes released in v2.20.0
)
See v2.20.0
.
Update babylon to latest beta. This allows a lot new syntax proposal which were added to babylon (see babylon changes)
Enable more babylon plugins (#220)
Enables the following new plugins in babylon:
You can install this version via npm install react-docgen@next
.
Published by danez almost 7 years ago
Add support for typeof types and React.* types (#224)
Adds support for all the types described in the react flow docs
Resolve flow $Keys<> to union type (#225)
const CONTENTS = {
'apple': '๐',
'banana': '๐',
};
type Props = {
fruit: $Keys<typeof CONTENTS>,
};