Граф коммитов

1185 Коммитов

Автор SHA1 Сообщение Дата
zhongwuzw d55558e138 Fix isBatchActive of RCTCxxBridge (#22785)
Summary:
Seems we lost handler of `isBatchActive` from [RCTBatchedBridge a86171a](a86171a482/React/Base/RCTBatchedBridge.m) to [RCTCxxBridge 5bc7e39](b774820dc2 (diff-a2a67635fffd7b690d14dc17ae563a71)).

Changelog:
----------

[iOS] [fixed] - Fix isBatchActive of RCTCxxBridge
Pull Request resolved: https://github.com/facebook/react-native/pull/22785

Reviewed By: mhorowitz

Differential Revision: D13731897

Pulled By: cpojer

fbshipit-source-id: 8d6b85bcea8fe8997a93b4e1ac8b8007422ca20e
2019-01-21 00:28:48 -08:00
Valentin Shergin 091edd2ef7 Fabric: Clear separation between `commmit` and `tryCommit`
Summary: Previously we had a single `commit` function that accepts an argument that enables auto-retry mechanism. As Spencer pointed out, that wasn't so useful and clear. So, I split the method into two with more expressive names.

Reviewed By: sahrens

Differential Revision: D13681594

fbshipit-source-id: 529f729d597206e9a0ac940f005a1569a9bef707
2019-01-16 20:22:40 -08:00
Valentin Shergin 8d83d5f8eb Fabric: Unifying retain/release logic in EventTarget
Summary:
I read my code and one thing stroke me: What if the same event emitter dispatches several events during the same event beat? In the previous implementation, only the first one will be delivered because the first `release` call consumes stored strong reference.
So, I changed the API a bit to make this more explicit: we have `retain` & `release` methods and we have a getter that works (multiple times) only if the object was successfully retained.

Reviewed By: sahrens

Differential Revision: D13668147

fbshipit-source-id: c00af5f15bc7e30aa704d46bd23584b918b6f75a
2019-01-16 20:22:40 -08:00
Valentin Shergin 7d630b92dc Fabric: Lock-free events 5/n: New implementation of `toggleEventEmitters` (which does not rely on mutations)
Summary: This diff implements a new algorithm that effectively marks `EventEmitter`s enabled or disabled. The previous implementation relied on a list of mutation instructions whereas the new one analyzes the shadow trees. The mutations-based approach didn't work well because mutations describe `ShadowView`s whereas some `ShadowNode`s are simply not views (like VirtualText), but we have to enable/disable them anyway.

Reviewed By: sahrens

Differential Revision: D13642594

fbshipit-source-id: 12169e11d5685e50bcd0d8c410498c594df744b4
2019-01-16 20:22:39 -08:00
Valentin Shergin cdb983d339 Fabric: Lock-free events 4/n: Added an assert in EventTarget
Summary: See the diff for more details.

Reviewed By: sahrens

Differential Revision: D13642593

fbshipit-source-id: 8bdcc91bcc2ea1e4093bcac03d87167b8901cbb4
2019-01-16 20:22:39 -08:00
Valentin Shergin 97f9e4082c Fabric: Lock-free events 3/n: EventEmitter::DispatchMutex is not recursive mutex anymore
Summary: The mutex is a "leaf" mutex, so the code cannot reenter that, so there is no reason to be a recursive one.

Reviewed By: sahrens

Differential Revision: D13642592

fbshipit-source-id: 0fb64d3405c5d3408251dc983c186f6747bc6ee2
2019-01-16 20:22:39 -08:00
Valentin Shergin b1814b37aa Fabric: Lock-free events 2/n: Reimagining of EventTarget
Summary:
EventTargetWrapper and EventTarget were merged into one class that controls an `instanceHandle` reference and extracting a strong reference to it.

This diff also decouples the operation of retaining a strong reference (with checking a `enabled` flag) from actual usage of this reference. This allows to wrap into a mutex only first part of this process and avoid possible deadlocks.

Reviewed By: sahrens

Differential Revision: D13616382

fbshipit-source-id: 9907bc12047386fcf027929ae2ae41c0b727cd06
2019-01-16 20:22:39 -08:00
Valentin Shergin bea80b2276 Fabric: Lock-free events 1/n: Removing WeakEventTarget trick from EventEmitter
Summary:
For some time we have had a nit trick inside `EventEmitter`: When event emitter is disabled, we switch to store `EventTarget` as a weak pointer instead of complete deleting it. Given some unpredictability of JS GC, it gave us some time to restore the pointer in case if we increment the counter right after decrementing this. Apparently, we found that it doesn't always work (obviously, sigh...), so we implement the `enableCounter_` and left this feature as it is assuming that it can nice optimization that illuminates some unnecessary constraints.
But, apparently, it's actually harmful, assuming that `jsi::WeakObject` (that thing that we use to refer to actual JS target) actually has "unsafe unretained" (not "weak") semantic.
So, we have to remove this.
This change will be particularly important for coming diffs in the stack.

Reviewed By: mdvacca

Differential Revision: D13324480

fbshipit-source-id: 4c4da2984dc6a36b94b564bc9eee144142b430b0
2019-01-16 20:22:39 -08:00
Valentin Shergin 9f71a8f26e Fabric: `ShadowTree::getRootShadowNode` was removed
Summary: Because it was not idiomatic anyway. There is no point having a pointer to RootShadowNode without any guarantees that it's the current one. Using `commit` method makes this concern explicit.

Reviewed By: sahrens

Differential Revision: D13615363

fbshipit-source-id: f71ffc3c55dbdc69624933eb8b92334ed793c794
2019-01-16 20:22:39 -08:00
Valentin Shergin 84cf657308 Fabric: `ShadowTree::completeByReplacingShadowNode` was moved to RootShadowNode
Summary:
Removing additional complexity from ShadowTree should help with maintainability. Now, this class is "tricky", but short at least.
With new `commit` API, it's much more simple and expected this way.

Reviewed By: sahrens

Differential Revision: D13615365

fbshipit-source-id: 1fe851c1a2d3bdc7ac2f4a570cf0170eae3c4c67
2019-01-16 20:22:39 -08:00
Valentin Shergin c937300f5d Fabric: Layout-related methods were removed from ShadowTree
Summary: Now it's parts of RootShadowNode and Scheduler.

Reviewed By: sahrens

Differential Revision: D13615364

fbshipit-source-id: 13dbea1e69ef51b2679101915c01c6be7e15d859
2019-01-16 20:22:39 -08:00
Valentin Shergin 5a58ca4144 Fabric: New non-blocking treading model for ShadowTree
Summary:
Instead of the whole family of commit* and complete* methods, now we have one single `commit` method which performs pre- and post-commit operations and swap pointers in a thread-safe manner. The `commit` operation is also exposing `revision` number and allows perform multiple commit attempts.

`completeByReplacingShadowNode`, `measure` and `constraintLayout` are also going away to RootShadowNode class in the next commits.

Why?
* Nicer API;
* No more recursive_mutex, no more problems with thread jumps;
* All mutex locks are now leaf-locks, so no more deadlocks possible;
* Exposing `revision` should help with debugging races.

Reviewed By: sahrens

Differential Revision: D13613942

fbshipit-source-id: 94e797d2f7860717847e823b5d97c4f7b35f08df
2019-01-16 20:22:39 -08:00
Valentin Shergin 8f9ca2b9a0 Fabric: Even more systraces
Summary: Trivial.

Reviewed By: mdvacca

Differential Revision: D13664395

fbshipit-source-id: 3de5d65d6fcf8b68bce2636fc91492defdbe8405
2019-01-16 20:22:39 -08:00
David Vacca b421b5f4bd Open source Fabric android
Summary: This diff open sources Fabric Android implementation and it extracts ComponentDescriptorFactory into a function that can be "injected" per application

Reviewed By: shergin

Differential Revision: D13616172

fbshipit-source-id: 7b7a6461216740b5a1ad5ebbead9e37de4570221
2019-01-16 12:38:22 -08:00
Eduardo Roman cfbb2278a0 guard against INF values in CompactValue
Summary:
After this diff D13403925 that got rid of `-ffast-math` we started to have a very odd behavior on Yoga when using release builds.

After digging a while we found that certain set of conditions on O2 and O3 optimization levels was causing Origami to set some `INFINITE` values on Yoga.

We found the root of the problem and fix it on Origami side. But I'm wondering if guarding agains `INFINITE` on Yoga side would be good too. Since now Yoga it's not using `-ffast-math` anymore, and I think infinite is not a a valid value anywhere on Yoga side, it seems to support the reason to guard against it.

I'm happy to abandon this diff if you guys think this is not a good solution.

Reviewed By: davidaurelio

Differential Revision: D13679319

fbshipit-source-id: 061448fea9d1a8496362ff07dc46b546e7f1ffa3
2019-01-16 12:27:49 -08:00
David Aurelio 3cfe8d59bc Reflow comments
Summary:
@public

Repeated application and alternation of Clang Format rules has lead to unfortunate block comment formatting.

Here, we reflow comments

Reviewed By: SidharthGuglani

Differential Revision: D13677242

fbshipit-source-id: 3f1f5e38693eb15e9705f24fd363fc1618c78974
2019-01-16 08:47:15 -08:00
David Aurelio 53a28ee180 Fix URLs to CSS spec in comments
Summary:
@public

These URLs probably have been changed when CSSLayout was renamed to Yoga by search & replacing

Reviewed By: SidharthGuglani

Differential Revision: D13690829

fbshipit-source-id: 44dbd8fe256fc286006d164390609a7c3de6c4e6
2019-01-16 08:47:15 -08:00
Eli White db5528ffa9 Use Generated Switch Schema
Summary: We are now generating the native cpp files for Switch via Buck. Deleting the hand written files and switching over.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D13666672

fbshipit-source-id: 72cf6f6af9374511f2742f8f0d996fa52e1bff5b
2019-01-15 18:10:34 -08:00
Ram N e6f7d69428 Move Android TurboModules to github
Summary:
This commit moves all the turbo module files for Android to Github.

Note that gradle build is not yet enabled.
Sample Turbo Modules will be added in a later commit.

Other missing features

- Support for `CxxModule`
- Remove usage of folly::dynamic for arguments and result conversion
- Support for Promise return types.

Reviewed By: mdvacca

Differential Revision: D13647438

fbshipit-source-id: 5f1188556d6c64bfa2b2fd2146ac72b0fb456891
2019-01-14 15:48:09 -08:00
Valentin Shergin cb14b06309 Fabric: More systraces for Diffing and Commit phase
Summary: Trivial.

Reviewed By: mdvacca

Differential Revision: D13644482

fbshipit-source-id: 90cfa04797682e57fc4de009fe4a412167b9e8cd
2019-01-11 18:13:55 -08:00
Valentin Shergin 7bf6f2c238 Fabric: Layout/Yoga related systrace sections
Summary: Trivial.

Reviewed By: mdvacca

Differential Revision: D13643275

fbshipit-source-id: 67a562b899f077d7ca53b64456807a8d7c8fe6b7
2019-01-11 18:13:55 -08:00
David Aurelio 7406276a5b Remove enum count macros
Summary:
@public
Removes all `YG...Count` macros for enums and replaces them with `facebook::yoga::enums::count<YG...>()`.
This removes the need to manually maintain enum counts.

Same as D13597449, working around a defect in clang < 3.9

Reviewed By: amir-shalem

Differential Revision: D13634622

fbshipit-source-id: 344dc70e167b0caf746fe396cedd200f54e52219
2019-01-11 03:11:58 -08:00
Amir Shalem 1feda5e5c8 Revert D13597449: [Yoga][cleanup] Remove enum count macros
Differential Revision:
D13597449

Original commit changeset: edcee225ada4

fbshipit-source-id: 1afc24833c8657a8a198bc4529d98c8f605b7fbd
2019-01-10 23:51:29 -08:00
Taras Tsugrii c458242d87 Reformat xplat build files according to new formatting rules.
Summary: drop-conflicts

Reviewed By: zertosh

Differential Revision: D13610808

fbshipit-source-id: 52c2a90bba3d9b0ac383f6e4a76b4fb3e60bf382
2019-01-10 20:00:42 -08:00
David Aurelio 35a136801c Remove enum count macros
Summary:
@public
Removes all `YG...Count` macros for enums and replaces them with `facebook::yoga::enums::count<YG...>()`.
This removes the need to manually maintain enum counts.

Reviewed By: shergin

Differential Revision: D13597449

fbshipit-source-id: edcee225ada4058e94f3a727246763e3cc45873d
2019-01-10 07:56:15 -08:00
Marko Novakovic 65194534f6 Using ENUM_BITFIELDS_NOT_SUPPORTED for enum bitfields
Reviewed By: davidaurelio

Differential Revision: D13556160

fbshipit-source-id: e6d373a4e1dd702509b5d63606c08fae9cdb5498
2019-01-08 16:22:29 -08:00
David Aurelio 2a1faec1ca Remove repetition in `YGEnums.h`
Summary:
@public

Wraps enum definition in a single macro.

Down the line, this will allow us to add more functionality:
- Replace manual counts with `yoga::enums::count<YG...>()`
- `yoga::enums::max<YG...>()`
- A bitfield implementation with known memory layout using `max<>()`

Reviewed By: SidharthGuglani

Differential Revision: D13597259

fbshipit-source-id: 543a11a53090bedf1474d00328565ed57d059e23
2019-01-08 12:51:43 -08:00
David Aurelio 3e24710155 Apply clang-format rules
Summary:
@public

Formats Yoga's source according to our clang-format configuration

Reviewed By: SidharthGuglani

Differential Revision: D13596650

fbshipit-source-id: c3722d4eafd63b7596a8b1e85c0197e9d2d6cb7d
2019-01-08 12:51:43 -08:00
Kevin Gozali db87c2544c Re-land D13583442: [RN] Moved TurboModule iOS core to github
Summary:
The original commit was backed out due to a build failure, which seems to be due to compiler flag misconfiguration. That has been fixed.

Original commit: f2fccbb327

Reviewed By: mdvacca

Differential Revision: D13593075

fbshipit-source-id: f3a65e8bd9830f6ac2ea829020500b4632ee2149
2019-01-08 09:12:50 -08:00
Kevin Gozali 8c23b1804b Revert D13583442: [RN] Moved TurboModule iOS core to github
Differential Revision:
D13583442

Original commit changeset: bb1cabd973e8

fbshipit-source-id: 0279e68c7001ec91cf7bbd835bf83232943bb708
2019-01-07 00:47:38 -08:00
David Vacca 9380ec0d23 Fix 'global reference table overflow' error in Fabric
Summary: This diff ensures that the 'measure' method in TextLayoutManager is memoized using a static variable.

Reviewed By: fkgozali

Differential Revision: D13585508

fbshipit-source-id: 9275a4d193b8abb0c3aaffd5a5535234717475e1
2019-01-04 16:36:32 -08:00
Kevin Gozali f2fccbb327 Moved TurboModule iOS core to github
Summary:
This is the iOS binding for TurboModule.

To install the TurboModule binding:
* Provide `RCTCxxBridgeDelegate`
* Provide `RCTTurboModuleManagerDelegate`

Somewhere in `RCTCxxBridgeDelegate` impl:

```
RCTTurboModuleManager *manager = [[RCTTurboModuleManager alloc] initWithRuntime:&runtime bridge:bridge delegate:self];
[manager installJSBinding];
```

Doing so will install `global.__turboModuleProxy()` in JS space.

Note:
* The full instructions will be provided once all pieces are moved to OSS.
* Sample modules and binding setup will be provided later.

Reviewed By: RSNara

Differential Revision: D13583442

fbshipit-source-id: bb1cabd973e8a9ec59da6b145826e9ea234a96b3
2019-01-04 15:24:07 -08:00
Daniel Zlotin f3e5cce474 Use new JavaScriptCore from npm (#22231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: https://github.com/facebook/react-native/pull/22263

Reviewed By: hramos

Differential Revision: D13004499

Pulled By: DanielZlotin

fbshipit-source-id: da54bb744cedb4c6f3bda590f8c25d0ad64086ef
2018-12-27 14:51:03 -08:00
Anandraj Govindan 1d0404c4e8 Making JSI_EXPORT macro definition conditional (#22561)
Summary:
This change enables defining the macro at a more global and central location. And thereby allowing us to building this file using MSVC.
Pull Request resolved: https://github.com/facebook/react-native/pull/22561

Reviewed By: fkgozali

Differential Revision: D13529762

Pulled By: RSNara

fbshipit-source-id: c78abb26f47aba25d50305c5bc0b23b6568f1243
2018-12-27 07:29:53 -08:00
Kevin Gozali acc2ed2488 Moved TurboModule C++ core to github
Summary:
This is only the core C++ part of TurboModule - moving to github to make integration with existing NativeModules system slightly easier. Other bindings for iOS/Android are not yet ready to move.

Notes:
* TurboModules is not ready to use at the moment.
* Build configuration is not yet provided (cocoapods/.xcodeproj/gradle), just like Fabric.
* No effort was done to make this lib C++17 strictly compliant yet (there will be in the future).

Reviewed By: RSNara

Differential Revision: D13551211

fbshipit-source-id: cd3b458e6746ee9218451962ca65b1ad641a32db
2018-12-26 17:18:21 -08:00
David Vacca 79cc1468bc Fix race condition in Fabric Scheduler
Summary:
This diff fixes a race condition that was detected on "Marketplace You" production test for Android.
The race condition happens when the method ShadowTree::complete is executed concurrently from two threads (in this case this is called from Scheduller::constraintSurfaceLayout and Scheduler::uiManagerDidFinishTransaction), based on the order of execution this bug makes MountViewItems to be dispatched to the UI in the wrong order.

The root cause of the bug is in the method:

```
bool ShadowTree::complete(
    const SharedRootShadowNode &oldRootShadowNode,
    const UnsharedRootShadowNode &newRootShadowNode) const {
  newRootShadowNode->layout();
  newRootShadowNode->sealRecursive();

  auto mutations =
      calculateShadowViewMutations(*oldRootShadowNode, *newRootShadowNode);

  if (!commit(oldRootShadowNode, newRootShadowNode, mutations)) {
    return false;
  }

  emitLayoutEvents(mutations);

  if (delegate_) {
    delegate_->shadowTreeDidCommit(*this, mutations);
  }

  return true;
}
```
Notes:
- the commit method is guarded by the commitMutex_
- the shadowTreeDidCommit() method dispatches mutations instructions to the platform side.
- If there are two threads running concurrently, there is no guarantee that the shadowTreeDidCommit() is going to be called in the correct order.

The solution is to include the execution to shadowTreeDidCommit() in the same commitMutex_

Possible solutions:
1 - move the commitMutex_ out of the commit method (to the completeMethod)
2 - synchronize the call to complete method() - this is the implemented solution.
I chose this solution to make it consistent with the way Scheduler::constraintSurfaceLayout is implemented (https://fburl.com/8l49no5x)

This mechanism is very likely to change in the refactor of threading mechanism that Valentin Shergin is going to be working on January.

I would like to land this, so we can fix this bug and run another experiment in production as soon as possible.

Reviewed By: sahrens

Differential Revision: D13535587

fbshipit-source-id: bedd4d85f5569ab3733c302d1328aa48017bcaad
2018-12-26 11:15:34 -08:00
Spencer Ahrens 34ea65e3d9 tighter ContextContainer semantics
Summary:
shergin mentioned that he'd like to move away from RTTI a bit and use explicit key strings for context container instances rather than relying on the `typeid`, so this does this.

We also fatal with a useful error message if we get a collision, rather than failing silently.

Reviewed By: shergin

Differential Revision: D13384308

fbshipit-source-id: 0b06d7555b082be89e8f130c23e94be99749a7a3
2018-12-21 18:00:36 -08:00
Spencer Ahrens 089dba3842 expose contextContainer as application API
Summary: We need a way for different apps to inject dependencies or additional functionality into Fabric - ReactNativeConfig might be a special case, but I think this could clean up it's integration nicely, and I'm using this for a uitemplate cache system so we can use CompactDisk or other storage systems for caching depending on the app.

Reviewed By: mdvacca

Differential Revision: D13407287

fbshipit-source-id: 45481908434e6235850aa4d2d6b2bfb936a23be7
2018-12-21 18:00:35 -08:00
David Aurelio d8fcb7f165 Use bitfields for `YGLayout` and `YGNode`
Summary:
@public

Further heap size reductions by using bitfields in `YGLayout` and `YGNode`.

Reviewed By: SidharthGuglani

Differential Revision: D13466325

fbshipit-source-id: ddcef0a1b3822e7449fe485d99c920d54139c893
2018-12-18 08:15:09 -08:00
David Aurelio ac94e54f5a Switch storage in `YGStyle` to `CompactValue`
Summary:
@public

Switches the storage in `facebook::yoga::detail::Values` from `YGValue` to `facebook::yoga::detail::CompactValue`.
This cuts heap size for arrays of values in half.

Reviewed By: SidharthGuglani

Differential Revision: D13465586

fbshipit-source-id: 49a4d6d29a73bdd44843b1f3c57bf746050c94d6
2018-12-18 08:15:09 -08:00
David Aurelio 375311091c Decouple from storage type in `YGStyle`
Summary:
@public

The storage format of `YGValue` in `YGStyle` is an implementation detail that is going to change soon. It is only guaranteed to be assignable from, and castable to `YGValue`.
Here, we remove tight coupling from the actual implementation in React Native.

Reviewed By: shergin

Differential Revision: D13465113

fbshipit-source-id: 41dfcb90c2a1cd825a6732854bf84d4c3318d835
2018-12-18 02:47:10 -08:00
David Aurelio 0eeb94e948 Remove cast from `detail::Values` to `std::array<YGValue`
Summary:
@public

When switching to `CompactValue`, casting edges or dimensions to `std::array<YGValue, ...>` will do actual work.
In order to avoid that from happening implicitely, we remove the casting operator.

Reviewed By: SidharthGuglani

Differential Revision: D13464292

fbshipit-source-id: 217065b001a63cfa8adde715063682c583007a4d
2018-12-14 09:23:13 -08:00
David Aurelio dac59586ed Encapsulate arrays of `YGValue` within `YGStyle`
Summary:
@public

Enforce more encapsulation of arrays of `YGValue` in `YGSty;e`.
This will allow us to use `CompactValue` in `YGStyle` while (mostly) retaining API compatibility.

Reviewed By: SidharthGuglani

Differential Revision: D13452042

fbshipit-source-id: 382b1c7245c4bea4280126ab1413e7e931b62eaa
2018-12-14 09:23:13 -08:00
David Aurelio 94dd6025d3 Introduce `CompactValue`
Summary:
@public

`CompactValue` represents a `YGValue` in 32bits instead of 64. This comes at the cost of a range limitation, as one exponent bit is borrowed for the unit.

*Undefined* and *Auto* have no magnitude, and are represented as *NaN* values.

The data structure is meant to be used as a field type on `YGStyle` to save memory.

This is header-only for efficient inlining.

Reviewed By: jackerghan, aCorrado

Differential Revision: D13187211

fbshipit-source-id: 16e3ffad592e38e2493e4f7c8b952d372e449846
2018-12-14 09:23:13 -08:00
Rick Hanlon e7cf870e31 Fix textDecorationLine property
Summary:
This diff fixes a style property that was incorrectly mapped as `textDecorationLineType` in Fabric

This was correctly mapped in classic here: diffusion/FBS/browse/master/xplat/js/react-native-github/Libraries/Text/BaseText/RCTBaseTextViewManager.m;10b92f1847cdec8a3f0a996f218989766516f805$48

Reviewed By: mdvacca

Differential Revision: D13443921

fbshipit-source-id: 7fafaf2492d8c3b938f2e433a983303958e5c578
2018-12-13 14:02:15 -08:00
David Aurelio d0485b2f04 Don't use `default` in exhaustive switch
Summary:
@public
removes the `default` case from an already exhaustive switch.

Reviewed By: SidharthGuglani

Differential Revision: D13451869

fbshipit-source-id: 32727330c7fce013963f5c83c95a73b230d5c938
2018-12-13 10:42:51 -08:00
David Aurelio a816c0321c Don't pass `std::string` by pointer
Summary:
@public

Pass strings by mutable ref rather than pointer.

Reviewed By: SidharthGuglani

Differential Revision: D13439613

fbshipit-source-id: ea889abe0fe8ec44ae02f13c1d9a10c0dbfdbcf1
2018-12-13 07:16:46 -08:00
David Aurelio 206705892f Use bitfields for enum members of `YGStyle`
Summary:
@public

Puts all enum fields of `YGStyle` into bitfields. This saves 36 bytes (> 3%) per node.

Reviewed By: SidharthGuglani

Differential Revision: D13439606

fbshipit-source-id: b60a5444762041bc6f8cc5e04757034cb6893b30
2018-12-13 07:16:46 -08:00
David Aurelio bb1b80b763 Remove templates for setting/getting style properties
Summary:
@public

Replaces the `StyleProp` template with a simple setter macro / inlined getter code.

The template was introduced to replace more extensive macros that would generate function signatures, too.
Here, we keep the spirit of that change by only generating function bodies.

Reviewed By: SidharthGuglani

Differential Revision: D13439612

fbshipit-source-id: 36f6a86917d035be6891cb736d1f288d8e02f5cf
2018-12-13 07:16:46 -08:00
David Aurelio 05d90c3013 `YGNodeBoundAxisWithinMinAndMax` accepts `YGFloatOptional`
Summary:
@public

Saves some calls to `.unwrap()`

Reviewed By: SidharthGuglani

Differential Revision: D13439600

fbshipit-source-id: ce0f6bad9a0709e9d64e23d8349bc2423b9b2ad4
2018-12-13 07:16:46 -08:00