Commit Graph

557 Commits

Author SHA1 Message Date
Pritesh Nandgaonkar fcf2c7cf61 Refactored step3 of flexbox algorithm
Reviewed By: emilsjolander

Differential Revision: D6702749

fbshipit-source-id: 15dcc94ae30ac185e4d1c7d6e3744a40cfa47317
2018-01-15 10:17:28 -08:00
Pritesh Nandgaonkar ac1c8c265e Refactored the flexbox step to determine available space in main and cross dim
Reviewed By: emilsjolander

Differential Revision: D6693777

fbshipit-source-id: d6c87670e74bdc22b32916c2d77fe423d831b378
2018-01-15 06:05:24 -08:00
Semen Zhydenko d2c569795c Typos in comments and log messages
Summary:
No code changes, no testing required.

alligned -> aligned
allignment -> alignment
completly -> completely
conseptually -> conceptually
decendents -> descendants
indefinetly -> indefinitely
dimention -> dimension
doesnt -> doesn't
safegaurd -> safeguard
intialization -> initialization
hierachy -> hierarchy
happend -> happened
gaurd -> guard
programatically -> programmatically
initalized -> initialized
immidiately -> immediately
occured -> occurred
unkown -> unknown
neccessary -> necessary
neccesarily -> necessarily
occuring -> occurring
comoponent -> component
propogate -> propagate
recieved -> received
referece -> reference
perfomance -> performance
recieving -> receiving
subsquently -> subsequently
scoll -> scroll
suprisingly -> surprisingly
targetting -> targeting
tranform -> transform
symetrical -> symmetrical
wtih -> with
Closes https://github.com/facebook/react-native/pull/17578

Differential Revision: D6718791

Pulled By: shergin

fbshipit-source-id: 4ab79c1131ec5971d35a0c7199eba7ec0a0918ad
2018-01-12 22:18:45 -08:00
Sergei Dryganets c8e98bbaf5 CI for Android fixed
Summary:
Fix for android github CI.

Github CI doesn't work without this change.

CI passes.

[INTERNAL] Android CI fix.
Closes https://github.com/facebook/react-native/pull/17551

Differential Revision: D6707477

Pulled By: hramos

fbshipit-source-id: f98515234da3b90ee3233523bcd7cc67ed82c1b4
2018-01-12 08:01:00 -08:00
Alex Dvornikov 8f358a2088 Report module id as string and as double, in case of invalid values are passed to nativeRequire
Differential Revision: D6695769

fbshipit-source-id: b578b9d52ed711fb5a3e51717ac555fa8a232d7a
2018-01-11 14:21:00 -08:00
Michał Gregorczyk 702b7e877e (almost) kill fbjsc
Reviewed By: johnislarry

Differential Revision: D6701327

fbshipit-source-id: 17630f336e2b275c1de30ebfa32d1cbfbc1b9634
2018-01-11 13:16:37 -08:00
Pritesh Nandgaonkar 4b4959a21c Moved setPosition as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6683387

fbshipit-source-id: 83f64101faa700933771c69b222056ec2a6b8d1e
2018-01-11 05:13:56 -08:00
Pritesh Nandgaonkar 89c14579d0 Moved trailingmargin function as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6683313

fbshipit-source-id: 5ee458c2f4698768724901df0e3f5d8805c7c8f5
2018-01-11 05:13:51 -08:00
Pritesh Nandgaonkar f0f4bee429 Moved getLeadingMargin as a function on YGNode
Reviewed By: emilsjolander

Differential Revision: D6683270

fbshipit-source-id: a26663006419e13cb783e9849183e3c665f59b3c
2018-01-11 05:13:47 -08:00
Pritesh Nandgaonkar b709ff4f13 Moved getTrailingPosition function as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6683205

fbshipit-source-id: d30003d90d634c644d92c833e58165b073d4d13e
2018-01-11 05:13:45 -08:00
Pritesh Nandgaonkar 040197a485 Moved is isTrailingPos defined as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6683190

fbshipit-source-id: c37e57d02cc4475eb8181a2bb003c555bdb0aaea
2018-01-11 05:13:43 -08:00
Pritesh Nandgaonkar 98a74b0a2b Moved isLeadingPos defined as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6682956

