Commit Graph

10 Commits

Author SHA1 Message Date
Kevin Lacker 857bae4ea3 Replace the deprecated esprima-fb parser with flow-parser, on the RN website
Summary:
(I changed a ton from when I previously submitted this PR so please take another look if you already did.)

PROBLEM: the no-longer-maintained `esprima-fb` parser does not support class properties, leading our website docgen to die if we use class properties, which we're gonna do real soon now
SOLUTION: use `flow-parser` instead, which the flow team is maintaining including all the fancy-pants ES? stuff that FB uses internally.

This removes the `esprima-fb` parser from jsdocs and replaces it with `flow-parser`. It's almost the same, I checked by diffing all the parser json output and it only had a few irrelevant differences. I had to add a file of constants so that we could remove esprima-fb altogether, too.

This also adds a couple unit tests, so that we can test that jsDocs works programmatically. They don't run if you run the regular RN tests, you have to run `npm test` from the `/website/` subdirectory.
Closes https://github.com/facebook/react-native/pull/9890

Differential Revision: D3865629

Pulled By: bestander

fbshipit-source-id: 8f561b78ca4a02f3f7b45e55904ec2fa911e3bb6
2016-09-14 14:28:44 -07:00
Spencer Ahrens dfdef9a02a [autodocs] add doc blocks to more things 2015-09-03 11:53:20 -07:00
Spencer Ahrens 126928b0b4 [Docs] Expand API parsing and rendering
The `Animated` module exposes a lot of functionality, including internal
classes. This diff extracts properties and classes from modules and renders them
recursively.

This also adds `Animated` to the autogen docs now that they more capable,
although it needs way more docblocks and such which will come later.
2015-09-01 14:14:47 -07:00
hansonw 97aad167a6 Fix jsdocs for multi-line ES6-style methods
Summary:
The function definition and body can be in different places for multi-line declarations, so the docblock might not get pulled in. None of the existing docs seem to be affected, but putting up the fix for posterity.

Test Plan:
I modified `AlertIOS.alert` (in Libraries/Utilties/AlertIOS.js) to actually have a docblock, and ran `website/publish.sh` (with the push bit commented out). The added doc doesn't get picked up with the current code, but it does with the fix.
2015-05-14 16:34:55 -07:00
Brent Vatne 120c32c52c [Docs] Don't show copyright/flow on APIs without docblock 2015-05-10 10:17:21 -07:00
Steve Lacy 5a4e780ac3 Lint code - change double quotes to single in website/jsdocs. Add/remove semicolons to keep code style 2015-03-26 11:14:54 -07:00
Christopher Chedeau e811181034 Add copyright header on website files 2015-03-23 10:56:09 -07:00
Christopher Chedeau 9f37aea739 Support flow and @param type hints 2015-03-12 11:36:45 -07:00
Christopher Chedeau 33bfb322ad Wire up jsdocs for apis 2015-03-12 11:04:06 -07:00
Christopher Chedeau 83581cfe6b Initial import of the lib to parse javascript code, in the same vein as we parse React proptypes 2015-03-10 13:56:32 -07:00