BREAKING [react_native] Don't create CSSNodes for virtual shadow nodes

Summary:
Virtual shadow nodes (e.g. text) don't use CSSNodes so we don't need to create them. This shows large savings in CSSNodes allocated, depending on the app.

This could be breaking if:
- You have virtual nodes that still set and get CSS properties. The setters now no-op for virtual nodes (I unfortunately couldn't remove them completely -- see the comment on LayoutShadowNode), but the getters will NPE. If you see these NPE's, you should almost definitely be using your own datastructure instead of a CSSNode as virtual nodes will not participate in the layout process (and the CSSNode is then behaving just as a POJO for you).

I do not anticipate this to be breaking for anyone, but am including breaking in the commit message since this is a change in API contract.

Reviewed By: emilsjolander

Differential Revision: D4220204

fbshipit-source-id: b8dc083fff420eb94180f669dd49389136111ecb
This commit is contained in:
Andy Street
2016-11-23 05:12:55 -08:00
committed by Facebook Github Bot
parent eaccd7e82e
commit 68c6d71cea
8 changed files with 139 additions and 36 deletions

View File

@@ -41,7 +41,6 @@ public class ReactTextInputShadowNode extends ReactTextShadowNode implements
private int mJsEventCount = UNSET;
public ReactTextInputShadowNode() {
super(false);
setMeasureFunction(this);
}