fbshipit-source-id: 31c60e0eae906e1434a6969f3cd786fcaf9097a5
2018-01-11 05:13:39 -08:00
Pritesh Nandgaonkar 00f1a37b2c Moved YGNodeLeading position as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6682929

fbshipit-source-id: 3607aab1544b62b1126c5d75b2f6fb8f5ca2d45f
2018-01-11 05:13:33 -08:00
Valentin Shergin c2b0f34533 Introducing on-dirty handler (aka `YGNodeSetDirtiedFunc`)
Summary:
Currently, we can dirty leaf nodes with `measure` function, we also can get `dirty` status for any node, but we cannot handle a moment when this change happen. This diff introduces a new call-back-manner handler for it.
We need this to plug Yoga inside and outside other layout systems without maintaining own dirty propagation infrastructure.
Consider using Yoga for flex-box layout in React Native where we can have deeply nested layout like `<View><Text><View><Text/></View></Text></View>` where all content of all <Text> nodes are laid out using native text/inline (not flex-box!) layout system. In this case, when some change dirties some deeply nested Yoga node, we have to propagate the dirty state down to outer one. Having this handler makes possible to wire up `on-dirty` handler on the root node and `setDirtied` for the leaf node.
Removing custom dirting mechanism from React Native should drastically simplify rendering layer and bring a huge performance win.

Reviewed By: emilsjolander

Differential Revision: D6597856

fbshipit-source-id: 6588cd712f9c1dede4af32f3d326f90103e48ff0
2018-01-10 09:56:41 -08:00
Pritesh Nandgaonkar b41d41fd40 Move utility functions to utils file
Reviewed By: emilsjolander

Differential Revision: D6682933

fbshipit-source-id: 0fd90fdaf5ca4f9b7a11cbd15d8c54c7d0ce8a03
2018-01-10 05:02:24 -08:00
Pritesh Nandgaonkar a8d4666651 Fix warnings of casting and null pointer handling
Reviewed By: emilsjolander

Differential Revision: D6675111

fbshipit-source-id: 884659fabb05033b4d43d3aa6629e22481d39b7e
2018-01-09 04:30:56 -08:00
Pritesh Nandgaonkar d85da86dc7 Move YGNodeResolveFlexShrink to a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6611418

fbshipit-source-id: 6e5ba39b555d313a967800589891027920112c15
2018-01-08 03:01:30 -08:00
Pritesh Nandgaonkar 6627d7723c Moved YGResolveFlexGrow as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6611385

fbshipit-source-id: 71660946c469fac77c5ffa0284c793e6adc9db7b
2018-01-08 03:01:30 -08:00
Pritesh Nandgaonkar 0a9e652bdd Move markDirtyInternal as a method in YGNode
Reviewed By: emilsjolander

Differential Revision: D6611287

fbshipit-source-id: 54402145d51ea717553ea136be739b9880a79817
2018-01-08 03:01:30 -08:00
Pritesh Nandgaonkar 28968e2c0b Move YGCloneChildrenIfNeeded as a method on `YGNode`
Reviewed By: emilsjolander

Differential Revision: D6611155

fbshipit-source-id: 463723a363e0fbd2c7686f65226eca73236bd07e
2018-01-08 03:01:30 -08:00
Dan Zimmerman 1fd7315c3b Remove unnecessary include
Reviewed By: mzlee

Differential Revision: D6638538

fbshipit-source-id: 4b11b8f4f88aa533ac0467348df36e5780bfbb70
2017-12-27 13:16:30 -08:00
Héctor Ramos 33da6047a3 Include OSS defs in Yoga BUCK
Reviewed By: ttsugriy

Differential Revision: D6630280

fbshipit-source-id: 6355d4b64a39feb000d5a104f39733a90fc5a31e
2017-12-22 14:31:21 -08:00
Pritesh Nandgaonkar a163f70f87 Optimize the performance of Origami
Reviewed By: emilsjolander

Differential Revision: D6619293

fbshipit-source-id: c1632efd97f47696b7f8bb1b3e763de92c707287
2017-12-22 06:51:09 -08:00
Taras Tsugrii ba31d29dc9 Replace native cxx_library with fb-specific macros.
Reviewed By: adamjernst

Differential Revision: D6618153

fbshipit-source-id: 188e2ca3cc78efad6e71f0a22547e26abf2f62e1
2017-12-21 08:58:50 -08:00
Pritesh Nandgaonkar 4cdbb77c33 Do not set FB_ASSERTION_ENABLED
Reviewed By: emilsjolander

