Commit Graph

214 Commits

Author SHA1 Message Date
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
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
Pritesh Nandgaonkar fdef3784f0 Add flag in YGConfig for running experiments
Reviewed By: emilsjolander

Differential Revision: D6948702

fbshipit-source-id: 009fe2d64b6098f8c3a0289f0e6939dea5ce0d37
2018-02-09 06:16:36 -08:00
Pritesh Nandgaonkar 400a29e151 Fix memory leak by not duplicating the YGConfig
Reviewed By: emilsjolander

Differential Revision: D6945022

fbshipit-source-id: 5fd3c3e2ac1cd94d459d5aa06e0daa8f107779ac
2018-02-09 04:56:49 -08:00
Taras Tsugrii 79a63d040f Skylarkify RN defs.
Reviewed By: adamjernst

Differential Revision: D6934209

fbshipit-source-id: 59f50b739482a53473c157f9e0183024dc88dc67
2018-02-08 09:47:28 -08:00
Pritesh Nandgaonkar 528bbacf6b Expose a function which marks all descendants dirty
Reviewed By: emilsjolander

Differential Revision: D6911869

fbshipit-source-id: e0a3abcf5653f921297edfdca473d83b947cc627
2018-02-08 05:04:02 -08:00
Pritesh Nandgaonkar f75e21f1ca call margin method on child instead of node
Reviewed By: emilsjolander

Differential Revision: D6918367

fbshipit-source-id: cee90e015f9e45a717a7307f59fd3b9ef6f399b6
2018-02-07 17:37:56 -08:00
Pritesh Nandgaonkar 64d530ba07 Fix screenshot test due main axis justification refactor
Reviewed By: emilsjolander

Differential Revision: D6923178

fbshipit-source-id: d8f81b06d9127c75daecffb73b5e6c5abbad8ade
2018-02-07 08:45:46 -08:00
Pritesh Nandgaonkar 62d01006a1 Moved margin axis function as a method in YGNode
Reviewed By: emilsjolander

Differential Revision: D6900003

fbshipit-source-id: a42da3bcd3126bf8c432c6740987b5ec0b572172
2018-02-06 08:46:05 -08:00
Pritesh Nandgaonkar 1475fc4856 Moved trailing padding and border function as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6899571

fbshipit-source-id: 7f686e8771d5a94aae502191516557b20c557d7c
2018-02-06 08:46:05 -08:00
Pritesh Nandgaonkar 9daa17458a Moved out main axis justification logic to seperate function
Reviewed By: emilsjolander

Differential Revision: D6845997

fbshipit-source-id: fdb64e00de39427ce1d66d4fbfd06c23c0d32bcf
2018-02-06 08:46:05 -08:00
Pritesh Nandgaonkar 9658d9f82b Fixed failing snapshot test
Reviewed By: emilsjolander

Differential Revision: D6901242

fbshipit-source-id: 7391d6a34fa28e9f92f4ff834755a89dd876fdad
2018-02-06 07:16:03 -08:00
Pritesh Nandgaonkar d4517ddb9f Made a separate function for resolving flexible length
Reviewed By: emilsjolander

Differential Revision: D6834269

fbshipit-source-id: 954bc7fe8eb9256d353cdda27e5c64c076808e25
2018-02-05 07:04:54 -08:00
Pritesh Nandgaonkar ca91f0e3ac Seperate function for second pass
Reviewed By: emilsjolander

Differential Revision: D6833635

fbshipit-source-id: 7680a67db8bfe22f8fb86407159888882f3a3353
2018-02-05 07:04:54 -08:00
Pritesh Nandgaonkar fda861a889 Replaced first pass with a function
Reviewed By: emilsjolander

Differential Revision: D6819719

fbshipit-source-id: e5e77c21d1dca2255433da3388887d9db3f7b642
2018-02-05 07:04:53 -08:00
Pritesh Nandgaonkar 34b7ec82b5 Moved out logic to calculate size consumed on a line into seperate function
Reviewed By: emilsjolander

