Commit Graph

594 Commits

Author SHA1 Message Date
Valentin Shergin b808bfdce2 Fabric: Introducting `ShadowNode.sourceNode`, the node used in copy-constructor
Summary: We will need this later in the diffing alogrithm.

Reviewed By: fkgozali

Differential Revision: D7330337

fbshipit-source-id: 3da44a62e4d5f30deed28b18a5779544153244f3
2018-03-19 17:08:31 -07:00
Valentin Shergin 39383d1189 Fabric: Improved YogaLayoutableShadowNode printing
Summary: `LTR` is actually a default value for `direction` here, because an `inherit` value makes no sense for YGLayout (because it's *computed* value by definition).

Reviewed By: fkgozali

Differential Revision: D7330335

fbshipit-source-id: b3c7736c104689f2296e150f0cf57d622483d537
2018-03-19 17:08:31 -07:00
Valentin Shergin ff288b7416 Fabric: Complete implementation of `layoutMetricsFromYogaNode`
Summary: That was simply incomplete.

Reviewed By: fkgozali

Differential Revision: D7330336

fbshipit-source-id: c495c7f61d8e551fa963bfa6cc0408343eb8439b
2018-03-19 17:08:31 -07:00
Valentin Shergin a5a34565e0 Fabric: Proper return value of `LayoutableShadowNode::setLayoutMetrics()`
Summary: `LayoutableShadowNode::setLayoutMetrics()` must return `false` is nothing was changes.

Reviewed By: fkgozali

Differential Revision: D7330334

fbshipit-source-id: 700d50b0047919fa2b919acfa72825f100cd496f
2018-03-19 17:08:31 -07:00
Valentin Shergin aaaa946e6d Fabric: Equality operators for geometry types
Summary: We will need this soon.

Reviewed By: fkgozali

Differential Revision: D7330338

fbshipit-source-id: 30aeadc182893e86c6a039c74d245f9b56624151
2018-03-19 17:08:31 -07:00
Naris Siamwalla 12535ae69d Fix clang-6 strictness surrounding virtual destructors
Reviewed By: smeenai

Differential Revision: D7326765

fbshipit-source-id: 9df477dfa89812e05e79b5e6d510bcbbc793381c
2018-03-19 15:00:09 -07:00
Kevin Gozali f42b5892a1 iOS C++: Add ICxxExceptionManager to access RCTExceptionsManager native module
Summary: It is sometimes useful to report soft/fatal errors from C++ (native) to the same RCTExceptionsManager that is already handling JS exceptions. `ICxxExceptionManager` is an approach to provide such access, which impl provided for ObjC++.

Reviewed By: shergin

Differential Revision: D7224944

fbshipit-source-id: 8c607226b67851d46f4c787f5b6e6c8cb6a1afea
2018-03-19 00:06:57 -07:00
Valentin Shergin 378da73201 DebugStringConvertibleOptions: Formating
Summary:
DebugStringConvertibleOptions allows pretty-format debug strings.
https://pxl.cl/ch0m

Reviewed By: fkgozali

Differential Revision: D7312622

fbshipit-source-id: 0ed62520bbc521790bedf5a6d18c796b42f85658
2018-03-18 19:17:39 -07:00
Valentin Shergin 4cda0df2e5 Switching to the new FabricUIManager and all new shadow tree infra
Reviewed By: fkgozali

Differential Revision: D7230670

fbshipit-source-id: bca7d2859b87931c0d15406782b7d689de1d8c36
2018-03-18 19:17:39 -07:00
Valentin Shergin c2ad59a277 `fabric/uimanager` module
Summary: `fabric/uimanager` implements FabricUIModule.

Reviewed By: fkgozali

Differential Revision: D7230669

fbshipit-source-id: db6228021352598feac7854b5871d9d6c5c85119
2018-03-18 19:17:39 -07:00
Valentin Shergin 965e60b05a `fabric/view` module
Summary: Defines `<View>`: Yoga-powered, Accessible and styleable component.

Reviewed By: fkgozali

Differential Revision: D7230673

fbshipit-source-id: 08a1d8626c0b41260fafdca938d4fe9489b1b793
2018-03-18 19:17:39 -07:00
Valentin Shergin 6b0960cbdb Introducing `ConcreteShadowNode`
Summary: ConcreteShadowNode defines a template which connects typed Props and typed ShadowNode.

Reviewed By: fkgozali

Differential Revision: D7230667

fbshipit-source-id: be28314d6846d69960e921da852f01232951f965
2018-03-18 19:17:39 -07:00
Valentin Shergin 811d5bfc73 Introducing LayoutableShadowNode
Summary: LayoutableShadowNode defines a unified interface (and set of primitives) essential for laying out shadow nodes.

Reviewed By: fkgozali

Differential Revision: D7230668

fbshipit-source-id: d8c1772d4c3bd1f87c41f7240a39aecebf3696ae
2018-03-18 19:17:39 -07:00
Valentin Shergin 840638c441 Introducing `ComponentDescriptor`
Summary:
Abstract class and default template implementation.
`ComponentDescriptor`s define basic logic of managing (creation, cloning, applying props) ShadowNode of particular type.

Reviewed By: fkgozali

Differential Revision: D7230671

fbshipit-source-id: c32636f4db0716b55a1637f61c4f1872fc52cea7
2018-03-18 19:17:39 -07:00
Valentin Shergin 608d1fb590 `fabric/graphics` module: all about graphics
Summary: `fabric/graphics` provides graphics primitives; the implementation should be platform-specific eventually.

Reviewed By: fkgozali

Differential Revision: D7230675

fbshipit-source-id: ff05d2673072fad5ee6f331f0155561969e1a8b6
2018-03-18 19:17:39 -07:00
Valentin Shergin c623455845 Abstract classes for ShadowNode and Props
Summary: Foundation clases for Fabric designed to be "const-first".

Reviewed By: fkgozali

Differential Revision: D7230672

fbshipit-source-id: 433acd35a7958d5d577358b0a306923f970e573f
2018-03-18 19:17:39 -07:00
Valentin Shergin d16772a31e Sealable: fixed semantic; atomic type for the flag variable
Summary:
* Fixed semantic: all kinds of derivative instances lose `sealed` flag (which is expected);
 * Using atomic<bool> for `sealed_` ivar.

Reviewed By: fkgozali

Differential Revision: D7230674

fbshipit-source-id: abe786610c20a45a0fabb9068120e24adeeeac7f
2018-03-18 19:17:39 -07:00
Pritesh Nandgaonkar 9102ff94e7 Moved YGFloatOptional from C struct to C++ struct
Reviewed By: emilsjolander

Differential Revision: D7288555

fbshipit-source-id: f61cc92c8fd0d48d2fc1f4d0e6fcef155f19ff8a
2018-03-15 12:41:16 -07:00
Pritesh Nandgaonkar ce92b8592b Fixed a typo and added a test case
Reviewed By: emilsjolander

Differential Revision: D7289221

fbshipit-source-id: 48ee9ccfac4adee51d515a366b5a11790f7236fc
2018-03-15 12:41:16 -07:00
Dmitry Zakharov 8e85bf84e8 Gatekeeper for Native Extensions
Reviewed By: danzimm, johnislarry

Differential Revision: D6965463

fbshipit-source-id: 28bcfbff980abfda3c63d7016ccf05beb1d178eb
2018-03-15 09:27:40 -07:00
Dmitry Zakharov c989ea8728 Extract NativeExtensionsProvider definition
Reviewed By: danzimm

Differential Revision: D6964355

fbshipit-source-id: e20dfa99bd9d8784a5f31a313302104d6dc33652
2018-03-15 09:27:40 -07:00
Pritesh Nandgaonkar da2d410122 Fix getters and setters if min and max Dimension
Reviewed By: emilsjolander

Differential Revision: D7274807

fbshipit-source-id: 7c1a4c19e8d0552b089a410c3330392cb26a6a47
2018-03-15 07:23:13 -07:00
Pritesh Nandgaonkar 040642dba3 Fix setter and getter of margin, position, border and padding
Reviewed By: emilsjolander

Differential Revision: D7274115

fbshipit-source-id: 942a91e6562ef789ae79102a828f397889468fa7
2018-03-15 07:23:13 -07:00
Pritesh Nandgaonkar 321b107685 Expose layout diffing flag to java
Reviewed By: emilsjolander

Differential Revision: D7272067

fbshipit-source-id: e67e82eb057e4c7124904c715f9dca4dcfea21ea
2018-03-14 08:48:52 -07:00
Pritesh Nandgaonkar f3ef8f8510 Remove the use of YGUndefined for flex-basis
Reviewed By: emilsjolander

Differential Revision: D7243924

fbshipit-source-id: 2bfaca1a5e3da40d5292a273cabf705f59c9d666
2018-03-14 04:34:04 -07:00
Pritesh Nandgaonkar e3af1508c8 Change the type of flexShrink to YGFloatOptional
Reviewed By: emilsjolander

Differential Revision: D7232171

fbshipit-source-id: 3111119d3d74a7035c01132bff61b30cf44e120a
2018-03-14 04:34:04 -07:00
Pritesh Nandgaonkar 3274e9fa51 Change the type of flexGrow to YGFloatOptional
Reviewed By: emilsjolander

Differential Revision: D7215355

fbshipit-source-id: 1298ee332551d44e4d070169a1e4103d005c4f43
2018-03-14 04:34:04 -07:00
Pritesh Nandgaonkar 5b3d59598a Change the type of flex to YGFloatOptional
Reviewed By: emilsjolander

Differential Revision: D7211327

fbshipit-source-id: 0d979b6ba00317317b98bbc6e63979c7f1feb2da
2018-03-14 04:34:04 -07:00
Pritesh Nandgaonkar 9f7e70363a Changed the return type of YGResolveValue
Reviewed By: emilsjolander

Differential Revision: D7195099

fbshipit-source-id: 72c4163cd08691cf6e40df05394cc52e83b0de14
2018-03-14 04:34:03 -07:00
Pritesh Nandgaonkar af4a36337d Remove the usage of YGUndefined in the default values of Border in YGStyle
Reviewed By: emilsjolander

Differential Revision: D7195115

fbshipit-source-id: e635cf55ac94d8a90caef6cafce281579da2cbfc
2018-03-14 04:34:02 -07:00
Amir Livneh 19dd9a2ce6 Use -fdata-sections in mode/opt
Differential Revision: D7194366

fbshipit-source-id: 676f2db2e493230b8d9698941f003ec4e96f15ea
2018-03-12 06:34:59 -07:00
Kevin Gozali 3c86701ea7 `fabric/core` module and `Sealable` class
Summary:
`Sealable` class represents something which can be *sealed* (imperatively marked as immutable).

Authored by shergin

Reviewed By: shergin

Differential Revision: D7174883

fbshipit-source-id: 8b26ca5b1a5154953a099895778eab86228acc46
2018-03-08 18:04:28 -08:00
Kevin Gozali 34f8e7f848 `fabric/debug` module and `DebugStringConvertible` class
Summary:
This is a very first diff in a series of undefined length implementing React Native Shadow Tree infra in C++.
All Shadow Nodes, Props and etc. implements `DebugStringConvertible`.

Authored by shergin

Reviewed By: shergin

Differential Revision: D7163868

fbshipit-source-id: 9c001aa5bd0723f709a07b1833f512c51e3bec11
2018-03-08 18:04:28 -08:00
Jakub Grzmiel 5f497ca302 Convert constant with build flags to function
Reviewed By: ttsugriy

Differential Revision: D7184372

fbshipit-source-id: c66f473ad15898532f24c6276898ab250e749744
2018-03-08 00:17:53 -08:00
Kevin Gozali 7bf3b20837 iOS: create C++ <-> ObjC++ connector for FabricUIManager to do UI operations
Reviewed By: shergin

Differential Revision: D7162911

fbshipit-source-id: 3e303020dafdccc51f52c3359a7054dc8a787978
2018-03-07 16:54:16 -08:00
Dan Zimmerman 19a4a7d3cb Remove callFunctionSync experimental APIs
Reviewed By: michalgr

Differential Revision: D6124038

fbshipit-source-id: 219afe30783da92cf10f800dc35e64823b61cf4b
2018-03-05 14:32:00 -08:00
Jonathan Kim f389ad8b76 Move fb_xplat_cxx.bzl to xplat/build_defs
Reviewed By: mzlee, ttsugriy

Differential Revision: D7152463

fbshipit-source-id: ad7ca85f225343a043e2f606c6b3bbf74f42bbcd
2018-03-05 10:55:50 -08:00
Héctor Ramos b181b7797f Check PATENTS does not creep into files
Summary:
Some files have crept into the repo with the old license header. These are usually from PRs that were opened prior to the re-licensing of the project.

Let the script run, prior to fixing the errant files. The script outputs the following:

```
PATENTS crept into some new files?
 --- /dev/fd/63	2018-03-01 01:42:48.250153746 +0000
+++ /dev/fd/62	2018-03-01 01:42:48.250153746 +0000
@@ -1 +1,9 @@
+Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h
+Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.m
+ReactAndroid/src/main/java/com/facebook/react/animated/TrackingAnimatedNode.java
+ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLetterSpacingSpan.java
+ReactCommon/yoga/yoga/YGLayout.cpp
+ReactCommon/yoga/yoga/YGLayout.h
+ReactCommon/yoga/yoga/YGStyle.cpp
+ReactCommon/yoga/yoga/YGStyle.h
 scripts/circleci/check_license.sh
Exited with code 1
```

Fix the headers in these files and run the script again. No output, exit code 0.
Closes https://github.com/facebook/react-native/pull/18143

Reviewed By: sophiebits

Differential Revision: D7119356

Pulled By: hramos

fbshipit-source-id: d238e4d4a3ae320a2c8e625c2fa29690057a4814
2018-03-01 08:22:05 -08:00
Pritesh Nandgaonkar d174ab8a7a Change NaN with large number
Reviewed By: emilsjolander

Differential Revision: D6969537

fbshipit-source-id: bdc09eaf703e0d313ca65c25a4fb44c99203d9bf
2018-03-01 04:02:01 -08:00
Shoaib Meenai 0bc80e9a72 Use #include instead of #import
Reviewed By: compnerd

Differential Revision: D7114385

fbshipit-source-id: a443770910714aab1af3f3ac5e932f6aaf1afe99
2018-02-28 15:41:43 -08:00
Kevin Gozali 52acbbdd62 iOS: adjusted JSI binding for C++ FabricUIManager
Reviewed By: sebmarkbage, shergin

Differential Revision: D7078631

fbshipit-source-id: 6df21e52d3941372a9845fdcf2aed777de7cb359
2018-02-27 08:42:14 -08:00
Sebastian Markbage 84ad5d3d3c Explicitly handle null props in bindings
Reviewed By: fkgozali, mdvacca

Differential Revision: D7080813

fbshipit-source-id: 7c9706df719a39e11a3d99c2de38af992b62dabf
2018-02-26 19:46:51 -08:00
Kevin Gozali 0ee03178a0 added C++ setup for FabricUIManager
Reviewed By: shergin

Differential Revision: D7077312

fbshipit-source-id: e284c151438eb4d1f67a8386580ab54e3dce7c17
2018-02-23 19:49:03 -08:00
Pritesh Nandgaonkar 22cf81571b Added default constructor for YGCachedMeasurement
Reviewed By: emilsjolander

Differential Revision: D7020337

fbshipit-source-id: e084e234bf6a2ae22e53e739959683abca169b88
2018-02-20 05:55:36 -08:00
Pritesh Nandgaonkar c75ce8146f Add constructor in YGLayout
Reviewed By: emilsjolander

Differential Revision: D7019653

fbshipit-source-id: 5a2655626db0915fcebe7d4517e2d0b2e2484460
2018-02-20 05:55:36 -08:00
Pritesh Nandgaonkar b9991d33e3 Move YGStyle to seperate file and add constructors
Reviewed By: emilsjolander

Differential Revision: D7016575

fbshipit-source-id: eb28df0ffb4cc813b23edaff80d7d4ebc56ce6af
2018-02-20 05:55:36 -08:00
Sophie Alpert 26684cf3ad Update to MIT license
Summary: Manual changes.

Reviewed By: TheSavior, yungsters

Differential Revision: D7012152

fbshipit-source-id: de7459be3db13c687868b45059856f125c4f2eb1
2018-02-16 18:31:53 -08:00
Sophie Alpert 1490ab12ef Update license headers for MIT license
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.

find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.

Reviewed By: TheSavior, yungsters

Differential Revision: D7007050

fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
2018-02-16 18:31:53 -08:00
Yuichi ONO f751c3460e Fix main size calculation from the aspect ratio
Summary:
When the following conditions are met, the main size become smaller by the margins in the main axis.
* The aspect ratio is defined
* The main size is not defined
* The cross size is defined
* The main margin is defined

This is because the main margin size is not included when calculating the main size from the aspect ratio.
Closes https://github.com/facebook/yoga/pull/715

Reviewed By: emilsjolander

Differential Revision: D6998988

Pulled By: priteshrnandgaonkar

fbshipit-source-id: f6f69c47ece17bd7c5e41517b96032bf0c149356
2018-02-15 07:26:52 -08:00
Paco Estevez Garcia ad2d9e7fab Forward VM version to inspector
Reviewed By: bnham

Differential Revision: D6938018

fbshipit-source-id: c79853ddf835acab86a16ebd539874d29d3aa60a
2018-02-13 08:16:50 -08:00