Differential Revision: D6611904

fbshipit-source-id: f01ac144159c1b333d8deb8cbb5ba0288e4bf7a4
2017-12-21 04:45:34 -08:00
Peter Ammon f9f40cd3e4 JSBigString to MAP_PRIVATE not MAP_SHARED
Reviewed By: mhorowitz

Differential Revision: D6613463

fbshipit-source-id: 2553a0475ade061f3b70ffce90fcf4e0ceb7d9fa
2017-12-20 14:01:33 -08:00
Ben Nham 59c7967627 document isInspectable
Reviewed By: mhorowitz

Differential Revision: D6601992

fbshipit-source-id: 4bd69f90943b14286e5618c70fc7eaca689fb02c
2017-12-20 02:30:47 -08:00
Michał Gregorczyk 6ad1f0957a Kill orphaned marker end in JSCExecutor
Reviewed By: mhorowitz

Differential Revision: D6594498

fbshipit-source-id: 67f281ded088bdbad3eb1e173882d4328c1fdc93
2017-12-19 14:00:36 -08:00
Pritesh Nandgaonkar f1055bcac8 Make YGNode as c++ struct with properties exposed through accessors
Reviewed By: emilsjolander

Differential Revision: D6592257

fbshipit-source-id: 641e8b9462ad00731a094511f9f5608b23a6bb21
2017-12-19 11:32:49 -08:00
Pritesh Nandgaonkar d89901fa60 Use wildcard instead of manual file addition
Reviewed By: emilsjolander

Differential Revision: D6601704

fbshipit-source-id: 9bac4bc1a8d9e40feb0111fc4c7a627d4d3c4270
2017-12-19 07:41:57 -08:00
Ben Nham 15cd98b782 add isInspectable property
Reviewed By: Hypuk

Differential Revision: D6578736

fbshipit-source-id: a4229c3766125ff55cff50a49893b2385f9c8a6a
2017-12-18 13:32:36 -08:00
Ben Nham 3852c42ad8 add isInspectable property
Reviewed By: Hypuk

Differential Revision: D6578737

fbshipit-source-id: 05143e4cf59b5be9e20ab79b83efbfaa7da059d8
2017-12-18 13:32:35 -08:00
Ben Nham bef7967f9a move page registration logic in to jsinspector
Reviewed By: pakoito

Differential Revision: D6531199

fbshipit-source-id: ed1ae9e2f0c19e7656cd022e438693798320e55a
2017-12-15 09:20:13 -08:00
Taras Tsugrii 88f6f69152 Skylarkify config_utils_defs macros.
Reviewed By: adamjernst

Differential Revision: D6569785

fbshipit-source-id: d2f20cd648822846e59830614d4eb0f466252363
2017-12-14 18:52:18 -08:00
Max Sherman eca51eb46a Type global hooks as function pointers
Reviewed By: danzimm

Differential Revision: D6568053

fbshipit-source-id: 94fdecaf066a36c9c916bbd7b23c2f0680d91895
2017-12-14 14:47:10 -08:00
Max Sherman 434f432d5d Meyers singleton jsc error extractor
Reviewed By: mhorowitz

Differential Revision: D6554142

fbshipit-source-id: f586cd7030130e4ccb069f9aed8fb1364c527e54
2017-12-13 12:35:11 -08:00
Greg McGary f8fe6b0c70 Explicitly #define isnan __builtin_isnan for Android clang-5 to mimic gcc's default behavior
Reviewed By: passy

Differential Revision: D6527499

fbshipit-source-id: 65d9e43c7e7d973a6c92e9863ebe469b35a24ac8
2017-12-12 17:02:08 -08:00
Taras Tsugrii ed2bfcb35a Skalarkify flags macros.
Reviewed By: adamjernst

Differential Revision: D6528242

fbshipit-source-id: f809cfb853d6615a1aa47e145063ef1d7f5838be
2017-12-09 22:06:09 -08:00
Ben Nham e76abfa036 Revert D6155682: Use clang-5.0 -Oz
Differential Revision: D6155682

fbshipit-source-id: 9139ed14e0d24784bf25b2783e364a511173ab83
2017-12-08 09:54:37 -08:00
Greg McGary f59140eb21 Use clang-5.0 -Oz
Reviewed By: mzlee