Differential Revision: D6797640

fbshipit-source-id: ad9757e7d603c0ce57f452b1e5c404037605bed9
2018-02-05 07:04:53 -08:00
Pritesh Nandgaonkar 9f7cedbe14 Remove the use of legacy flag and log the diff if its used
Reviewed By: emilsjolander

Differential Revision: D6856812

fbshipit-source-id: e4724d80702cc75c1894e348e137b24e663573d2
2018-02-02 07:40:25 -08:00
Mark Wang 9f57dedc17 Use delete instead of free
Reviewed By: richardjrossiii

Differential Revision: D6866064

fbshipit-source-id: a44828cedb5045b6c97179fb30ffd8c8dafcbfbe
2018-01-31 18:01:34 -08:00
Pritesh Nandgaonkar be8e7c6e65 Made logging logic dynamic to log string length
Reviewed By: emilsjolander

Differential Revision: D6784491

fbshipit-source-id: 26e4520a84be355ff992b808297ce7a95b3d09e3
2018-01-23 06:46:08 -08:00
Jonathan Kim 4f2cc42a2d Make xplat react native files buildable
Reviewed By: mzlee

Differential Revision: D6605611

fbshipit-source-id: baa33947319a27b95020924d177a9398a276dabe
2018-01-21 22:05:05 -08:00
Pritesh Nandgaonkar d0f7d4d107 Use vector instead of linked list
Reviewed By: emilsjolander

Differential Revision: D6722959

fbshipit-source-id: 4e81176802b9a9319bc5f385c824a06be14a83a2
2018-01-16 09:36:09 -08:00
Pritesh Nandgaonkar ee5c91c031 Fix for failing screenshot tests
Reviewed By: emilsjolander

Differential Revision: D6726745

fbshipit-source-id: 99f91aabe2337b23953724545f97695238f2124e
2018-01-16 09:16:01 -08:00
Valentin Shergin 6bb8617f3a Exposing `setDirtiedFunc` as plain C function YGNodeSetDirtiedFunc
Summary: Trivial. Those lines were lost during rebasing of the original commit.

Reviewed By: priteshrnandgaonkar

Differential Revision: D6717696

fbshipit-source-id: a5dce25427c8977352b3ae7ea01e546a540e0c13
2018-01-15 16:06:11 -08:00
Pritesh Nandgaonkar 831a1bb4b1 Moved leadingpaddingnandborder function as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6711991

fbshipit-source-id: 41ad7191bf8df6fe3131106436dc0c87e9dee297
2018-01-15 10:17:29 -08:00
Pritesh Nandgaonkar 2fe65b032e Move trailing padding function as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6711897

fbshipit-source-id: fa2e1a8e31242358a6e94aef51368e2c2c58b79d
2018-01-15 10:17:29 -08:00
Pritesh Nandgaonkar bd7bf94af9 Moved leading padding function as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6711830

fbshipit-source-id: d2f6f55ec23b007bb51f8a91385e02236f46dc7b
2018-01-15 10:17:29 -08:00
Pritesh Nandgaonkar 7f94bff89a Resolve direction function is now as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6711755

fbshipit-source-id: a0e80596e10f0c7fb7a31b75377da4db846c4bbb
2018-01-15 10:17:29 -08:00
Pritesh Nandgaonkar 82088580ab Move trailing border function as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6711666

fbshipit-source-id: fe4fdfc2db59d03beb763317e1a6f9de52f851d4
2018-01-15 10:17:29 -08:00
Pritesh Nandgaonkar 210ae5b95a Move leading border function as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6711523

fbshipit-source-id: 76e90083a9dd0728dc9557cc3b0a1f431f3afd5d
2018-01-15 10:17:29 -08:00
Pritesh Nandgaonkar 2b27f1aa19 Moved YGNodeIsFlex as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6711536

fbshipit-source-id: e60be7da55e3e8d254eb253c141d219a37a76087
2018-01-15 10:17:28 -08:00
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
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