-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This diff follows the same approach as D4418734 and in fact subsumes that diff. Instead of processing React.createClass calls by inspecting the AST, this diff adds a custom fun and ReactKit use type which resolves the interesting bits of the spec one-by-one, finally resolving to a class type. The AST traversal approach has obvious deficiencies -- we restrict ourselves to a very limited subset of valid code. Another significant benefit of this approach is that we can be precise about mixins. When processing a spec, if we see a mixins object, we resolve those in turn (recursively, as mixins can have mixins), actually mix them in, then emit the class type. The overall approach here collects all the resolved types into a large data structure, where bits may be known or unknown (due to `any`, or type errors), then flattens the mixins into a single spec, then creates the class. Reviewed By: avikchaudhuri Differential Revision: D4438645 fbshipit-source-id: 67f7f3dc3349a76f7ffc85a106552345a697c2b6
- Loading branch information
1 parent
1997ce8
commit 12741b0
Showing
22 changed files
with
1,112 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.