Differential Revision: D6155682

fbshipit-source-id: 2f64e742f4dc44be171274c2ad0a41fb1e7079d7
2017-12-07 13:32:23 -08:00
Yaroslav Pavlov 4034febb7e Round size geometry for Button and RichText components.
Reviewed By: cuva

Differential Revision: D6466875

fbshipit-source-id: 62a480411e7d2354a6879917c42bbf0ee96cdadd
2017-12-06 16:33:34 -08:00
Pritesh Nandgaonkar b08a912f11 vector instead of YGNodeList
Reviewed By: jonathandann, emilsjolander

Differential Revision: D6442379

fbshipit-source-id: d2d48ef0676351d2eeaa2d427dcd72e082cd15a1
2017-12-05 08:30:15 -08:00
Lukas Wöhrl 4fdaf2de98 Fix min/max percentage constraints on measured nodes
Summary:
Fix min/max percentage constraints on measured nodes. Currently we passed in the available size instead of the parent size.
Fixes #611
Closes https://github.com/facebook/yoga/pull/649

Reviewed By: priteshrnandgaonkar

Differential Revision: D6408019

Pulled By: emilsjolander

fbshipit-source-id: 18be5056dbc0dc179970ec231ab8b4e2cdba65c5
2017-11-30 08:16:50 -08:00
Andres Suarez d674d48a7b Run buildifier over all BUCK files
Reviewed By: mzlee, dinhviethoa

Differential Revision: D6439498

fbshipit-source-id: ec847595afdd79434e48652d237d2533bbd2cad2
2017-11-29 20:30:43 -08:00
Lukas Wöhrl 72e762d4bc Suppress unused warnings on YGDefaultLog
Summary:
Suppresses the unused warnings on ```YGDefaultLog```. It uses a more generic macro which simply casts the variable to ```(void)```. This is the simples approach to make mutiple different compilers happy. Fixes #650
Closes https://github.com/facebook/yoga/pull/651

Differential Revision: D6407999

Pulled By: emilsjolander

fbshipit-source-id: 19fd78dd8b84eafdbb48875dd003d506a98c4807
2017-11-28 10:36:16 -08:00
Peter Ammon 03956c4ecf Use different symbols for SystraceSection depending on WITH_FBYSTRACE
Reviewed By: tmikov

Differential Revision: D6365162

fbshipit-source-id: d1e13b0012528305506c368d5e60f3754a576df3
2017-11-27 14:45:57 -08:00
Ben Nham 70c359000a move inspector out of jschelpers
Differential Revision: D6385924

fbshipit-source-id: 1913d903077494cc0d86d5a8c8839620f1ecab0c
2017-11-27 07:23:37 -08:00
Ben Nham 850efa8650 remove hard dependency on JSGlobalContextRef in inspector interfaces
Differential Revision: D6385923

fbshipit-source-id: 2f547b0dc1760f72fa8d7edc67327415069c648e
2017-11-27 07:23:37 -08:00
Lukas Wöhrl 5f99b1a55f Measure nodes which have margin: auto and align-item: stretch
Summary:
If you have a measurable node and set ```marign-left: auto``` + ```align-item:stretch``` on it, it won't get measured and they get a width/height of ```-(nan)```. This change fixes that behaviour. Fixes #644.
Closes https://github.com/facebook/yoga/pull/645

Differential Revision: D6413512

Pulled By: emilsjolander

fbshipit-source-id: 755febeb33bb0d4520ca6b3c28d56ac333e4a14d
2017-11-27 05:30:30 -08:00
Lukas Wöhrl 1050e0b476 Add justify-content: space-evenly
Summary:
Adds new ```space-evenly``` for ```justify-content```.

Also adds a typofix in one of the other justify-content tests.

Fixes #657
Closes https://github.com/facebook/yoga/pull/658

Differential Revision: D6407996

Pulled By: emilsjolander

fbshipit-source-id: cc837409e1345624b4bd72c31e25fe68dcb0f6a3
2017-11-27 04:01:02 -08:00
Lukas Wöhrl 1d62848535 Fix shrinking in non strech alignments while retaining legacy behaviour
Summary:
This fixes shrinking of elements which are in a non stretch alignment, but keeps the legacy stretch behaviour in place. Additionally this adds a testcase for ```useLegacyStretchBehaviour```

