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
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
Summary:
This PR fixes#14975.
* Podspec: add InspectorInterfaces.h/cpp to the "jschelpers_legacy" subspec.
1. lint the Podspecs: `./scripts/process-podspecs.sh`
2. check that an iOS project can integrate "DevSupport" via Cocoapods again. I'll already checked it on this branch of the demo project: https://github.com/HeEAaD/Demo-ReactNative-0.47.0-rc2-Podspec-issue/tree/fix
Closes https://github.com/facebook/react-native/pull/14988
Differential Revision: D5411733
Pulled By: javache
fbshipit-source-id: bb46cf3461e0857c7508264dafa204067af182c6
Summary:
Fixed the test script to properly setup our third-party deps and tweaked the third-party specs a bit so they work correctly.
This currently works for projects using static libraries, but fails when using dynamic libraries (`--use-libraries`)
cc mhorowitz alloy
Closes https://github.com/facebook/react-native/pull/14100
Differential Revision: D5380728
Pulled By: javache
fbshipit-source-id: e78b6bd4466ebf2bf30b7e361eff10ec14b36a55
Summary:
See https://github.com/facebook/react-native/issues/14326 for the bug
this fixes. This is a pretty ugly hack to work around what I think is
a CP bug. Since the C++ dependencies are only needed to build RN
itself, and not applications, don't the conflicting headers as source
files. Instead, use preserve_paths to get them unpacked into the
source tree under Pods/<Pod>, and arrange for them to get used with
HEADER_SEARCH_PATHS. This keeps them out of the project, so they
don't get included in the header map, and other (badly structured)
projects don't get confused.
Reviewed By: javache
Differential Revision: D5254716
fbshipit-source-id: cf33dcbcc71b5247843650c33ccf4fb08378e584
Summary:
Fixes issue described #13198
Simpler, compared to #13217
Build no longer fails on not being able to find `RCTAnimation/RCTValueAnimatedNode.h`.
Closes https://github.com/facebook/react-native/pull/13785
Differential Revision: D5017734
Pulled By: javache
fbshipit-source-id: e398f74e0fbb1a8f5a43d0a80a4cd3a3587c81b3
Summary:
This will require people who use CocoaPods to update their Podfiles. You can see an example of a Podfile set up to use the Cxx bridge here: https://github.com/mhorowitz/native-navigation-boilerplate/blob/master/ios/Podfile
If this doesn't work, you can continue to use the old bridge by adding a dependency of 'BatchedBridge' to the React subspecs in your Podfile, but this will stop working once the old bridge is removed.
Reviewed By: javache
Differential Revision: D4981920
fbshipit-source-id: 7c4f3bf1c3f9af3f934f03ec003a05d0cd3cb259
Summary:
* The dev support code moved into a `DevSupport` subspec, meaning that only if the subspec is specified in the user’s Podfile will the packager client, dev menu, etc be included. This is mainly done through checks for header availability.
It also improves the weird situation where you had to specify the `RCTWebSocket` subspec if you wanted to be able to use the packager client during development.
* I removed hardcoding the release version in the podspec on release, because the podspec still relies on `package.json` when evaluating, so there’s no real point in not also getting the version number from there. This should remove any requirement to perform maintenance of the OSS release script regarding the podspec.
Closes https://github.com/facebook/react-native/pull/12602
Differential Revision: D4621021
Pulled By: ericvicenti
fbshipit-source-id: 6c208371fc40ea607809a6ab05dd3714ed9980cf
Summary:
Fixes#11272Fixes#11572Fixes#11781
The main changes here are:
* This depends on the latest CocoaPods (1.2.0). It’s currently in RC, but if I’m not mistaken a proper release is expected soon. /cc dantoml
* Adds required header search paths for the jschelpers and cxxreact subspecs.
* Makes the jschelpers and cxxreact headers private to building React Native, not visible to the user’s project.
* It uses the canonical upstream Yoga v1.0.0 podspec: https://github.com/facebook/yoga/blob/master/Yoga.podspec
* Consistent styling.
I have been able to get our app to build again using this https://github.com/artsy/emission/pull/437. The spec has some warnings, but otherwise fully passes lint.
rh389 sjmueller Could you please test with your projects?
Closes https://github.com/facebook/react-native/pull/12089
Differential Revision: D4518605
fbshipit-source-id: ecf86232d8b1af52d139eadd1acc10f5c1d42c29
Summary:
Currently the podspec copies JS files along with the associated Obj-C files (ex: PushNotifications.m and PushNotifications.js are copied together). However the packager looks at `node_modules`, not `Pods`, for the JS source files so these copied JS source files (plus JS unit tests) were always ignored and are cruft.
This is documented as a breaking change but I suspect it won't affect most (if any) configurations. For this to have been useful, you would have had to have had been running the packager under `Pods/..some path to RN../cli.js` instead of with `npm start` or `node_modules/react-native/cli.js`.
Closes https://github.com/facebook/react-native/pull/11761
Differential Revision: D4404934
fbshipit-source-id: a9f372a74f7acb962581f929647e82eae185c5ba
Summary:
Currently the master Podspec is broken because tvOS files are being included, to avoid this compile error the file is being excluded.
c92ad5f6ae
Thats the commit which introduced the breakage anything later that that will fail. Aka RN 0.41 will fail because of this.
**Test plan (required)**
Tested on new project against master
// cc ide
Closes https://github.com/facebook/react-native/pull/11667
Differential Revision: D4375453
Pulled By: ericvicenti
fbshipit-source-id: 035cdb8ef36054b40d1aaf59551cdc2e16f0cb19
Summary:
For consistency (and maybe correctness?) use an array instead of a string with spaces in it for the `exclude_paths` value in the Podspec.
Closes https://github.com/facebook/react-native/pull/11664
Differential Revision: D4374863
fbshipit-source-id: b81773f418bd46d846bb935e038d240c98c0b71a
Summary: Correct header import paths, update podspec so we point at the copy in ReactCommon (and can eventually remove the copy under React)
Reviewed By: astreet
Differential Revision: D4204501
fbshipit-source-id: e979a010092f025b2cdc289e1e5f22fc7b65a8d1
Summary:
This adds native support for `Animated.event` on iOS.
**Test plan**
Tested in the native animated UIExplorer example that it works properly like on Android.
Closes https://github.com/facebook/react-native/pull/9598
Differential Revision: D4110331
fbshipit-source-id: 15748d23d0f475f2bcd1040ca3dca33e2620f058
Summary:
Without this, `Libraries/Network/RCTNetworking.mm` is not matched,
causing a "Native module cannot be null" error when integrating into
an existing Swift iOS project.
I've tested this fix with an iOS Swift project following the
"Integration With Existing Apps" [1] tutorial and the error does
not appear.
[1] https://facebook.github.io/react-native/docs/integration-with-existing-apps.html
Closes https://github.com/facebook/react-native/pull/9904
Differential Revision: D3873011
fbshipit-source-id: d69395190d3865aa1fc87966a37981b53beea115
Summary:
Include CSSLayout headers in the same way as other project headers, ie `#import <CSSLayout/CSSLayout.h>` becomes `#import "CSSLayout.h"`. CSSLayout is not a framework or system dependency, so shouldn't (AFAIK) be included with angle brackets. Doing so breaks framework builds, such as when RN is used as a pod in a swift project.
In combination with https://github.com/facebook/css-layout/pull/217 this fixes https://github.com/facebook/react-native/issues/9014 (specifically swift cocoapods projects). There is then no need for a separate CSSLayout pod subspec.
Tests run on the RN project in isolation (with changes inside `CSSLayout` itself also applied) and against a dummy swift project with RN included as a pod.
NB: This effectively reverts https://github.com/facebook/react-native/pull/9015 and may break non-swift cocoapods projects unless https://github.com/facebook/css-layout/pull/217 is merged and synced first.
Update: As discussed with alloy and emilsjolander, wrap these imports in a preprocess
Closes https://github.com/facebook/react-native/pull/9544
Differential Revision: D3821791
Pulled By: javache
fbshipit-source-id: d27ac8be9ce560d03479b43d3db740cd196c24da
Summary:
RN imports CSSLayout files like so: `#import <CSSLayout/CSSLayout.h>`, so we need to tell CocoaPods to preserve the directory structure for CSSLayout files. This is done with the header_mappings_dir, but we want it to apply just to CSSLayout's files, hence the subspec.
Closes https://github.com/facebook/react-native/pull/9015
Differential Revision: D3621727
fbshipit-source-id: fb3603a0820ca3d6502813204ff215cf160b1955
Summary:
The subspec for `RTCAnimation` defines a `preserve_paths` attribute of `Libraries/NativeAnimation/*.js` (https://github.com/facebook/react-native/blob/master/React.podspec#L60) but there is no JavaScript file in that repository. Linting the podspec therefore fails. The fix was to simply remove `preserve_paths` for this subspec.
Closes https://github.com/facebook/react-native/pull/8626
Differential Revision: D3529959
fbshipit-source-id: b187f6ce3898493d9f6a03960caf5ec25c9e4ac2
Summary:
**Motivation**
This PR adds a subspec for the `NativeAnimation` iOS library which so one can use it with CocoaPods.
**Test plan (required)**
Tested with the code in `NativeAnimationsExample.js` and this:
```
pod 'React', :subspecs => ['Core', 'RCTAnimation'], :path => 'node_modules/react-native'
```
Closes https://github.com/facebook/react-native/pull/8487
Differential Revision: D3502970
fbshipit-source-id: 0958acdbe088da8b50a1e5e3661f27b64db329c1
Summary:
This PR adds the C++ stdlib to the linker flags and sets the C++ standard that’s used to v14.
I have tested this with my app, without it any CP build would fail unless users add those flags to the generated projects themselves.
/cc grabbou
Closes https://github.com/facebook/react-native/pull/7800
Differential Revision: D3360421
fbshipit-source-id: 0a80030dd255f073a201acc6e1c846be114c2c2a
Summary:The subspec should declare enough dependencies. Or the lint of podspec file will fail because CoaoaPods will not import necessary source on the building step.
Closes https://github.com/facebook/react-native/pull/6955
Differential Revision: D3174681
fb-gh-sync-id: 59315efaeeb949951d7ee8e55dc7c979fcea4fbf
fbshipit-source-id: 59315efaeeb949951d7ee8e55dc7c979fcea4fbf
Summary:Cocoapods requires that the version should be greater than zero. So if you have your react-native dependency pointing to the master repo it will fail when you pod install.
Closes https://github.com/facebook/react-native/pull/6381
Differential Revision: D3032151
fb-gh-sync-id: 0ba820b8e746e7f03e963f292ec8ccf55263dcc7
shipit-source-id: 0ba820b8e746e7f03e963f292ec8ccf55263dcc7
Summary:
The current versions in these files is 0.12.0, which is out of date. Better to claim no version than the wrong version, so this diff changes the versions to 0.0.0-master.
Release branches will still have the correct versions.
Closes https://github.com/facebook/react-native/pull/5241
Reviewed By: svcscm
Differential Revision: D2819277
Pulled By: javache
fb-gh-sync-id: 99d4682e5d1f571e241f306caf309b2944483909
Summary: since 0.13.2 , prepare_command in podspec would download the dependencies of react-native again when you install react-native via cocoapods with local path.
Closes https://github.com/facebook/react-native/pull/4291
Reviewed By: svcscm
Differential Revision: D2685452
Pulled By: nicklockwood
fb-gh-sync-id: b1c1a0f45897d3eb45be99db3633c899c35feb8e
Summary: Struggled for some time to figure out why CameraRoll could not (anymore, upgraded from RN 0.11 iirc) be used in a cocoapods setup. This was the cleanest way to make it work, is it a bad idea for some reason?
Closes https://github.com/facebook/react-native/pull/4230
Reviewed By: svcscm
Differential Revision: D2674063
Pulled By: nicklockwood
fb-gh-sync-id: 3d9e6a8ac1834d05ad807ff1fea1b89a724b9cc8
Summary: These need to be included while building with CocoaPods.
Closes https://github.com/facebook/react-native/pull/3753
Reviewed By: svcscm
Differential Revision: D2595296
Pulled By: tadeuzagallo
fb-gh-sync-id: f2e2ba729c92c52808ed1b7d23c31f6fa7b9d891
Summary: I found the problem with building react-native-fbsdk (https://github.com/facebook/react-native-fbsdk) libraries when I used cocoapods.
When we use the option 'header_mappings_dir = "."' , header files of React will be copied with subfolders structures, not into one folder "${PODS_ROOT}/Headers/Public/React". And we should add recursive search and write "${PODS_ROOT}/Headers/Public/React/**". However writing code in auto-generated files is not good idea.
Closes https://github.com/facebook/react-native/pull/3248
Reviewed By: @svcscm
Differential Revision: D2528021
Pulled By: @vjeux
fb-gh-sync-id: 4ea76eac4035f0bd7c5894f604f84f903714a4e3
This is an early release and there are several things that are known
not to work if you're porting your iOS app to Android.
See the Known Issues guide on the website.
We will work with the community to reach platform parity with iOS.
Summary:
AnimationExperimental is gone; remove it. The Image subspec now depends on the networking code, so we have to pull in those files. These changes were necessary to publish 0.10.0-rc to CocoaPods, so would be convenient to get them into master for 0.11.
Fixes#2354
Closes https://github.com/facebook/react-native/pull/2341
Github Author: James Ide <ide@jameside.com>
Summary:
When developing against master I want to rely on the version numbers being reasonably accurate.
Closes https://github.com/facebook/react-native/pull/1804
Github Author: James Ide <ide@jameside.com>
Summary:
This omits the devDependencies (e.g. test infra), which are intended only for people working on RN.
Part of #1737.
Closes https://github.com/facebook/react-native/pull/1803
Github Author: James Ide <ide@jameside.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Summary:
Adds a CocoaPods subspec for LinkingIOS
Discussed in issue #667
Closes https://github.com/facebook/react-native/pull/1586
Github Author: Mark Edington <medington@wanderful.com>
Test Plan:
Pull in the subspec and run a sample which calls
RCTLinkingManager.openURL(url);