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

110 Коммитов

Автор SHA1 Сообщение Дата
Christoph Purrer 19d65a2baf Update .podspec license information (#35245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35245

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41084913

fbshipit-source-id: a4ba31a19ffe515aa4e7c5a6e273a8cc4b6bc42d
2022-11-07 09:52:52 -08:00
Phillip Pan 982ca30de0 bump iOS and tvOS from 11.0 to 12.4 in cocoapods
Summary:
Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required

allow-large-files

Reviewed By: sammy-SC

Differential Revision: D34547333

fbshipit-source-id: a24bb09d03939a092de4198efb1aa4a44c69f718
2022-03-16 21:08:01 -07:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Héctor Ramos ae07c53d0b Resolve "fatal: not a git repository" error outside of git repositories
Summary:
CocoaPods will display a "fatal: not a git repository" when these podspecs are consumed within Facebook's internal Mercurial repository due to the reliance on `git` to obtain the current commit hash.

In these cases, the podspec is being consumed locally and the commit hash is unnecessary.

The error is removed by avoiding the use of `git` if the current working directory is not a git repository (or any of the parent directories).

Changelog:
[Internal] [iOS] - Remove CocoaPods error within Facebook's repository

Reviewed By: fkgozali

Differential Revision: D27750974

fbshipit-source-id: 99159611c580baf5526f116948c5ff60e1c02e5c
2021-04-15 13:30:31 -07:00
Sunny Luo b50b7e3a19 Update React.podspec to require cocoapods >= 1.10.1 (#31134)
Summary:
According to https://github.com/facebook/react-native/issues/30922#issuecomment-778700328
Cocoapods 1.10.1 is required to compile iOS deps (OpenSSL).

Fixes https://github.com/facebook/react-native/issues/30922#issuecomment-778700328

Changelog:
[iOS][Changed] - Update React.podspec to require cocoapods >= 1.10.1

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

Reviewed By: fkgozali

Differential Revision: D27447225

Pulled By: hramos

fbshipit-source-id: 3429250597e3eff58272dc880dbc3e7c38dcb70e
2021-03-31 12:49:40 -07:00
Peter Argany a1d626739d Delete iOS10/tvOS10 support from React Native Libraries
Summary:
allow-large-files

Changelog: [iOS] Remove iOS10/tvOS10 suppport

Similar to D19265731 (674b591809) for iOS9.

I just ran this command:
`find . -type f -exec sed -i '' 's/{ :ios => "10.0" }/{ :ios => "11.0" }/' {} +`
and then updated pods

Reviewed By: fkgozali

Differential Revision: D25693227

fbshipit-source-id: 0073d57ecbb268c52d21962cef202316857bcbd2
2021-01-11 16:46:16 -08:00
simek 2160377574 remove most of tvOS remnants from the code (#29407)
Summary:
Refs: [0.62 release](https://reactnative.dev/blog/#moving-apple-tv-to-react-native-tvos), https://github.com/facebook/react-native/issues/28706, https://github.com/facebook/react-native/issues/28743, https://github.com/facebook/react-native/issues/29018

This PR removes most of the tvOS remnants in the code. Most of the changes are related to the tvOS platform removal from `.podspec` files, tvOS specific conditionals removal (Obj-C + JS) or tvOS CI/testing pipeline related code.

In addition to the changes listed above I have removed the deprecated `Platform.isTVOS` method. I'm not sure how `Platform.isTV` method is correlated with Android TV devices support which is technically not deprecated in the core so I left this method untouched for now.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

* **[Internal] [Removed]** - remove most of tvOS remnants from the code:
  * `TVEventHandler`, `TVTouchable`, `RCTTVView`, `RCTTVRemoteHandler` and `RCTTVNavigationEventEmitter`
* **[Internal] [Removed]** - remove `TARGET_TV_OS` flag and all the usages
* **[iOS] [Removed]** - remove deprecated `Platform.isTVOS` method
* **[iOS] [Removed]** - remove deprecated and TV related props from View:
  * `isTVSelectable`, `hasTVPreferredFocus` and `tvParallaxProperties`
* **[iOS] [Removed]** - remove `BackHandler` utility implementation

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

Test Plan: Local tests (and iOS CI run) do not yield any errors, but I'm not sure how the CI pipeline would react to those changes. That is the reason why this PR is being posted as Draft. Some tweaks and code adjustment could be required.

Reviewed By: PeteTheHeat

Differential Revision: D22619441

Pulled By: shergin

fbshipit-source-id: 9aaf3840c5e8bd469c2cfcfa7c5b441ef71b30b6
2020-09-28 21:26:41 -07:00
Rachel Nabors c0d8c1db90 Updating the URLs to point at new domain name reactnative.dev
Summary:
We recently updated React Native's docs site to have its own domain reactnative.dev and needed to update the URLs in the source code

CHANGELOG:
[INTERNAL]

Reviewed By: hramos

Differential Revision: D20072842

fbshipit-source-id: 1970d9214c872a6e7abf697d99f8f5360b3b308e
2020-02-24 13:09:11 -08:00
Kevin Gozali 674b591809 iOS: Deprecate iOS 9 / tvOS 9 SDK support
Summary:
It is time to target SDK version 10.0+.

Changelog: [iOS] [Deprecated] - Deprecating support for iOS/tvOS SDK 9.x, 10.0+ is now required

Reviewed By: mdvacca

Differential Revision: D19265731

fbshipit-source-id: 93b6f9e8f61c5b36ff69e80d3f18256aa96cc2c0
2020-01-02 12:52:12 -08:00
Andres Suarez e1cfeaddd4 Move non-license comments out of license header
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: cpojer

Differential Revision: D17749100

fbshipit-source-id: edca9c73a065e9fc311109cd6efeb1f75451a55a
2019-10-15 20:12:12 -07:00
James Treanor ca9e108110 Remove 's.static_framework = true' requirement for podspec (#25816)
Summary:
As part of the fix for https://github.com/facebook/react-native/issues/25349 I added `s.static_framework = true` to each podspec in repo (see https://github.com/facebook/react-native/pull/25619#discussion_r306993309 for more context).

This was required to ensure the existing conditional compilation with `#if RCT_DEV` and `__has_include` still worked correctly when `use_frameworks!` is enabled.

However, fkgozali pointed out that it would be ideal if we didn't have this requirement as it could make life difficult for third-party libraries.

This removes the requirement by moving `React-DevSupport.podspec` and `React-RCTWebSocket.podspec` into `React-Core.podspec` as subspecs. This means the symbols are present when `React-Core.podspec` is built dynamically so `s.static_framework = true` isn't required.

This means that any `Podfile` that refers to `React-DevSupport` or `React-RCTWebSocket` will need to be updated to avoid errors.

## Changelog

I don't think this needs a changelog entry since its just a refinement of https://github.com/facebook/react-native/pull/25619.
Pull Request resolved: https://github.com/facebook/react-native/pull/25816

Test Plan:
Check `RNTesterPods` still works both with and without `use_frameworks!`:

1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.

Reviewed By: hramos

Differential Revision: D16495030

Pulled By: fkgozali

fbshipit-source-id: 2708ac9fd20cd04cb0aea61b2e8ab0d931dfb6d5
2019-07-25 11:46:43 -07:00
Mehdi Mulani 17dbf98884 Move iOS Geolocation code out from the repo
Summary:
@public
This resolves the iOS side of #20879.

Reviewed By: natestedman, cpojer

Differential Revision: D14712066

fbshipit-source-id: 88dd0ff80d3467b314cacb9349029dadca4ddf19
2019-04-02 15:36:10 -07:00
Ville Immonen 2321b3fd7f Split React.podspec into separate podspecs for each Xcode project (#23559)
Summary:
This PR implements the first part of [RFC0004: CocoaPods Support Improvements](353d44f649/proposals/0004-cocoapods-support-improvements.md), splitting the `React.podspec` into separate podspecs to more closely match the structure of Xcode projects.

The new structure aims to have one to one mapping between Xcode projects and podspecs. The only places where we differ from this mapping are:
* `React/React-DevSupport.podspec`: `DevSupport` is a part of `React.xcodeproj`, which corresponds to the `React-Core` pod. However, we can't include it in the `React-Core` pod because `DevSupport` depends on `React-RCTWebSocket`, which depends on `React-Core`. Pods may not have circular dependencies.
* The new pods under `ReactCommon/` don't have a corresponding `xcodeproj` because there are no `xcodproj` files in `ReactCommon/`. Those C++ modules are included in `React.xcodeproj`.

*Next steps (not in scope of this PR):*
- Start submitting the Podspecs to CocoaPods on a deploy (or turn the React Native repo into a spec repo): this is important in order to make the experience nicer for library consumers, so that it's not necessary to specify the local path of each Podspec in `Podfile`, you can just add `pod 'React', <version>`.
- Add `Podfile` to the default project template (I have a PR ready for this, but because of bugs related to subspecs, it's blocked on this PR)

[iOS] [Changed] - Split React.podspec into separate podspecs for each Xcode project
Pull Request resolved: https://github.com/facebook/react-native/pull/23559

Differential Revision: D14179326

Pulled By: cpojer

fbshipit-source-id: 397a9c30b6b5d24f86c790057c71f0d403f56c3d
2019-02-21 18:35:44 -08:00
Michael Diarmid 5560a47c1d Add `folly_compiler_flags` to Core subspec (#23488)
Summary:
This fixes the following iOS build error when using React via pods (using the new Xcode build system);

> project/Pods/Folly/folly/portability/Config.h:20:10: 'folly/folly-config.h' file not found

https://github.com/react-native-community/react-native-releases/issues/79#issuecomment-463628317
https://github.com/react-native-community/react-native-releases/issues/79#issuecomment-463675118
https://github.com/react-native-community/react-native-releases/issues/79#issuecomment-464117823

[iOS] [Fixed] - Fixed a "'folly/folly-config.h' file not found" build error when using React via CocoaPods
Pull Request resolved: https://github.com/facebook/react-native/pull/23488

Differential Revision: D14121296

Pulled By: cpojer

fbshipit-source-id: 5eb2ba3066aef2bc9cfb95a9172cbef921c47170
2019-02-17 15:14:11 -08:00
Alejandro Ruperez 00392ac46b Resolves #23390: cxxreact, jsi and jsiexecutor depends on DoubleConversion and glog. (#23430)
Summary:
Resolves #23390: **cxxreact**, **jsi** and **jsiexecutor** depends on **DoubleConversion** and **glog**.

This cause:
```
Undefined symbols for architecture x86_64:
  "google::LogMessage::LogMessage(char const*, int, int)", referenced from:
      std::__1::__function::__func<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1, std::__1::allocator<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1>, void ()>::operator()() in CxxNativeModule.o
      std::__1::__function::__func<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1, std::__1::allocator<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o
      std::__1::__function::__func<facebook::react::NativeToJsBridge::invokeCallback(double, folly::dynamic&&)::$_2, std::__1::allocator<facebook::react::NativeToJsBridge::invokeCallback(double, folly::dynamic&&)::$_2>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o
  "double_conversion::DoubleToStringConverter::ToShortestIeeeNumber(double, double_conversion::StringBuilder*, double_conversion::DoubleToStringConverter::DtoaMode) const", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      double_conversion::DoubleToStringConverter::ToShortest(double, double_conversion::StringBuilder*) const in JSIDynamic.o
      double_conversion::DoubleToStringConverter::ToShortestSingle(float, double_conversion::StringBuilder*) const in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIExecutor.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in MethodCall.o
  "double_conversion::DoubleToStringConverter::ToFixed(double, int, double_conversion::StringBuilder*) const", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIExecutor.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in MethodCall.o
  "google::LogMessageFatal::LogMessageFatal(char const*, int)", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      facebook::react::Instance::initializeBridge(std::__1::unique_ptr<facebook::react::InstanceCallback, std::__1::default_delete<facebook::react::InstanceCallback> >, std::__1::shared_ptr<facebook::react::JSExecutorFactory>, std::__1::shared_ptr<facebook::react::MessageQueueThread>, std::__1::shared_ptr<facebook::react::ModuleRegistry>) in Instance.o
      folly::detail::ScopeGuardImpl<facebook::react::JSBigFileString::fromPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0, true>::~ScopeGuardImpl() in JSBigString.o
      facebook::react::JSBigFileString::c_str() const in JSBigString.o
      facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      facebook::react::JSIExecutor::callNativeModules(facebook::jsi::Value const&, bool) in JSIExecutor.o
      ...
  "double_conversion::DoubleToStringConverter::ToPrecision(double, int, double_conversion::StringBuilder*) const", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIExecutor.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in MethodCall.o
  "google::LogMessage::stream()", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      std::__1::__function::__func<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1, std::__1::allocator<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1>, void ()>::operator()() in CxxNativeModule.o
      facebook::react::Instance::initializeBridge(std::__1::unique_ptr<facebook::react::InstanceCallback, std::__1::default_delete<facebook::react::InstanceCallback> >, std::__1::shared_ptr<facebook::react::JSExecutorFactory>, std::__1::shared_ptr<facebook::react::MessageQueueThread>, std::__1::shared_ptr<facebook::react::ModuleRegistry>) in Instance.o
      folly::detail::ScopeGuardImpl<facebook::react::JSBigFileString::fromPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0, true>::~ScopeGuardImpl() in JSBigString.o
      facebook::react::JSBigFileString::c_str() const in JSBigString.o
      facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      ...
  "google::LogMessage::~LogMessage()", referenced from:
      std::__1::__function::__func<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1, std::__1::allocator<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1>, void ()>::operator()() in CxxNativeModule.o
      std::__1::__function::__func<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1, std::__1::allocator<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o
      std::__1::__function::__func<facebook::react::NativeToJsBridge::invokeCallback(double, folly::dynamic&&)::$_2, std::__1::allocator<facebook::react::NativeToJsBridge::invokeCallback(double, folly::dynamic&&)::$_2>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o
  "google::LogMessageFatal::~LogMessageFatal()", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      facebook::react::Instance::initializeBridge(std::__1::unique_ptr<facebook::react::InstanceCallback, std::__1::default_delete<facebook::react::InstanceCallback> >, std::__1::shared_ptr<facebook::react::JSExecutorFactory>, std::__1::shared_ptr<facebook::react::MessageQueueThread>, std::__1::shared_ptr<facebook::react::ModuleRegistry>) in Instance.o
      folly::detail::ScopeGuardImpl<facebook::react::JSBigFileString::fromPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0, true>::~ScopeGuardImpl() in JSBigString.o
      facebook::react::JSBigFileString::c_str() const in JSBigString.o
      facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      facebook::react::JSIExecutor::callNativeModules(facebook::jsi::Value const&, bool) in JSIExecutor.o
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

[iOS] [Fixed] - Added `DoubleConversion` and `glog` to `cxxreact`, `jsi` and `jsiexecutor` subspecs in `React.podspec` file.

The goal of this PR is to have no need to fix #23390 by manually adding **DoubleConversion** and **glog** to _Link Binary With Libraries_ of **React** framework target in cocoapods project.

![captura de pantalla 2019-02-12 a las 17 12 05](https://user-images.githubusercontent.com/297950/52650102-deb25e80-2ee9-11e9-9595-f7fbd4730671.png)
Pull Request resolved: https://github.com/facebook/react-native/pull/23430

Differential Revision: D14065309

Pulled By: cpojer

fbshipit-source-id: 4318c3770c54087f198856c983f7cb73ff30000f
2019-02-13 08:39:56 -08:00
Alex M 2aa2401766 Fix broken jsiexecutor search path. (#23274)
Summary:
This resolves issue #23217.

iOS apps no longer run into missing header files for JSIExecutor.
Pull Request resolved: https://github.com/facebook/react-native/pull/23274

Differential Revision: D13941752

Pulled By: cpojer

fbshipit-source-id: 9415db4d160901386e2e926b56831be0d3ee9d2b
2019-02-04 07:45:42 -08:00
Kudo Chien a70625abd7 Upgrade folly to v2018.10.22.00 for iOS (#21976)
Summary:
Fixes #20302 (For iOS)

Note:
------

1. Checked the changes did not break CocoaPods integration.
2. The change for glog copying header into exported/ is to prevent build break for folly.
    `folly/detail/Demangle.h` will try to use libstdc++'s demangle.h. Unfortunately, glog also has a demangle.h in source code. So I copy exported headers and only search headers in exported/ folder during build.
Pull Request resolved: https://github.com/facebook/react-native/pull/21976

Reviewed By: hramos

Differential Revision: D12818131

Pulled By: fkgozali

fbshipit-source-id: b3c637d09d1b3adde0ea15c82eb56e28f846885b
2018-10-29 12:13:11 -07:00
Marc Horowitz f85692cf8f Get RN Podspec xcodeproject to compile
Summary:
This diff includes a few changes to the `React.podspec` file:
1. Introduce a `jsi` spec for code inside the `ReactCommon/jsi` folder. This depends on the JavaScriptCore framework.
2. Introduce a `jsiexecutor` spec for the code inside the `ReactCommon/jsiexecutor` folder. These files depend on files in `ReactCommon/cxxreact`, `ReactCommon/jsi`, and Folly.
3. Since RCTCxxBridge.mm now depends on `JSIExecutor`, we need to have the `CxxBridge` spec depend on the `jsiexecutor` spec.

Reviewed By: hramos

Differential Revision: D9820323

fbshipit-source-id: 0c96d027eed30ee47b6ee0d2d86cd6b1ad7a5887
2018-10-18 01:06:24 -07:00
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Héctor Ramos fe4f03517c Add missing copyright headers (#21000)
Summary:
One of our automated project tools noted that these were all missing their copyright headers.
Pull Request resolved: https://github.com/facebook/react-native/pull/21000

Differential Revision: D9721495

Pulled By: hramos

fbshipit-source-id: 6ccf0f37165a0fe16cf06bd996d615f2286101dc
2018-09-07 13:17:38 -07:00
Kevin Gozali 8bfe78c723 iOS: Support <ActivityIndicator> component
Summary: Setup for using <ActivityIndicator> component in Fabric.

Reviewed By: shergin

Differential Revision: D8107528

fbshipit-source-id: e3ba46d1538f5d5a2fa6f75639caaaa51156c452
2018-05-23 10:22:47 -07:00
Kevin Gozali 092103e752 iOS OSS: update podspec's to target iOS 9.0
Summary: A few more places to update to target iOS 9.0 (upgraded from 8.0)

Reviewed By: shergin

Differential Revision: D8108719

fbshipit-source-id: f17aa5e5aa34fdad57196202bf67a842735d4cdc
2018-05-23 06:16:00 -07:00
Kevin Gozali 0afc70b24a iOS: Introduced ComponentDescriptorFactory to provide app specific component registry
Summary: Each app has its own set of components to support, so this mechanism allows each of them to customize the set. Core library only provides the signature (.h file) without any impl.

Reviewed By: shergin

Differential Revision: D8065360

fbshipit-source-id: c123397afda678e84f1d1fa41a6393f25b2c15e1
2018-05-18 19:46:32 -07:00
Valentin Shergin e3a3999b75 Fabric: ScrollView: primitives and buck target
Summary: Trivial.

Reviewed By: fkgozali

Differential Revision: D7961870

fbshipit-source-id: 3cfd92bd441dbf516ade777e6428924e9634257a
2018-05-17 20:28:50 -07:00
Kevin Gozali 128c9343c4 iOS: fix up RNTesterPods
Summary:
A few fixes:
* missing include: folly/Optional.h
* switch folly::Optional's `has_value()` to `hasValue()` for now until folly is upgraded to newer version
* fix up import for RCTTextAttributes.h
* fix up includes for "conversions.h" to use namespaced includes

Reviewed By: mmmulani

Differential Revision: D8021149

fbshipit-source-id: d3955986d3ab6b1d9b61ac1e385767893ce57e5e
2018-05-16 14:14:41 -07:00
Kevin Gozali 42fc87eb8d remove unnecessary ExceptionManager abstraction
Reviewed By: sebmarkbage

Differential Revision: D8002124

fbshipit-source-id: 4e0bce9686549d0dd7b59b1323efd11ea168855b
2018-05-14 20:45:21 -07:00
Valentin Shergin 02c3cd4c4e Fabric/Text: text module, rawtext part
Summary: <RawText> component represents a purely regular string object in React.

Reviewed By: mdvacca

Differential Revision: D7751850

fbshipit-source-id: 54afe43e0c1ac063862f109ea07f0e7de3593573
2018-05-07 22:08:53 -07:00
Valentin Shergin 05890a5942 Fabric/Text: textlayoutmanager
Summary:
TextLayoutManager measures and renders text using iOS specific APIs (CoreText & TextKit).
By desing, only this module should contain platfrom-specific text functionality.

Reviewed By: mdvacca

Differential Revision: D7751852

fbshipit-source-id: fd6e1907df617fe5a4479ea08f207946765b3a45
2018-05-07 19:05:53 -07:00
Valentin Shergin e2287976f3 Fabric/Text: attributedstring module, the first part
Summary:
`fabric/attributedstring` is a simple, cross-platfrom, react-specific implementation of attributed string (aka spanned string).
This diff is the first part of this which contains text primitives (types) and conversions.

Reviewed By: fkgozali

Differential Revision: D7748704

fbshipit-source-id: d76e31807e5ac7ab1a16fd6ee6445c59de5b89a2
2018-05-07 18:09:06 -07:00
Hugo Sousa b92b38acf9 Remove extra space in source_files
Summary:
This was causing tvOS builds to fail because .m files weren’t being included.

 - Add `tvOS` subspec to your project with a tvOS target.
 - Build
 - Profit.

[TVOS] [BREAKING] [React.podspec] - Fix building for tvOS with CocoaPods
Closes https://github.com/facebook/react-native/pull/18812

Differential Revision: D7680224

Pulled By: hramos

fbshipit-source-id: c6c3b6fb0acd2004579d85c3f72e4edd88e26ed8
2018-04-18 17:45:47 -07:00
Kevin Gozali 2299d4cd7c iOS OSS: updated Podfile to have fabric related targets
Summary: Initial attempt to make fabric stuffs built properly with CocoaPods + RNTesterPods project. This simply includes fabric libs to the build, it doesn't change any behavior or enable fabric runtime.

Reviewed By: shergin

Differential Revision: D7626038

fbshipit-source-id: 4a80e0066cffa4478bb442fa8aefeaee6ff56ddd
2018-04-13 17:33:23 -07:00
Kevin Gozali f569b45f4c OSS: upgrade Folly 2016.09.26 => 2016.10.31
Summary:
There was a fix around folly::dynamic constructor that will be needed for Fabric work. This was done in 94e964976c (diff-7d1cb97d222ba0c863ea8a8e43b2ee2b) and luckily the release 1 month after the Folly version we used in RN already had the fix, so that we don't need to upgrade to the latest folly yet (minimizing breakages).

Tested by:
* running RNTester xcode project (ios)
* running RNTesterPods workspace via cocoapods
* building android via gradle

Reviewed By: shergin

Differential Revision: D7626037

fbshipit-source-id: cb36ba5b91ba131d4e450300bd620db657cfa1e8
2018-04-13 17:33:23 -07:00
Kevin Gozali e636eb60d7 iOS OSS: added CocoaPods setup to RNTester and fix up the podspecs
Summary:
This adds a way to test out CocoaPods build to RNTester, but as a separate project/workspace.
This also fixes the podspecs due to Fabric stuffs.

Note that this setup is meant to be run manually, not by CI (yet)

Reviewed By: mmmulani

Differential Revision: D7603823

fbshipit-source-id: 2219aa4c77f40ec07097a5c9ed4052529226618b
2018-04-12 16:11:33 -07:00
Gustav Ahlberg c787e0e252 exclude React/Fabric/ from core
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.

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

React native does not build on iOS when using Podspec environment. I tried the solution proposed in https://github.com/facebook/react-native/issues/18683 and got it to build.

Fixes https://github.com/facebook/react-native/issues/18683

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[IOS] [BUGFIX] [React.podspec] - Exclude `React/Fabric/*` from Core subspec
<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/18688

Differential Revision: D7505267

Pulled By: hramos

fbshipit-source-id: 8e7138ee966d08209a74193e418feaecceefb86a
2018-04-04 13:30:35 -07: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
Marc Horowitz 816d417189 Delete RCTBatchedBridge
Summary:
I've talked to several major community users, and they're all ok with deleting this
code.  There's several doc fixes which will make it easier for third
party developers which should land about the same time this will.

Also buried along with it is RCTJSCExecutor.

Reviewed By: javache

Differential Revision: D6880781

fbshipit-source-id: b4cb1143def6fd23a96290e478fa728adbedacd3
2018-02-05 12:02:35 -08:00
Satyajit Sahoo be56a3efee Implement Blob support for XMLHttpRequest
Summary:
This PR is a followup to https://github.com/facebook/react-native/pull/11417 and should be merged after that one is merged.

  1. Add support for creating blobs from strings, not just other blobs
  1. Add the `File` constructor which is a superset of `Blob`
  1. Add the `FileReader` API which can be used to read blobs as strings or data url (base64)
  1. Add support for uploading and downloading blobs via `XMLHttpRequest` and `fetch`
  1. Add ability to download local files on Android so you can do `fetch(uri).then(res => res.blob())` to get a blob for a local file (iOS already supported this)

  1. Clone the repo https://github.com/expo/react-native-blob-test
  1. Change the `package.json` and update `react-native` dependency to point to this branch, then run `npm install`
  1. Run the `server.js` file with `node server.js`
  1. Open the `index.common.js` file and replace `localhost` with your computer's IP address
  1. Start the packager with `yarn start` and run the app on your device

If everything went well, all tests should pass, and you should see a screen like this:

![screen shot 2017-06-08 at 7 53 08 pm](https://user-images.githubusercontent.com/1174278/26936407-435bbce2-4c8c-11e7-9ae3-eb104e46961e.png)!

Pull to rerun all tests or tap on specific test to re-run it

  [GENERAL] [FEATURE] [Blob] - Implement blob support for XMLHttpRequest
Closes https://github.com/facebook/react-native/pull/11573

Reviewed By: shergin

Differential Revision: D6082054

Pulled By: hramos

fbshipit-source-id: cc9c174fdefdfaf6e5d9fd7b300120a01a50e8c1
2018-01-26 09:17:11 -08:00
Hovhannes Safaryan 7e7d00aebe Update React.podspec for RCTText
Summary:
Some of the classes of RCTText are now in the subfolders, this will fix pod integration for texts

<!--
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!

-->

I have integrated React Native into my project with [this guide](https://facebook.github.io/react-native/docs/integration-with-existing-apps.html) and got the error `No component found for view with name RCTText`. Searching in the web did not give any useful information so I started to dig into the code and found out that there is now subfolders and pod taking only root classes. After making this change project started to compile again.

Create empty project with pods integrated add `RCTText` subspec and in `.js` file add  some `<Text>` element

Fixed `RCTText` subspec integration.
Closes https://github.com/facebook/react-native/pull/17655

Differential Revision: D6751039

Pulled By: hramos

fbshipit-source-id: f4538d1125af2b45f36e2fa535382e032dbc8f4e
2018-01-18 13:31:50 -08:00
Kevin Cassidy Jr d40db3a715 Use boost-for-react-native CocoaPod
Summary:
Use the same header-only distribution of Boost that Android and the automatic ios-install-third-party.sh script uses. Greatly speeds up `pod install`, even when the distribution was already cached.

The dependency tree looks like this:

* React
  * cxxreact subspec
    * **Boost** (versioned, 1.63.0)
    * Folly
      * **Boost** (any version, will resolve to 1.63.0 from above)

Alternative implementation of PR https://github.com/facebook/react-native/pull/16756. Fixes issue #16381.

(same as https://github.com/facebook/react-native/pull/16756)
* Install react-native via Cocoapods (or move a helloWorld react-native application over to use Cocoapods for dependency management)
* Add CxxBridge instead of BatchedBridge to your Podfile
* run pod install
* run react-native run-ios

[Add boost.podspec speed up download time & reduce size of the package](https://github.com/facebook/react-native/pull/16756)

[IOS] [BUGFIX] [third-party-podspecs] - optimize CocoaPods installation (Boost distribution)
Closes https://github.com/facebook/react-native/pull/17476

Differential Revision: D6746095

Pulled By: hramos

fbshipit-source-id: 55b2b5a698691f7fca0bf4c31c4376c2b9eb5379
2018-01-17 19:16:55 -08:00
Gene ba1d7e92e4 【iOS】fix tvOS file 'React/Base/RCTTVRemoteHandler*' included in iOS
Summary:
fix bugs

please look at the code,u will know me.

fix tvOS file 'React/Base/RCTTVRemoteHandler*' included in subspec 'React/Core' iOS

[CATEGORY] [TYPE] [LOCATION] - MESSAGE
 [IOS] [BUGFIX] [React.podspec] - fix tvOS file 'React/Base/RCTTVRemoteHandler*' included in subspec 'React/Core' iOS
Closes https://github.com/facebook/react-native/pull/16571

Differential Revision: D6418919

Pulled By: shergin

fbshipit-source-id: d05a1182314c9718447351c8d1a180ff61f21192
2017-11-27 15:48:07 -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
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
James Ide 38b96cd7bb Define `pod_target_xcconfig` for PrivateDatabase
Summary:
We don't strictly need this since all the other subspecs that use this set up the header search path for ReactCommon anyway but do it just for correctness.
Closes https://github.com/facebook/react-native/pull/16665

Differential Revision: D6241796

Pulled By: hramos

fbshipit-source-id: 19e6363e570d38f06ea970395d68b9cea7fd02ae
2017-11-04 12:56:13 -07:00
Joshua May 2a24b7b967 Adds PrivateDatabase podspec
Summary:
Resolves #16663.

Walked through the reproduction steps in #16663, but with successful build.

We can also now see the files are included in the `Pods` project:

<img width="236" alt="screen shot 2017-11-03 at 7 43 21 pm" src="https://user-images.githubusercontent.com/33126/32390596-4a06c05c-c0cf-11e7-8616-3ae547f8cca2.png">

(I noticed a subspec called `_ignore_me_subspec_for_linting_` so do we have tests for the podspec?)

[IOS] [BUGFIX] [React.podspec] - Resolves build error about missing symbols for PrivateDatabase.{cpp,h}
Closes https://github.com/facebook/react-native/pull/16664

Differential Revision: D6238178

Pulled By: hramos

fbshipit-source-id: b57007ab8c7c8bd0faf1f2f11269a7a2c28183e5
2017-11-03 16:31:31 -07:00
Pieter De Baets 1e3a8e2ed4 Remove AdSupport from React.podspec
Summary: Closes https://github.com/facebook/react-native/pull/16168

Differential Revision: D5988522

Pulled By: javache

fbshipit-source-id: ac9c393915c249038eb34c4bd4f34ece58fe7975
2017-10-05 12:32:04 -07:00
James Ide 26f6f6019b Set fishhook's header_dir to "fishhook"
Summary:
This lets us import fishhook like `<fishhook/fishhook.h>`.
Closes https://github.com/facebook/react-native/pull/16192

Differential Revision: D5971639

Pulled By: shergin

fbshipit-source-id: c46503953a08a74bdd10ed35cbd30029f1666c7d
2017-10-03 18:20:30 -07:00
Adam Comella b050b6906d BREAKING: iOS: Fix case sensitivity build warning in Xcode 8.3
Summary:
**Breaking Change Notes**

To adapt to the breaking change, app developers that are consuming React Native through CocoaPods must update their Podfile to refer to yoga with a lowercase "y". In other words:

    pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

Must be changed to (note the lowercase "y"):

    pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

**Symptom**

If you consume React Native as a CocoaPod and consume a third-party React Native module not as a CocoaPod, you will receive a `nonportable-include-path` warning in Xcode >= 8.3.

**Details**

Xcode 8.3 introduced -Wnonportable-include-path which triggers if you import a header using different casing than the path to the header on disk. This triggers when consuming React Native as a CocoaPod from a library that isn't a CocoaPod. React Native imports Yoga using paths like this:

    #import <yoga/Yoga.h>

Which means Yoga's headers are expected to be located in a directory called "yoga" with a lowercase "y". However, when React Native is a CocoaPod the Yoga headers for non-CocoaPods end up in the directory "$(BUILT_PRODUCTS_DIR)/Yoga".

To fix this such that Yoga's headers end up in "$(BUILT_PRODUCTS_DIR)/yoga" (note the lowercase "y"), I've changed Yoga's podspec name to have a lowercase "y".

**Test Plan**

Created a test app where React Native is consumed as a CocoaPod. Added the react-native-maps library to the project and configured it to not be consumed through CocoaPods. Verified that the app compiles properly without the `nonportable-include-path` warnings.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/15527

Differential Revision: D5706338

Pulled By: javache

fbshipit-source-id: 090daa2c3ebb1c66bd467e78a1e91791dbb06651
2017-08-25 04:45:06 -07:00
Emil Sjolander 878b7e42fa fishhook nwlog_legacy_v to avoid log spam on websocket reconnect
Reviewed By: mmmulani, javache

Differential Revision: D5570896

fbshipit-source-id: be98f500434bd2a0113b9abca20c9f21102c09d1
2017-08-08 08:20:08 -07:00
Pieter De Baets d188375e36 Fix missing file from cocoapods build
Summary: Closes https://github.com/facebook/react-native/pull/15213

Differential Revision: D5498556

Pulled By: javache

fbshipit-source-id: f5922617f620f76351202cc4e601d7f384fb7cfb
2017-07-26 11:21:59 -07:00
Philipp von Weitershausen ed903099b4 Add blob implementation with WebSocket integration
Summary:
This is the first PR from a series of PRs grabbou and me will make to add blob support to React Native. The next PR will include blob support for XMLHttpRequest.

I'd like to get this merged with minimal changes to preserve the attribution. My next PR can contain bigger changes.

Blobs are used to transfer binary data between server and client. Currently React Native lacks a way to deal with binary data. The only thing that comes close is uploading files through a URI.

Current workarounds to transfer binary data includes encoding and decoding them to base64 and and transferring them as string, which is not ideal, since it increases the payload size and the whole payload needs to be sent via the bridge every time changes are made.

The PR adds a way to deal with blobs via a new native module. The blob is constructed on the native side and the data never needs to pass through the bridge. Currently the only way to create a blob is to receive a blob from the server via websocket.

The PR is largely a direct port of https://github.com/silklabs/silk/tree/master/react-native-blobs by philikon into RN (with changes to integrate with RN), and attributed as such.

> **Note:** This is a breaking change for all people running iOS without CocoaPods. You will have to manually add `RCTBlob.xcodeproj` to your `Libraries` and then, add it to Build Phases. Just follow the process of manual linking. We'll also need to document this process in the release notes.

Related discussion - https://github.com/facebook/react-native/issues/11103

- `Image` can't show image when `URL.createObjectURL` is used with large images on Android

The websocket integration can be tested via a simple server,

```js
const fs = require('fs');
const http = require('http');

const WebSocketServer = require('ws').Server;

const wss = new WebSocketServer({
  server: http.createServer().listen(7232),
});

wss.on('connection', (ws) => {
  ws.on('message', (d) => {
    console.log(d);
  });

  ws.send(fs.readFileSync('./some-file'));
});
```

Then on the client,

```js
var ws = new WebSocket('ws://localhost:7232');

ws.binaryType = 'blob';

ws.onerror = (error) => {
  console.error(error);
};

ws.onmessage = (e) => {
  console.log(e.data);
  ws.send(e.data);
};
```

cc brentvatne ide
Closes https://github.com/facebook/react-native/pull/11417

Reviewed By: sahrens

Differential Revision: D5188484

Pulled By: javache

fbshipit-source-id: 6afcbc4d19aa7a27b0dc9d52701ba400e7d7e98f
2017-07-26 08:23:20 -07:00