Fixes #633
Closes https://github.com/facebook/yoga/pull/635

Differential Revision: D6408037

Pulled By: emilsjolander

fbshipit-source-id: 377ab0308dd3a75a148a0af31ab5eb3ffb5b5d83
2017-11-27 03:15:38 -08:00
Lukas Wöhrl 41da6e3128 Do not mark node as dirty if, new and old values are undefined
Summary:
If we have a values already set to undefined and set it to undefined again, we invalidate the layout. This change takes this case into account and keeps the layout valid.
Fixes #630
Closes https://github.com/facebook/yoga/pull/648

Differential Revision: D6408013

Pulled By: emilsjolander

fbshipit-source-id: dc2a848d84d3de9f4650fac9e41d7c8169446406
2017-11-27 03:15:37 -08:00
Jake Teton-Landis a383b8ca05 Fix assertion preventing YGNodeLayoutGet* with YGEdgeEnd
Summary:
Expected to be able to call `YGNodeLayoutGetMargin(node, YGEdgeEnd)`, but instead, the program aborts with `"Cannot get layout properties of multi-edge shorthands"`.

This bug seems to incorrectly prevent properties from YGEdgeEnd for all Layout properties.
Closes https://github.com/facebook/yoga/pull/632

Differential Revision: D6408060

Pulled By: emilsjolander

fbshipit-source-id: 4ab3b2ffb2f1bb6fd3a27f780caf0123abcdb230
2017-11-27 03:01:00 -08:00
Lukas Wöhrl f5becebc07 Fix justify content with min/max constraint parent
Summary:
The min/max inner width shouldn't take the margins into account.
Adds a test for both cases.

Fixes #664
Closes https://github.com/facebook/yoga/pull/665

Differential Revision: D6407982

Pulled By: emilsjolander

fbshipit-source-id: ffa549a06f802263e3b8488e90756aa3f722d52d
2017-11-24 07:26:24 -08:00
Pritesh Nandgaonkar 0984f29a32 Refactor and move YGNodeToString implementation to different file
Reviewed By: emilsjolander

Differential Revision: D6397372

fbshipit-source-id: 79e701efe7f19db6dac1aea6328ebf0ac84a7ac3
2017-11-23 09:46:30 -08:00
Pritesh Nandgaonkar d7ab9496bc Change c files to cpp
Reviewed By: gkassabli

Differential Revision: D6271299

fbshipit-source-id: 66c0e54ccf019d72d1fd0b4d117826e4e84fdc89
2017-11-21 10:18:29 -08:00
Pritesh Nandgaonkar d950dc6a21 Deleted YGSetMemoryFucs as it is unused
Reviewed By: emilsjolander

Differential Revision: D6374147

fbshipit-source-id: 8c896dce23571268a1a52df5cc72486af9d66df7
2017-11-21 03:37:54 -08:00
Pritesh Nandgaonkar 6c70975689 Replace printf with YGLog calls
Reviewed By: gkassabli

Differential Revision: D6297015

fbshipit-source-id: 6a67bdf33ef121785ac14938f5d3ed6e9d6f2656
2017-11-16 05:34:27 -08:00
Alex Dvornikov a47431ed74 Adopt split segments registration approach on Android
Differential Revision: D6284863

fbshipit-source-id: 0df6b90eb0cbeab4c8a2b11f1e4dcbd5d5dfab72
2017-11-09 12:23:51 -08:00
Alex Dvornikov cff0d8e0e5 Register split segment paths with RAMBundleRegistry
Differential Revision: D6284466

fbshipit-source-id: c80cf929af38f92f06cca5b366c58785ae992d83
2017-11-09 12:23:46 -08:00
Alex Dvornikov 6ecae73fe5 Remove RAMBundleRegistry subclasses
Differential Revision: D6262247

fbshipit-source-id: 708f919e34f1706d9aca19a34ad8ea506e9f8d8b
2017-11-08 04:12:20 -08:00
Dan Caspi 19de7fcb22 Moving some RAM logic to Instance.
Reviewed By: michalgr

Differential Revision: D6208977

fbshipit-source-id: 28339d07c58f1acc816be02f2707ef75529fa069
2017-11-03 05:32:02 -07:00
Dan Zimmerman 02f7c61cdd Introduce macro that disables poisoning JSC symbols
Reviewed By: dcaspi

Differential Revision: D6184846

fbshipit-source-id: 755653ceebcbded8fbe165375e8e8e50cf0ecccc
2017-11-02 08:16:11 -07:00
Dan Zimmerman c6a30ab949 Match the linkage used for FBJSContextStartGCTimers, configureJSCForIOS
Reviewed By: dcaspi

Differential Revision: D6184848

fbshipit-source-id: cf016caddcccab8de9ffccbe616e579005ae05d0
2017-11-02 08:16:11 -07:00
Chandra Patni 86c50a5094 use `> || YGFloatsEqual` instead of `>=` for computing round value to pixel grid
Reviewed By: emilsjolander

Differential Revision: D6202484

fbshipit-source-id: bb80235452208caec388775574cc4f07bfd649c4
2017-11-01 15:47:59 -07:00
Alex Dvornikov b5651d945c Add "setJsBundlesDirectory" method to CatalystInstanceImpl
Differential Revision: D6042493

fbshipit-source-id: 950c6d6bdc2e0b62b14c9bcfc86233159a002c67
2017-11-01 06:54:44 -07:00
Georgiy Kassabli 21917ab7bf Fixing the edge case in Yoga with percentage absolute position and infinite constraint
Reviewed By: emilsjolander

Differential Revision: D6199731

fbshipit-source-id: f40ddf00614b2f507848fb35f348a9dfef14b323
2017-11-01 06:20:11 -07:00
Pritesh Nandgaonkar 0230672275 Reverting the dirty child optimization
Reviewed By: emilsjolander

Differential Revision: D6203290

fbshipit-source-id: 8e42abb70e55f0fac90faaa21ecdbe0fbb76ce6b
2017-10-31 23:15:43 -07:00
Pritesh Nandgaonkar 587225ab45 Used hasDirtyChildren tag for the optimization
Reviewed By: emilsjolander

Differential Revision: D6134754

fbshipit-source-id: bbcfee14058140b946401de756a3f130de0f51cd
2017-10-31 08:21:54 -07:00
Dan Caspi 40a90831b8 Final fixes
Reviewed By: amnn

Differential Revision: D6050931

fbshipit-source-id: 44db12becc0057fe71d469f3e9e6fc16a5d4d5af
2017-10-19 14:33:05 -07:00
Sebastian Markbage 60c898d864 Persistent Yoga
Summary:
This is meant to show a possible route format for a persistent form of Yoga. Where previous layouts can remain intact while still taking advantage of incremental layout by reusing previous subtrees.

```c
YGNodeRef YGNodeClone(const YGNodeRef node);
```

The core of this functionality is a new API to clone an existing node. This makes a new detached node with all the same values as the previous one. Conceptually this makes the original node "frozen" from that point on. It's now immutable. (This is not yet enforced at runtime in this PR but something we should add.)

Since the original is frozen, we reuse the children set from the original node. Their parent pointers still point back to the original tree though.

The cloned node is still mutable. It can have its styles updated, and nodes can be inserted or deleted. If an insertion/deletion happens on a cloned node whose children were reused, it'll first shallow clone its children automatically.

As a convenience I also added an API to clear all children:

```c
void YGNodeRemoveAllChildren(const YGNodeRef node);
```

During insert/delete, or as a result of layout a set of reused children may need to be first cloned. A kind of copy-on-write. When that happens, the host may want to respond. E.g. by updating the `context` such as by cloning any wrapper objects and attaching them to the new node.

```c
typedef void (*YGNodeClonedFunc)(YGNodeRef oldNode,
                                 YGNodeRef newNode,
                                 YGNodeRef parent,
                                 int childIndex);

void YGConfigSetNodeClonedFunc(YGConfigRef config,
                               YGNodeClonedFunc callback);
```

This PR doesn't change any existing semantics for trees that are not first cloned.

It's possible for a single node to exist in two trees at once and be used by multiple threads. Therefore it's not safe to recursively free a whole tree when you use persistence. To solve this, any user of the library has to manually manage ref counting or tracing GC. E.g. by replicating the tree structure in a wrapper.

In a follow up we could consider moving ref counting into Yoga.
Closes https://github.com/facebook/yoga/pull/636

Reviewed By: emilsjolander

Differential Revision: D5941921

Pulled By: sebmarkbage

