Commit Graph

9 Commits

Author SHA1 Message Date
Kevin Gozali fb39d45ed5 C++ - better => butter
Summary:
Renaming the `better` utilities to `butter`:
- to prevent claims that this library is superior to others - it really depends on use cases
- to indicate ease of use throughout the codebase, easily spread like butter

Changelog: [C++][Changed] Renaming C++ better util to butter, used by Fabric internals

Reviewed By: JoshuaGross

Differential Revision: D33242764

fbshipit-source-id: 26dc95d9597c61ce8e66708e44ed545e0fc5cff5
2021-12-20 22:25:14 -08:00
Joshua Gross 09b9422516 Pass context through to all prop parser (core changes)
Summary:
Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state.

By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it!

Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0.

This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D29838789

fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c
2021-07-28 20:18:20 -07:00
Yedidya Feldblum 77279067f1 avoid mixing direct unlocking with lock-holders
Summary:
When using lock-holder objects, it is typically required to conduct all unlocking and relocking through them. That way, the RAII lock-holder does not attempt to unlock an unlocked mutex should the code throw after unlocking but before relocking.

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D29238721

fbshipit-source-id: 2403ce8c9e86f96b56a35a456e017486a2854c74
2021-06-29 14:38:33 -07:00
Samuel Susla fdb2bb76ec Refactor componentNameByReactViewName into separate file
Summary:
Changelog: [internal]

Extract componentNameByReactViewName to separate file so it can be used elsewhere.

Reviewed By: shergin, mdvacca

Differential Revision: D26946159

fbshipit-source-id: cf69df1f80f1c1938fc667f4666a5d3fec5a9658
2021-03-11 11:53:14 -08:00
Joshua Gross 4e243ca7a3 Fix RTL scrolling
Summary:
We recently fixed RTL scrolling in Fabric on iOS: D26608231 (https://github.com/facebook/react-native/commit/e5921f7f384af45df4f355fa3fa1b58a20a269d3)

Turns out, the mechanism for RTL scrolling on Android is completely different. It requires that content be wrapped in a "directional content view", which is `View` in LTR and `AndroidHorizontalScrollContentView` in RTL, backed by `ReactHorizontalScrollContainerView.java`.

iOS doesn't require that and just uses View and some custom logic in ScrollView itself.

In the future it would be great to align the platforms, but for now, for backwards-compat with non-Fabric and so we don't have to tear apart ScrollView.js, we codegen the AndroidHorizontalScrollContentView so it exists in C++, register the component, and stop mapping it to View explicitly in C++.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D26659686

fbshipit-source-id: 3b9c646dbdb7fe9527d24d42bdc6acb1aca00945
2021-02-25 10:09:32 -08:00
Joshua Gross b3930f935f Convert most Fabric Cxx code to use react_native_assert instead of assert
Summary:
See react_native_assert.{h,cpp}. Because of the BUCK+Android issue where NDEBUG is always defined, we use react_native_assert instead of assert to enable xplat asserts in debug/dev mode.

This migrates most of the codebase, but probably not 100%. The goal is to increase assertion coverage on Android, not to get to 100% (yet).

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D26562866

fbshipit-source-id: a7bf2055b973e1d3650ed8d68a6d02d556604af9
2021-02-19 20:52:52 -08:00
Andrew Coates 47bb3be6ce Minor code tweaks to work around a compiler bug in MSVC. (#30696)
Summary:
While pulling in additional react-native code into react-native-windows to support fabric, I hit some bugs with the MSVC compiler.  These minor changes work around those bugs and shouldn't have any functional effect on the code

## Changelog

[Internal] [Fixed] - Minor code tweaks to work around a compiler bug in MSVC.

Pull Request resolved: https://github.com/facebook/react-native/pull/30696

Test Plan: Code compiles in MSVC and clang.

Reviewed By: shergin

Differential Revision: D25830710

Pulled By: appden

fbshipit-source-id: 796bd8191ea62fe62e09dd16cc56b8edc092297f
2021-01-08 13:33:37 -08:00
David Vacca 62de5c001c Migrate AndroidProgressBarComponent to Fabric
Summary:
This diff migrates AndroidProgressBar component to Fabric

changeLog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D23227857

fbshipit-source-id: c5cbbdcc36e63226286cd714d601f0d4690496b2
2020-08-22 01:46:03 -07:00
David Vacca 3093010ea5 move fabric to ReactCommon/react/renderer
Summary:
This diff moves fabric C++ code from ReactCommon/fabric to ReactCommon/react/renderer
As part of this diff I also refactored components, codegen and callsites on CatalystApp, FB4A and venice

Script: P137350694

changelog: [internal] internal refactor

Reviewed By: fkgozali

Differential Revision: D22852139

fbshipit-source-id: f85310ba858b6afd81abfd9cbe6d70b28eca7415
2020-07-31 13:34:29 -07:00