BREAKING [react_native/css_layout] Update RN shadow nodes to hold CSSNode instead of extending CSSNode

Summary:
This diff makes it so ReactShadowNode holds a CSSNode instead of extending one. This will enable us to pool and re-use CSSNodes and will allow us to keep from breaking the CSSNode api assumption that nodes that have measure functions don't have children (right now, text nodes have measure functions, but they also have raw text children).

BREAKING
This diff makes ReactShadowNode no longer extend CSSNodeDEPRECATED. If you have code that depended on that, e.g. via instanceof checks, that will no longer work as expected. Subclasses that override getChildAt/addChildAt/etc will need to update your method signatures. There should be no runtime behavior changes.

Reviewed By: emilsjolander

Differential Revision: D4153818

fbshipit-source-id: 2836434dd925d8e4651b9bb94b602c235e1e7665
This commit is contained in:
Andy Street
2016-11-14 04:34:57 -08:00
committed by Facebook Github Bot
parent 307871e854
commit 0df65bb7d4
5 changed files with 305 additions and 122 deletions

View File

@@ -86,7 +86,7 @@ public class UIImplementation {
ReactShadowNode rootCSSNode = new ReactShadowNode();
I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
if (sharedI18nUtilInstance.isRTL(mReactContext)) {
rootCSSNode.setDirection(CSSDirection.RTL);
rootCSSNode.setLayoutDirection(CSSDirection.RTL);
}
rootCSSNode.setViewClassName("Root");
return rootCSSNode;