fbshipit-source-id: c8e93421824c112d09c4773bed4e3141b6491ccf
2017-10-17 01:26:48 -07:00
Alex Dvornikov dd400f842b add "jsBundlesDirectory" method to RCTBridgeDelegate
Differential Revision: D6030185

fbshipit-source-id: 58d6f9d0d412c7ad0f83af9ae4df01c4dc1178bc
2017-10-12 12:33:21 -07:00
Sergei Dryganets 4192790f05 more detailed CxxModule logging
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Cxx module code swallows c++ exception details with sarcastic comment let native developer figure it out.

Now instead of swallowing it, we print as much information as we can for different exception types.
Still not ideal but way more informative.

Have a crash in your c++ module and try to figure it out without this change.
Closes https://github.com/facebook/react-native/pull/16193

Differential Revision: D6040038

Pulled By: javache

fbshipit-source-id: 3fbe838383ca13395e21f74c9549474f6329cfeb
2017-10-12 12:02:11 -07:00
Scott Yost f9047cdfaf Revert D5932093: [RAMBO] Final fixes
Differential Revision: D5932093

fbshipit-source-id: 8e6ac0482a4c5a9ae4549be73d316df919613c9b
2017-10-12 09:16:40 -07:00
Dan Caspi 0da1738e9b Final fixes
Reviewed By: amnn

Differential Revision: D5932093

fbshipit-source-id: f52a0bb3552af5ad003c051dc32dff0bfabb43ac
2017-10-12 08:27:17 -07:00
Alex Dvornikov 9e01d72103 Unify supplimentary bundle path creation logic between Android and iOS
Differential Revision: D5941546

fbshipit-source-id: c9b8fab887f480faa373c26a1d5ba310e8acde78
2017-10-04 15:16:27 -07:00
Paco Estevez Garcia ef2e29f54c Move URL escaping to Inspector layer
Reviewed By: Hypuk

Differential Revision: D5967544

fbshipit-source-id: d741e6324aff7583778cb13c862505b61ca02a3d
2017-10-04 03:51:33 -07:00
Paco Estevez Garcia 905631470a Add isNetworkInspected to check if a JS VM needs to be paused on launch
Reviewed By: mhorowitz

Differential Revision: D5924019

fbshipit-source-id: 6b1cfc94d149883236ad06619fc54018d57cb0e7
2017-10-03 06:03:23 -07:00
Paco Estevez Garcia da14fad829 Add AppIdentity and DeviceIdentity to Inspector
Reviewed By: Hypuk

Differential Revision: D5924011

fbshipit-source-id: a81d420dbe1a5ede203d2fa313548e19664b9587
2017-10-03 06:03:23 -07:00
Marko Novakovic 5038b06b31 Un-inline-ing a method declared as export
Reviewed By: compnerd

Differential Revision: D5909847

fbshipit-source-id: 7108dd88271e640e1881b20c0cbf1ad28bbf63c9
2017-09-26 19:01:38 -07:00
Alex Dvornikov 7d2021ec49 Added iOS support for loading multiple RAM bundles
Differential Revision: D5890466

fbshipit-source-id: e7805f90a7c446f5f75427c3fadcd133a3f7ad18
2017-09-22 09:58:47 -07:00
Alex Dvornikov 7d115730dc Configure JSExector with BundleRegistry instead of JSModulesUnbundle
Differential Revision: D5890458

fbshipit-source-id: 968be95786ffbf53aa98928d4d3e3bd52a84b3dc
2017-09-22 09:58:46 -07:00
Jia Li 0aa12939fd Revert D5850968: Configure JSExector with BundleRegistry instead of JSModulesUnbundle.
Differential Revision: D5850968

fbshipit-source-id: f4c9dc8d5f14cdd32195463e8786242e708770e9
2017-09-21 21:22:39 -07:00
Jia Li 526fd6b931 Revert D5850970: Added iOS support for loading multiple RAM bundles
Differential Revision: D5850970

fbshipit-source-id: 8b0f9bc296ac2944b8b7657a4119b6787d810a2c
2017-09-21 21:22:39 -07:00
Alex Dvornikov 1aeb767a37 Added iOS support for loading multiple RAM bundles
Differential Revision: D5850970

fbshipit-source-id: 88ab6fe3822f1bc4195007f8ec83177a84c27569
2017-09-21 08:51:00 -07:00
Alex Dvornikov 79821917fa Configure JSExector with BundleRegistry instead of JSModulesUnbundle.
Differential Revision: D5850968

