Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove PooledClass from isomorphic build #10227

Merged
merged 6 commits into from
Jul 20, 2017
Merged

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Jul 20, 2017

This inlines traverseAllChildren logic into ReactChildren since it’s now the only consumer. Then I change forEach and map to use the same bookkeeping fields. This lets me unroll the PooledClass abstraction into a single specific implementation, and thus remove it from the isomorphic build.

See individual commits.

"size": 27099,
"gzip": 7215
"size": 24229,
"gzip": 6612
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoa. why is FB_PROD so much larger than NODE_PROD/UMD_PROD? Legacy files that are being consumed internally yet?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's just not minified. We might minify it eventually but for now it doesn't seem necessary (it goes through our pipeline anyway), and it's easier to see what happens during the sync.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Great point. 👍

Copy link
Contributor

@aweary aweary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -164,7 +353,7 @@ function mapChildren(children, func, context) {
return result;
}

function forEachSingleChildDummy(traverseContext, child, name) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're already importing the emptyFunction library in ReactChildren, could use just use emptyFunction.thatReturnsNull and get rid of this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

@gaearon gaearon merged commit 240b84e into facebook:master Jul 20, 2017
@gaearon gaearon deleted the inline-pool branch July 21, 2017 11:37
* @param {string} key to be escaped.
* @return {string} the escaped key.
*/
function escape(key: string): string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,
Why you added types in flow style if this file have't flow comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably accidentally or by copy paste. Want to send a PR to Flow-ify it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep! I can delete useless flow typechecking or add comment flow. If I add flow comment maybe I can try to update types for all file? If you want this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@gaearon gaearon mentioned this pull request Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants