mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
Summary: This is the couple of hacks I used after I finished #23802 in order to get fabric working on RNTester. This is inspired from prior work by kmagiera. The goal of this PR is to show others what I’m struggling with, and to eventually merge it sans hacks. - Yarn Install - Uncomment the commented out pods in RNTester's pod file - Open RNTesterPods workspace - Run App - this is only for pods, the non-pod RNTester will no longer work until updated with fabric too. - `SurfaceHostingView` & `SurfaceHostingProxyRootView` both try to start the surface immediately, this leads to a race condition due to the javascript not having loaded yet, the hack here is: 1. Swizzle the `start` method on `RCTFabricSurface` to no-op when called. 2. Add observer for `RCTJavaScriptDidLoadNotification` 3. Call private method `_startAllSurfaces` on `_surfacePresenter` in AppDelegate when we receive `RCTJavaScriptDidLoadNotification`. [General] [Added] - Use Fabric in RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/23803 Reviewed By: shergin, mdvacca Differential Revision: D14450726 Pulled By: fkgozali fbshipit-source-id: 8ae2d48634fecb60db539aaf0a2c89ba1f572c27
75 lines
3.3 KiB
Ruby
75 lines
3.3 KiB
Ruby
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
Pod::Spec.new do |spec|
|
|
spec.name = 'Folly'
|
|
spec.version = '2018.10.22.00'
|
|
spec.license = { :type => 'Apache License, Version 2.0' }
|
|
spec.homepage = 'https://github.com/facebook/folly'
|
|
spec.summary = 'An open-source C++ library developed and used at Facebook.'
|
|
spec.authors = 'Facebook'
|
|
spec.source = { :git => 'https://github.com/facebook/folly.git',
|
|
:tag => "v#{spec.version}" }
|
|
spec.module_name = 'folly'
|
|
spec.dependency 'boost-for-react-native'
|
|
spec.dependency 'DoubleConversion'
|
|
spec.dependency 'glog'
|
|
spec.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_PTHREAD=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation'
|
|
spec.source_files = 'folly/String.cpp',
|
|
'folly/Conv.cpp',
|
|
'folly/Demangle.cpp',
|
|
'folly/Format.cpp',
|
|
'folly/ScopeGuard.cpp',
|
|
'folly/Unicode.cpp',
|
|
'folly/dynamic.cpp',
|
|
'folly/json.cpp',
|
|
'folly/json_pointer.cpp',
|
|
'folly/container/detail/F14Table.cpp',
|
|
'folly/detail/Demangle.cpp',
|
|
'folly/hash/SpookyHashV2.cpp',
|
|
'folly/lang/Assume.cpp',
|
|
'folly/lang/ColdClass.cpp',
|
|
'folly/memory/detail/MallocImpl.cpp'
|
|
|
|
# workaround for https://github.com/facebook/react-native/issues/14326
|
|
spec.preserve_paths = 'folly/*.h',
|
|
'folly/container/*.h',
|
|
'folly/container/detail/*.h',
|
|
'folly/detail/*.h',
|
|
'folly/functional/*.h',
|
|
'folly/hash/*.h',
|
|
'folly/lang/*.h',
|
|
'folly/memory/*.h',
|
|
'folly/memory/detail/*.h',
|
|
'folly/portability/*.h'
|
|
spec.libraries = "stdc++"
|
|
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
|
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\"" }
|
|
|
|
spec.default_subspec = 'Default'
|
|
|
|
spec.subspec 'Default' do
|
|
# no-op
|
|
end
|
|
|
|
spec.subspec 'Fabric' do |fabric|
|
|
fabric.source_files = 'folly/portability/SysUio.cpp',
|
|
'folly/FileUtil.cpp',
|
|
'folly/SharedMutex.cpp',
|
|
'folly/concurrency/CacheLocality.cpp',
|
|
'folly/detail/Futex.cpp',
|
|
'folly/lang/SafeAssert.cpp',
|
|
'folly/synchronization/ParkingLot.cpp',
|
|
'folly/portability/Malloc.cpp'
|
|
fabric.preserve_paths = 'folly/concurrency/CacheLocality.h',
|
|
'folly/synchronization/ParkingLot.h',
|
|
'folly/synchronization/SanitizeThread.h',
|
|
'folly/system/ThreadId.h'
|
|
end
|
|
|
|
# Pinning to the same version as React.podspec.
|
|
spec.platforms = { :ios => "9.0", :tvos => "9.2" }
|
|
end |