fbshipit-source-id: e5e7ad92c2347c2641551fcf820f061ffde5fed6
2017-09-21 08:51:00 -07:00
Alex Dvornikov 2f952fbaac Initial implementation of multiple RAM bundles registry
Differential Revision: D5850963

fbshipit-source-id: e1bd6d74953872d38e73a20f6d054905a7e4c80c
2017-09-21 08:51:00 -07:00
Alex Dvornikov da2ea2601b Allow "nativeRequire" to accept "bundleId" and "moduleId" values
Differential Revision: D5850960

fbshipit-source-id: 4d7aa0ed7542181861649a2089d90c3cf98723e9
2017-09-21 08:51:00 -07:00
Mingwei Pan 67d0cc5c08 Improve formatting of YogaNode.print() on Android
Reviewed By: emilsjolander

Differential Revision: D5842889

fbshipit-source-id: 8ecc829dc43614934c47fd3a68317259e403325a
2017-09-21 07:50:57 -07:00
Emil Sjolander 244045edea Revert D5874862: [yoga][PR] Fix shrinking in non strech alignments
Differential Revision: D5874862

fbshipit-source-id: 24517d26b18c11fb9f75c6d3b5faae360711ea9e
2017-09-21 03:50:11 -07:00
Lukas Wöhrl aa8eb806ca Fix shrinking in non strech alignments
Summary:
This fixes shrinking of elements which are in a non stretch alignment

Fixes #633
Closes https://github.com/facebook/yoga/pull/634

Differential Revision: D5874862

Pulled By: emilsjolander

fbshipit-source-id: 1426aa6b60f6ba42c2be702e6f24cea935ab7acb
2017-09-20 13:31:11 -07:00
Michał Gregorczyk 0ee502d125 More useful utilities in jschelpers
Reviewed By: mhorowitz

Differential Revision: D5785204

fbshipit-source-id: 4c5240f24c6a69bb781896d3af32d4d16fc2387c
2017-09-18 18:45:27 -07:00
Michał Gregorczyk d6c519bc96 Base class for all object private data passed to JSC
Reviewed By: amnn

Differential Revision: D5761937

fbshipit-source-id: de88cf8b959fc855c3c0786f817bb6032491c819
2017-09-18 18:45:27 -07:00
Mingwei Pan d0f36d7a68 Zero out all fields in YGZeroOutLayoutRecursivly using memset
Reviewed By: emilsjolander

Differential Revision: D5842351

fbshipit-source-id: d2c2b6f829588a200525b7ccbdb63003cb4dcc4e
2017-09-15 08:34:26 -07:00
Pieter De Baets 7b770556ac Improve RCTCxxBridge invalidation
Reviewed By: fromcelticpark

Differential Revision: D5536063

fbshipit-source-id: b0f19bebea839c7da84890c338ad4d38293bc99c
2017-09-11 04:30:31 -07:00
Michael Lee 1f2ca244d7 Move to fbsystrace to a new location
Reviewed By: dreiss

Differential Revision: D5760920

fbshipit-source-id: 9ff001dbd34660c14d061dec5428e82a815c719a
2017-09-07 09:17:02 -07:00
Michael Lee ed31f7a97d Reformat BUCK files
Reviewed By: zertosh

Differential Revision: D5756296

fbshipit-source-id: 69af6e9211648a81ba864be8d37165023cb5f9c2
2017-09-05 15:02:19 -07:00
Marc Horowitz d48f08cad6 Thread the JSI runtime descriptor up into the RCTDevMenu title
Reviewed By: javache

Differential Revision: D5643014

fbshipit-source-id: 977be5729c57c0d01ff67b268031ad6fdbf88a07
2017-09-05 15:02:19 -07:00
Pieter De Baets 8497ec297c Shortcut JSBigFileString in when no offset is used
Reviewed By: mhorowitz

Differential Revision: D5227225

fbshipit-source-id: a50688c8b873bf08ea10fafaa143df130f59dfaa
2017-09-05 03:15:43 -07:00
Michał Gregorczyk 8ffe131dad Do not let macros mess with shape of JSExecutor's vtable
Reviewed By: mhorowitz

Differential Revision: D5750246

fbshipit-source-id: b9b428bb301abe208075d409b1a08cde070b17d8
2017-09-01 09:15:43 -07:00