Commit Graph

208 Commits

Author SHA1 Message Date
Valentin Shergin 6312d67bcb RCTAnimation & RCTLayoutAnimation were decoupled from RCTUIManager
Reviewed By: javache

Differential Revision: D5351726

fbshipit-source-id: f13e5cd47483f2d5f9b194c10ae3fb6e99e08d84
2017-07-03 16:15:50 -07:00
Pieter De Baets e2628f93b5 Rename Executor to JSExecutor
Summary:
* Cleanup some header files so we use more forward declarations
* Rename Executor to JSExecutor.h
* Move some typedefs to more appropriate locations

Reviewed By: mhorowitz

Differential Revision: D5301913

fbshipit-source-id: e75154797eb3f531d2f42a5e95409f4062b85f91
2017-06-23 17:01:25 -07:00
Marc Horowitz 4fd427e249 Remove unused folly/File.{h,cpp} from OSS React Xcode project
Summary: This fixes https://github.com/facebook/react-native/issues/14328

Reviewed By: javache

Differential Revision: D5254711

fbshipit-source-id: e9b81e537cca9d6648f44ed61acd127015d2e1f8
2017-06-15 13:05:05 -07:00
Alex Dvornikov c143313a20 Make RCTSamplingProfilerPackagerMethod not depend on RCTBridge
Reviewed By: javache

Differential Revision: D5245899

fbshipit-source-id: a99de4cbf0ddd9c8ee98cbbf438f8930a57e917c
2017-06-15 12:07:34 -07:00
Alex Dvornikov d27ff20588 Make RCTPackagerConnection not depend on RCTBridge
Reviewed By: javache

Differential Revision: D5245497

fbshipit-source-id: 3c41dca98fc39c77d4b3c8932ee2a5b84880cf8c
2017-06-15 12:07:34 -07:00
Theo Yaung ba2e486b33 Connection management
Reviewed By: javache

Differential Revision: D5171773

fbshipit-source-id: 6421739736f732e021e85474253ab0ddb3804b0a
2017-06-08 07:45:53 -07:00
David Aurelio a710f9a81e Move packager launcher scripts outside of `packager/`
Summary: in order to prepare open sourcing React Native Packager, we have to move scripts specific to React Native to a directory that will continue to exist.

Reviewed By: javache

Differential Revision: D5112193

fbshipit-source-id: eac77d0d981aecef7ee52365a6856340420a5638
2017-05-23 16:17:09 -07:00
Pieter De Baets 885856c6a1 More attempts to fix Travis CI runs
Summary:
* Add RCTBridge+Private to exported headers for unit tests
* Fix tvOS build
Closes https://github.com/facebook/react-native/pull/13840

Reviewed By: ericvicenti

Differential Revision: D5027887

Pulled By: javache

fbshipit-source-id: 7a17ee2f84eb1cb87e71373444ef25559959c24a
2017-05-10 04:32:54 -07:00
Valentin Shergin 712b1dd20a RCTUIManagerObserverCoordinator: new way to subscribe for granular notifications from UI Manager
Reviewed By: majak

Differential Revision: D4868591

fbshipit-source-id: 24a09ffa3e69dec5ce1f0a8715c7e4701d781996
2017-05-08 12:52:09 -07:00
Valentin Shergin 5058e7eb05 Several layout related helper methods of RCTShadowView was moved to new (+Layout) category.
Reviewed By: javache

Differential Revision: D4865327

fbshipit-source-id: 4df71b57433370ee09c3f1288c4d6241a33f440a
2017-05-08 11:31:20 -07:00
Pieter De Baets 1dd7bc1515 Remove RCTPackagerClientResponder references from Xcode projects
Reviewed By: ericnakagawa

Differential Revision: D5012951

fbshipit-source-id: c31732829790a46c5ff5134a6b8421ce934f41b6
2017-05-05 13:20:57 -07:00
Marc Horowitz b2f3a65eab Rename xcodeproj's so Cxx is the default
Reviewed By: javache

Differential Revision: D4981939

fbshipit-source-id: d2935aa04f30f025c6d5499604aaddf359b8eb14
2017-05-03 14:52:56 -07:00
Pieter De Baets db8efd9c4b Split off websocket related items to RCTPackagerConnection
Reviewed By: cwdick

Differential Revision: D4588557

fbshipit-source-id: 3f4176b9bab2b06cacbb06f1ff514a5f99a76d73
2017-04-20 08:32:10 -07:00
Andrew Tokarev 460e77d47d Fixing Race condition that happens with _wasBatchActive
Summary:
Issue Fix: #13485

Yet another race condition that was found by XCode's Thread Sanitizer.
Happens because wasBatchActive is read/write from multiple threads at the same time

- opened UIExplorer and see it works
- npm run test pass
- tested on own project as well

Signed CLA
Closes https://github.com/facebook/react-native/pull/13505

Differential Revision: D4906096

Pulled By: javache

fbshipit-source-id: 5d4329aafcfe9491ce0188fa1e2dd71e09b31031
2017-04-19 03:00:53 -07:00
Marc Horowitz 5e09242e26 Rename JSCSamplingProfiler to RCTJSCSamplingProfiler
Reviewed By: javache

Differential Revision: D4889427

fbshipit-source-id: 1f74416b858134ec3682b1302021131114763881
2017-04-18 13:22:01 -07:00
Douglas Lowder a97f494bf1 Add missing header to tvOS build
Summary:
**Motivation**

Without this change, unit tests and integration tests won't build and run for Apple TV.

**Test plan**

Run `scripts/objc-test-tvos.sh` after uncommenting the TEST line.
Closes https://github.com/facebook/react-native/pull/13456

Differential Revision: D4875309

Pulled By: javache

fbshipit-source-id: 9b6fa3b7107924ba0346bf8be63bba5fe45acb53
2017-04-12 16:15:15 -07:00
Pieter De Baets 5767b98f4d Add JSC utility header to RCTBridge
Reviewed By: shergin

Differential Revision: D4823509

fbshipit-source-id: 79c96d3bc183d89a5dec7da06b0a0a710d8c7dea
2017-04-07 11:16:59 -07:00
Douglas Lowder 6a81de37d4 Add YGEnums to tvOS build
Summary:
**Motivation** Fix the Apple TV build, which is broken after a recent commit.

**Test plan** Travis tvOS test script should succeed.
Closes https://github.com/facebook/react-native/pull/13284

Differential Revision: D4827053

Pulled By: ericvicenti

fbshipit-source-id: 380e8f1b32adfeea844bedc11326e5a6a755066a
2017-04-04 10:00:36 -07:00
Emil Sjolander beb559d9cf Fix xcode project file
Reviewed By: ericvicenti

Differential Revision: D4821749

fbshipit-source-id: 19730209557c58457e6cc67916e9a8cb944fb963
2017-04-03 14:33:52 -07:00
Pieter De Baets 7c9173bc9e Enable -Wimplicit-retain-self en sync warning config for all projects
Summary:
This is enforced for all of our internal iOS code and a common cause of import failures.

cc janicduplessis
Closes https://github.com/facebook/react-native/pull/13124

Differential Revision: D4765016

fbshipit-source-id: 7c8248c98bca0fa6bad24d5a52b666243375e0db
2017-03-23 15:01:34 -07:00
Pieter De Baets 9d377e98a0 Fix warnings in React.xcodeproj
Summary:
Various fixes of xcode projects and cleaning up some warnings
Closes https://github.com/facebook/react-native/pull/13109

Differential Revision: D4762652

Pulled By: lacker

fbshipit-source-id: b452976a58962439de4adecc8e703264af40cb38
2017-03-23 11:36:17 -07:00
Marc Horowitz ba149d7277 Tease apart React and RCTBatchedBridge targets
Reviewed By: javache

Differential Revision: D4679655

fbshipit-source-id: 8123488c2d50dd7cc2329b5131e99998fe1f1e2f
2017-03-21 18:31:23 -07:00
Ashwin Bharambe 95c1926193 Introduce `DeviceInfo` as a new native module
Summary:
The `UIManager` already has a lot of responsibilities and is deeply
tied with React Native's view architecture. This diff separates out a
`DeviceInfo` native module to provide information about screen dimensions and
font scale, etc.

Reviewed By: fkgozali

Differential Revision: D4713834

fbshipit-source-id: f2ee93acf876a4221c29a8c731f5abeffbb97974
2017-03-17 17:01:57 -07:00
Douglas Lowder 02a6621e23 Add systemJSCWrapper.cpp to React-tvOS target
Summary:
**Motivation**: Fix Apple TV build breakage

**Test plan**: This fixes Travis test that builds tvOS targets.
Closes https://github.com/facebook/react-native/pull/12869

Differential Revision: D4692883

fbshipit-source-id: 3babfe4ab6d80143e15410bff7cae41ada3bf09f
2017-03-10 16:30:33 -08:00
Martin Konicek a8bd4621af Try to fix tvOS and podspec builds
Summary: Closes https://github.com/facebook/react-native/pull/12866

Differential Revision: D4691348

Pulled By: ericvicenti

fbshipit-source-id: df7d611aa4ed3fed6158d2210a0403c90875b7c3
2017-03-10 13:17:18 -08:00
Theo Yaung acb9fa8f66 Refactor dependencies
Reviewed By: mkonicek

Differential Revision: D4689351

fbshipit-source-id: 35e6939379dcb6723e7749883ad9613459f9787b
2017-03-10 09:15:50 -08:00
Martin Konicek 48f30eca7e Move iOS Maps out of the GitHub repo to internal fb codebase
Summary:
MapView has been deprecated in open source for a while: http://facebook.github.io/react-native/docs/mapview.html
We still want to use it internally. Moving it away from the GitHub folder.

Reviewed By: mmmulani

Differential Revision: D4646199

fbshipit-source-id: f469971e448dbca12afe141b43fa8a2518c7d467
2017-03-08 05:01:36 -08:00
dlowder-salesforce 7f6f964e18 Add missing websocket headers to React-tvOS target
Summary:
Fix Apple TV breakage.  This should allow scripts/objc-test-tvos.sh to run normally.
Closes https://github.com/facebook/react-native/pull/12565

Differential Revision: D4612182

Pulled By: hramos

fbshipit-source-id: 77fd3eeabc6757b23e4f5efbd46e9948b61b1ab6
2017-02-24 09:45:38 -08:00
Lukas Piatkowski 0707361b00 Add a RCTPackagerClientMethod handler for pokeSamplingProfiler in DevMenu
Reviewed By: javache

Differential Revision: D4579600

fbshipit-source-id: dfdf2b6ca0690988015873add58c43faa96ab0a6
2017-02-24 08:30:50 -08:00
Ben Roth 6a14f0b449 Add RCTDevSettings module
Summary:
This decouples non-UI logic from RCTDevMenu into a new module RCTDevSettings.

**Motivation**: This allows developers to change dev settings without depending on the built-in dev menu, e.g. if they want to introduce their own UI, or have other devtools logic that doesn't depend on an action sheet.

It also introduces the RCTDevSettingsDataSource protocol for storing dev tools preferences. This could allow a developer to implement alternative behaviors, e.g. loading the settings from some other config, changing settings based on the user, deciding not to persist some settings, or something else.

The included data source implementation, RCTDevSettingsUserDefaultsDataSource, uses NSUserDefaults and is backwards compatible with the older implementation, so **no workflows or dependent code will break, and old saved settings will persist.**

The RCTDevMenu interface has not changed and is therefore also backwards-compatible, though
some methods are now deprecated.

In order to ensure that RCTDevSettings
Closes https://github.com/facebook/react-native/pull/11613

Reviewed By: mmmulani

Differential Revision: D4571773

Pulled By: javache

fbshipit-source-id: 25555d0a6eaa81f694343e079ed02439e5845fbc
2017-02-24 07:00:16 -08:00
Lukas Piatkowski ccc525c5ca Refactor iOS packager webSocket handling to resemble Android's packagerconnection
Reviewed By: javache

Differential Revision: D4572607

fbshipit-source-id: b588d6216f7b84aef5a63454d2d8978783412c7b
2017-02-23 10:03:54 -08:00
Valentin Shergin c02c78a681 Splitting `RCTRootView.m`, decoupling RCTRootContentView
Reviewed By: javache

Differential Revision: D4570067

fbshipit-source-id: 91305d0c175af135ce2f22d7992bee68c13da80e
2017-02-19 23:19:47 -08:00
Valentin Shergin e38679fbc7 Added missing files to React.xcodeproj
Reviewed By: mmmulani

Differential Revision: D4513525

fbshipit-source-id: 40700db4cc8fd8eae1f7b98855a461489adaf86a
2017-02-05 11:43:32 -08:00
Ryan Gomba 7e869b9d0a Drive any numerical prop via NativeAnimated
Summary:
In theory, we should be able to animate any non-layout property, including custom ones. While there is still work to be done on the native side to fully enable this, we should start by dropping the prop whitelist.
Closes https://github.com/facebook/react-native/pull/10658

Differential Revision: D4379031

Pulled By: ericvicenti

fbshipit-source-id: fe9c30ea101e93a8b260d7d09a909fafbb82fee6
2017-01-26 18:28:53 -08:00
Dan Caspi b50f55026a Adding support in the new RN bridge on iOS
Differential Revision: D4393955

fbshipit-source-id: e5f3fb6773908678773a5dd4fdea568bcc200336
2017-01-10 11:28:44 -08:00
Pieter De Baets c92ad5f6ae Apple TV support 4: support for input (tvOS focus engine)
Reviewed By: shergin

Differential Revision: D4333546

fbshipit-source-id: 8655070e81dbb62a80ab1f00a43ef6c2d9654618
2016-12-19 06:28:40 -08:00
Janic Duplessis 46f3ff68b6 Move headers to project section to fix archive
Summary:
Follow up to fix some issues with 59407f3660. Headers needed to be in the `project` section instead of `private` in xcode so they don't get included in the archive.

cc javache
Closes https://github.com/facebook/react-native/pull/11395

Differential Revision: D4313048

Pulled By: javache

fbshipit-source-id: 805dbbe9f149acfe780be76e99c949c450272358
2016-12-12 08:58:29 -08:00
Adam Ernst 587606987f Rename and merge files for RCTWebSocketObserver protocol
Summary: No need to have two files; merge it into one and give it an appropriate name.

Reviewed By: javache

Differential Revision: D4296716

fbshipit-source-id: 904d13c23bb8d403b8efcb60f9a4aa5df5b08972
2016-12-08 07:44:37 -08:00
Pieter De Baets 286095292f Fix RN tvOS build
Reviewed By: mkonicek

Differential Revision: D4298869

fbshipit-source-id: fd132b2c1b656707b2dc750888c09e262b503111
2016-12-08 04:13:36 -08:00
Adam Ernst 617eb309a1 Refactor reload command in React Native
Summary: Introduces an API to register a weakly-held listener for the reload (Cmd+R) command. This allows external infrastructure to hook into the reload command before the `RCTBridge` object is even created.

Reviewed By: javache

Differential Revision: D4286980

fbshipit-source-id: 51012fb8cbeb433dc880d9d98d847b07fdbb4c4f
2016-12-07 20:13:22 -08:00
Pieter De Baets 59407f3660 Redo exported headers and include paths for opensource
Summary:
Xcode really sucks, per some discussion on e1577df1fd and https://developer.apple.com/library/content/technotes/tn2215/_index.html, if you use the headers phase, and mark headers in your static library as public, they will actually end up in the final package that's built and you can't submit to the app store! This changes our xcode setup to use a copy files phase instead.

I've also changed the header include path to be $(BUILT_PRODUCTS_DIR)/include, which is added to the include path by Xcode by default, so 3rd party libraries should not be impacted by these changes anymore.

Reviewed By: mkonicek

Differential Revision: D4291607

fbshipit-source-id: 969b9ebcbeb8161f85427f8c429e198d9d0fae30
2016-12-07 15:28:29 -08:00
Emil Sjolander 7f8c2985a8 Rename directories
Reviewed By: gkassabli

Differential Revision: D4284681

fbshipit-source-id: f0c6855c2c6e4389b7867f48f72cbb697830fc5a
2016-12-07 05:14:12 -08:00
Pieter De Baets 27acb71353 Fix target configuration in React.xcodeproj
Summary: The target config inside React.xcodeproj was messed up, with source files being included in multiple or wrong targets. I went over the files in React.xcodeproj and verified that each .m file was included only once and was in the right target and .h were in the right projects.

Reviewed By: majak

Differential Revision: D4284673

fbshipit-source-id: 99af61083c6ca81311e30f0ea0045d4e7bffc20c
2016-12-06 06:28:33 -08:00
Emil Sjolander 85ac5fc354 Rename C api
Differential Revision: D4259190

fbshipit-source-id: 26c8b356ca464d4304f5f9dc4192bff10cea2dc9
2016-12-03 04:44:10 -08:00
Pieter De Baets 439092742a Fix imports in UIExplorerUnitTests
Reviewed By: bestander

Differential Revision: D4231271

fbshipit-source-id: 84f903f6b14256ed1958ad1800f128133590a3dc
2016-11-24 09:58:31 -08:00
Pieter De Baets f2a46b17d4 Replace RCTJSCWrapper with JSCWrapper from ReactCommon
Reviewed By: mhorowitz

Differential Revision: D4204516

fbshipit-source-id: 6bcb122daf2848035dfae404ee7a2e9aca0f8087
2016-11-23 11:43:48 -08:00
Pieter De Baets e1577df1fd Move all header imports to "<React/..>"
Summary:
To make React Native play nicely with our internal build infrastructure we need to properly namespace all of our header includes.

Where previously you could do `#import "RCTBridge.h"`, you must now write this as `#import <React/RCTBridge.h>`. If your xcode project still has a custom header include path, both variants will likely continue to work, but for new projects, we're defaulting the header include path to `$(BUILT_PRODUCTS_DIR)/usr/local/include`, where the React and CSSLayout targets will copy a subset of headers too. To make Xcode copy headers phase work properly, you may need to add React as an explicit dependency to your app's scheme and disable "parallelize build".

Reviewed By: mmmulani

Differential Revision: D4213120

fbshipit-source-id: 84a32a4b250c27699e6795f43584f13d594a9a82
2016-11-23 07:58:39 -08:00
David Aurelio 5db7484e8d Move `ScriptTag` and `RCTJSModulesUnbundle` to `cxxreact`
Reviewed By: javache

Differential Revision: D4213662

fbshipit-source-id: fc2ec9717c24fe77bb022a48777049f88173ebeb
2016-11-23 06:43:50 -08:00
Pieter De Baets 7c91f894ba Fix CSSLayout import hack, update podspec
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
2016-11-21 09:13:36 -08:00
Pieter De Baets c3448236da Include RCTSamplingProfiler in React-tvOS
Reviewed By: ericvicenti

Differential Revision: D4190591

fbshipit-source-id: f8c81c644ba801c27d4c9776b1e8ccaf22df6822
2016-11-16 11:58:33 -08:00
Dan Caspi 3b4ac79583 Exposing RCTDevMenuItem when not in DEV mode and adding a missing header
Reviewed By: javache

Differential Revision: D4189179

fbshipit-source-id: c9ad45b20bab884e5d0fcd17efc494fc37ab7d92
2016-11-16 07:28:32 -08:00
Andy Street ca69ea435a Update objc build to use CSSLayout in ReactCommon
Summary: Updates objc version to use the same CSSLayout files as the android version

Reviewed By: emilsjolander

Differential Revision: D4182821

fbshipit-source-id: 81f18184b539fe0ef76ea868bc067b8283c2cccb
2016-11-16 04:43:27 -08:00
Pieter De Baets 6fe977d5cc Fix missing reference to RCTLog
Reviewed By: bestander

Differential Revision: D4176714

fbshipit-source-id: 92c7ef86c9c51b828fb564606bc5de16bfe4f54f
2016-11-14 14:14:06 -08:00
Pieter De Baets 384ea330c8 Move Platform constants to RCTPlatform
Reviewed By: majak

Differential Revision: D4081849

fbshipit-source-id: bee08af2f68dcc1af424f382f960ff897ba11945
2016-10-27 04:29:00 -07:00
dlowder-salesforce 64a4c6070d Travis CI reliability fixes: preload package manager and increase tim…
Summary:
- Consolidate common code in iOS and tvOS test scripts
- Start the packager before starting tests, to improve reliability
- Increase timeout value in RCTTestRunner.m
Closes https://github.com/facebook/react-native/pull/10378

Differential Revision: D4028364

Pulled By: bestander

fbshipit-source-id: 24c2124a1c62643a02f0668b60a67b971e08d1a3
2016-10-16 15:43:44 -07:00
Alex Kotliarskyi 84eaeb0adf Add multipart response download task (2nd edition)
Reviewed By: mmmulani

Differential Revision: D3976605

fbshipit-source-id: c15cc859aa1288e831f70256566f743f4a8d9cd2
2016-10-11 12:28:42 -07:00
Ovidiu Viorel Iepure 645540809f Revert "Add multipart response download task"
Summary:
Checking whether reverting commit 69ec19c61e fixes travis builds.

Travis run: https://travis-ci.org/facebook/react-native/builds/165087391
Closes https://github.com/facebook/react-native/pull/10250

Differential Revision: D3974738

Pulled By: bestander

fbshipit-source-id: a84759b51c2ca11e953b420515dacd597181ec65
2016-10-05 09:58:37 -07:00
Douglas Lowder 8622998335 Apple TV support 2: Xcode projects and CI (scripts/objc-test.sh)
Summary:
* Motivation *

Second PR for Apple TV support.

* Test plan *

Apple TV tests have been added to scripts/objc-test.sh
Closes https://github.com/facebook/react-native/pull/10227

Differential Revision: D3974064

Pulled By: javache

fbshipit-source-id: 36dffb4517efa489e40fa713a30655d1d76ef646
2016-10-05 07:28:44 -07:00
Alex Kotliarskyi 69ec19c61e Add multipart response download task
Reviewed By: mmmulani

Differential Revision: D3940132

fbshipit-source-id: 7a6543223cea2523bedc585f890c9f64df0509ff
2016-10-04 15:13:35 -07:00
Alex Kotliarskyi e2b25c8c9d Add multipart response stream reader
Summary:
Packager can take a long time to load and the progress is usually displayed in another window (Terminal). I'm adding support for showing a UI inside React Native app for packager's progress when loading a bundle.

This is how it will work:

1. React Native sends request to packager with `Accept: multipart/mixed` header.
2. Packager will detect that header to detect that client supports progress events and will reply with `Content-Type: multipart/mixed`.
3. While building the bundle it will emit chunks with small metadata (like `{progress: 0.3}`). In the end it will send the last chunk with the content of the bundle.
4. RN runtime will be receiving the events, for each progress event it will update the UI. The last chunk will be the actual bundle which will end the download process.

This workflow is totally backwards-compatible -- normally RN doesn't set the `Accept` header.

Reviewed By: mmmulani

Differential Revision: D3845684

fbshipit-source-id: 5b3d2c5a4c6f4718d7e5de060d98f17491e82aba
2016-10-03 18:13:36 -07:00
Pieter De Baets 228f104dad Improve RCTNSErrorFromJSError
Reviewed By: adamjernst

Differential Revision: D3871146

fbshipit-source-id: 44de849852d8c00ab4589938ef317e4c8d98d7e6
2016-09-16 06:28:48 -07:00
Marc Horowitz a8cf12a932 Fix some unsafe thread behavior
Reviewed By: javache

Differential Revision: D3789293

fbshipit-source-id: 80118c7f8faf487fe35d4d83a91f023219f6bf80
2016-09-01 19:58:58 -07:00
Pieter De Baets 07553d0f1c Update React Native minimum OS version to iOS8
Reviewed By: majak

Differential Revision: D3723143

fbshipit-source-id: 482f9820370b752d937e6df7f74c33d53a0a2e7d
2016-09-01 19:43:47 -07:00
Bret Johnson 8fd2d7d17c Added way to not launch packager during CI build, as it hangs CI builds
Summary:
Change & motivation:
Added an environment variable, RCT_NO_LAUNCH_PACKAGER, that when set
Xcode not the launch the packager when building. This switch is needed
for CI builds, where launching the packager, which stays running, causes
the build to hang; port conflicts can be an issue as well. Really the
packager is only appropriate for interactive developer builds.  This
is a problem for Visual Studio Team Services where we just added
React Native CI build support with a React Native build extension and
surely a problem for all CI systems.  This fix is simple, and now if
the build machine sets RCT_NO_LAUNCH_PACKAGER globally or passes
it as an arg to xcodebuild, the packager won't launch and all is well.

Testing:
I tested by building both with & without the environment variable defined, ensuring
things work probably in both cases.  I also added support to our VSTS build ask to use
this and verified it works as expected too, when setting the variable..
Closes https://github.com/facebook/react-native/pull/6180

Differential Revision: D3764648

Pulled By: sahrens

fbshipit-source-id: b41cc06152aec271bbfdb2bd52d4b83a5f9c09a7
2016-08-24 10:13:36 -07:00
Pieter De Baets 3d6240f9a6 Implement system font caching in RCTFont
Reviewed By: majak

Differential Revision: D3662848

fbshipit-source-id: 7135c0a80c6781669e43ae9a58a26a2c85f2c827
2016-08-05 12:44:21 -07:00
Pieter De Baets c5a44b7ca3 Move font helpers to RCTFont
Reviewed By: majak

Differential Revision: D3662804

fbshipit-source-id: 2c03a094a74c617c0d6172e327bd77d23d0d44c2
2016-08-05 12:44:20 -07:00
Emil Sjolander 0df569dc7f Handle children internally in CSSLayout
Reviewed By: javache

Differential Revision: D3588205

fbshipit-source-id: 27f701a9a85cc0e86bb1d233a6bc74b529a8d4d4
2016-07-20 13:28:30 -07:00
Emil Sjolander 1af9270e45 Revamp API
Reviewed By: majak

Differential Revision: D3579423

fbshipit-source-id: 040ecab2f20216aa136ccb8a9e7e15ffa882b313
2016-07-20 08:58:59 -07:00
David Goldman 9d2e6a2f8a Add ability to customize error messages and stacks within the iOS redbox
Reviewed By: javache

Differential Revision: D3517605

fbshipit-source-id: a2efba80bbe1f6c74bf4e01f7807389962cb2463
2016-07-18 11:28:36 -07:00
Emil Sjolander 4e056e94ff Use library imports for csslayout
Reviewed By: javache

Differential Revision: D3561526

fbshipit-source-id: b1b420f52230c323d64406deb813ee104dd6f7b5
2016-07-15 04:43:40 -07:00
Emil Sjolander f22e86e18d Changed vendored folder name to match library name
Reviewed By: javache

Differential Revision: D3561358

fbshipit-source-id: 894367bf2e019e5f9fbd40d34ef2752f26645b90
2016-07-14 06:13:50 -07:00
Emil Sjolander a939f310ab Name library header same as library
Reviewed By: javache

Differential Revision: D3561336

fbshipit-source-id: fd4ccd4c731443c72252f6d20286b2772fc40a3c
2016-07-14 06:13:50 -07:00
Alex Kotliarskyi e5650560c0 Class for JS stack frames instead of dictionaries
Summary:
Currently React Native codebase treats JS stack traces as array of dictionaries.

This diff switches the Red Box to use new `RCTJSStackFrame` for internal data representation, while keeping the exposed API unchanged. The next step would be to replace the rest of manual parsing and usage of dictionaries.

The new class has ability to parse the stack from raw strings or dictionaries.

Depends on D3429031

Reviewed By: javache

Differential Revision: D3473199

fbshipit-source-id: 90d2a4f5e8e054b75c99905f35c2ee54927bb311
2016-07-11 06:13:32 -07:00
Mengjue Wang e209f2f1e9 Move Bridge functions to OSS -- RTL experiment
Summary:
Delete the bridge functions(isRTL, allowRTL()) in internal module and move to OSS.
 Create bridge for RCTI18nUtil

Reviewed By: fkgozali

Differential Revision: D3519224

fbshipit-source-id: 3853edcfcc78777d957874448117de72ae0700b5
2016-07-06 16:28:41 -07:00
Redmar Kerkhoff a589985b0b Fixes ActivityIndicatorIOS doesn't hide initially
Summary:
I used the reproducible steps as described in origin bug ticket #7987 as test plan.
This has the same contents as PR #8130 but then against master per janicduplessis request.
Closes https://github.com/facebook/react-native/pull/8134

Differential Revision: D3491126

fbshipit-source-id: a22669dc998f82b36fbe31d882d0a29f0912e2ee
2016-06-27 17:13:27 -07:00
Philipp von Weitershausen 9c47742176 Fix React.xcodeproj by adding recently added RCTI18nUtil.* files
Summary:
88c6e7a22b / D3446871 broke the OSS version of React where React.xcodeproj isn't autogenerated.

**Test plan:** UIExplorer example works again.
Closes https://github.com/facebook/react-native/pull/8288

Differential Revision: D3466246

Pulled By: javache

fbshipit-source-id: 1240b755b0df54ddfde016d0122640293e50caeb
2016-06-21 15:43:54 -07:00
Alexey Lang 6321ad486b Fix OSS tests
Reviewed By: bestander

Differential Revision: D3368572

fbshipit-source-id: 11326c21767bf7851d06f019c6aa2f8c16408d74
2016-05-31 16:43:27 -07:00
Alexey Lang abe0b349bc Implement RCTJSCWrapper
Reviewed By: tadeuzagallo

Differential Revision: D3258713

fbshipit-source-id: 418eb9d350bf3541c976b631bd9799a1c578f5e5
2016-05-31 12:58:25 -07:00
Adam Comella 486dbe4e8f iOS: Enable views to be nested within <Text>
Summary:
Previously, only Text and Image could be nested within Text. Now, any
view can be nested within Text. One restriction of this feature is
that developers must give inline views a width and a height via
the style prop.

Previously, inline Images were supported by using iOS's built-in support
for rendering images with an NSAttributedString via NSTextAttachment.
However, NSAttributedString doesn't support rendering arbitrary views.

This change adds support for nesting views within Text by creating one
NSTextAttachment per inline view. The NSTextAttachments act as placeholders.
They are set to be the size of the corresponding view. After the text is
laid out, we query the text system to find out where it has positioned each
NSTextAttachment. We then position the views to be at those locations.

This commit also contains a change in `RCTShadowText.m`
`_setParagraphStyleOnAttributedString:heightOfTallestSubview:`. It now only sets
`lineHeight`, `textAlign`, and `writingDirection` when they've actua
Closes https://github.com/facebook/react-native/pull/7304

Reviewed By: javache

Differential Revision: D3365373

Pulled By: nicklockwood

fbshipit-source-id: 66d149eb80c5c6725311e1e46d7323eec086ce64
2016-05-31 10:28:25 -07:00
Nathan Azaria 3ccd99fb53 Added RCTBundleURLProvider
Reviewed By: javache

Differential Revision: D3352568

fbshipit-source-id: fbba6771a1c581e2676bd0f81d3da62dbf21916b
2016-05-31 04:59:56 -07:00
Nick Lockwood a4b5f1bf10 Test perf effect of reverting D3269333
Reviewed By: javache

Differential Revision: D3346235

fbshipit-source-id: 2008f8fb9df5d61da59bb0067b25acd5a71f256f
2016-05-27 09:58:28 -07:00
Nick Lockwood c87b737ca1 Fixed tests
Reviewed By: bestander

Differential Revision: D3334669

fbshipit-source-id: ba0ae2ec5ea06c27d40ceed3ca8bf7a9da27dda9
2016-05-23 08:28:28 -07:00
Adam Comella fe5c0d2d06 iOS: Enable views to be nested within <Text>
Summary:
Previously, only Text and Image could be nested within Text. Now, any
view can be nested within Text. One restriction of this feature is
that developers must give inline views a width and a height via
the style prop.

Previously, inline Images were supported by using iOS's built-in support
for rendering images with an NSAttributedString via NSTextAttachment.
However, NSAttributedString doesn't support rendering arbitrary views.

This change adds support for nesting views within Text by creating one
NSTextAttachment per inline view. The NSTextAttachments act as placeholders.
They are set to be the size of the corresponding view. After the text is
laid out, we query the text system to find out where it has positioned each
NSTextAttachment. We then position the views to be at those locations.

This commit also contains a change in `RCTShadowText.m`
`_setParagraphStyleOnAttributedString:heightOfTallestSubview:`. It now only sets
`lineHeight`, `textAlign`, and `writingDirection` when they've actua
Closes https://github.com/facebook/react-native/pull/7304

Differential Revision: D3269333

Pulled By: nicklockwood

fbshipit-source-id: 2b59f1c5445a4012f9c29df9f10f5010060ea517
2016-05-17 10:43:30 -07:00
Nick Lockwood 9ee1f37bad Added native event emitter
Summary:
This is a solution for the problem I raised in https://www.facebook.com/groups/react.native.community/permalink/768218933313687/

I've added a new native base class, `RCTEventEmitter` as well as an equivalent JS class/module `NativeEventEmitter` (RCTEventEmitter.js and EventEmitter.js were taken already).

Instead of arbitrary modules sending events via `bridge.eventDispatcher`, the idea is that any module that sends events should now subclass `RCTEventEmitter`, and provide an equivalent JS module that subclasses `NativeEventEmitter`.

JS code that wants to observe the events should now observe it via the specific JS module rather than via `RCTDeviceEventEmitter` directly. e.g. to observer a keyboard event, instead of writing:

    const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
    RCTDeviceEventEmitter.addListener('keyboardWillShow', (event) => { ... });

You'd now write:

    const Keyboard = require('Keyboard');
    Keyboard.addListener('keyboardWillShow', (event) => { ... });

Within a component, you can also use the `Subscribable.Mixin` as you would previously, but instead of:

     this.addListenerOn(RCTDeviceEventEmitter, 'keyboardWillShow', ...);

Write:

    this.addListenerOn(Keyboard, 'keyboardWillShow', ...);

This approach allows the native `RCTKeyboardObserver` module to be created lazily the first time a listener is added, and to stop sending events when the last listener is removed. It also allows us to validate that the event strings being observed and omitted match the supported events for that module.

As a proof-of-concept, I've converted the `RCTStatusBarManager` and `RCTKeyboardObserver` modules to use the new system. I'll convert the rest in a follow up diff.

For now, the new `NativeEventEmitter` JS module wraps the `RCTDeviceEventEmitter` JS module, and just uses the native `RCTEventEmitter` module for bookkeeping. This allows for full backwards compatibility (code that is observing the event via `RCTDeviceEventEmitter` instead of the specific module will still work as expected, albeit with a warning). Once all legacy calls have been removed, this could be refactored to something more elegant internally, whilst maintaining the same public interface.

Note: currently, all device events still share a single global namespace, since they're really all registered on the same emitter instance internally. We should move away from that as soon as possible because it's not intuitive and will likely lead to strange bugs if people add generic events such as "onChange" or "onError" to their modules (which is common practice for components, where it's not a problem).

Reviewed By: javache

Differential Revision: D3269966

fbshipit-source-id: 1412daba850cd373020e1086673ba38ef9193050
2016-05-11 06:27:29 -07:00
Alexey Lang 033e7c80bf Support the bytecode cache for FBReactKit
Reviewed By: javache

Differential Revision: D3174040

fb-gh-sync-id: 8d1c43a55ec8764e5b51f13663613b0f7a4a581e
fbshipit-source-id: 8d1c43a55ec8764e5b51f13663613b0f7a4a581e
2016-04-21 08:59:43 -07:00
Pieter De Baets 5bbf88be5a Fix OSS project configuration
Reviewed By: bestander

Differential Revision: D3114557

fb-gh-sync-id: 7e519f6304efc4ce17e5751ef65c5b4fac2baf5f
fbshipit-source-id: 7e519f6304efc4ce17e5751ef65c5b4fac2baf5f
2016-03-30 03:12:27 -07:00
Nick Lockwood d033c45f93 Extracted rootview-specific shadowview logic into new class
Summary:It was hard to understand which parts of the shadowview API are designed to be called only on the root view, and which were applicable to any view.

This diff extracts rootview-specific logic out into a new RCTRootShadowView class.

Reviewed By: majak

Differential Revision: D3063905

fb-gh-sync-id: ef890cddfd7625fbd4bf5454314b441acdb03ac8
shipit-source-id: ef890cddfd7625fbd4bf5454314b441acdb03ac8
2016-03-21 03:21:27 -07:00
Pieter De Baets f9e81d9bcc Fix OSS iOS build
Reviewed By: majak

Differential Revision: D2943923

fb-gh-sync-id: d0a827780ee93a1e702295198c65729b1a72f045
shipit-source-id: d0a827780ee93a1e702295198c65729b1a72f045
2016-02-17 07:38:33 -08:00
Martin Kralik fff4688423 fix UIExplorer project
Summary:
I forgot to add new files manually to `React.xcodeproj` (it's not managed by buck).

public

Reviewed By: javache

Differential Revision: D2895546

fb-gh-sync-id: ed58e3505c269f5ed9433e94994471485adb2378
2016-02-03 07:10:33 -08:00
Nick Lockwood ed4478a4ff Refactor hot loading implementation on iOS
Reviewed By: milend

Differential Revision: D2795580

fb-gh-sync-id: ad33ba152e40b622b10bfa0122afd6edc28a11bf
2016-01-04 10:40:32 -08:00
Janic Duplessis 44f7a00e95 Cross platform PullToRefreshView component
Summary:
Both iOS and Android currently support some sort of native pull to refresh control but the API was very different. I tried implementing a component based on PullToRefreshViewAndroid but that works on both platforms.

I liked the idea of wrapping the ListView or ScrollView with the PullToRefreshView component and allow styling the refresh view with platform specific props if needed. I also like the fact that 'refreshing' is a controlled prop so there is no need to keep a ref to the component or to the stopRefreshing function.

It is a pretty rough start so I'm looking for feedback and ideas to improve on the API before cleaning up everything.

On iOS we could probably deprecate the onRefreshStart property of the ScrollView and implement the native stuff in a PullToRefreshViewManager. We could then add props to customize the look of the UIRefreshControl (tintColor). We could also deprecate the Android only component and remove it later.
Closes https://github.com/facebook/react-native/pull/4915

Reviewed By: svcscm

Differential Revision: D2799246

Pulled By: nicklockwood

fb-gh-sync-id: 75872c12143ddbc05cc91900ab4612e477ca5765
2016-01-04 08:00:29 -08:00
Martin Bigio 041b1c5e52 Add `RCTBundleURLProcessor` files to Xcode project
Summary: Closes https://github.com/facebook/react-native/pull/5028

Reviewed By: svcscm

Differential Revision: D2793266

Pulled By: martinbigio

fb-gh-sync-id: 6d9ca5bf0391a47d25948ce29282f21c0930db3a
2015-12-29 11:05:42 -08:00
Tadeu Zagallo 809627379b Rename RCTContextExecutor to RCTJSCExecutor
Summary:
public

Rename the executor to so it actually says something about the implementation.

Reviewed By: jspahrsummers, nicklockwood

Differential Revision: D2759688

fb-gh-sync-id: 5b1ac447e75109fbbc2ee71c804710d9926785aa
2015-12-16 02:51:28 -08:00
Tadeu Zagallo f43e864ff6 Add RCTJSCProfiler to React.xcodeproj
Summary:
public

The `RCTJSCProfiler` was created but hadn't been added to the OSS xcodeproj, add it now.

Reviewed By: mgd

Differential Revision: D2761259

fb-gh-sync-id: 3287bb48c39cd2ff1a73fd03f53f67fe95aaac4b
2015-12-15 13:39:33 -08:00
Tadeu Zagallo 2d61dfd9c1 Replace private bridge categories with private header
Summary:
public

A lot of the core modules have to use private methods in the bridge, specially
since the `RCTBatchedBridge` interface is never exposed. That was leading to a
lot of different private bridge categories spread across different modules,
which makes harder to identify which modules are affected by private API changes.

Replace all the categories with a single private header.

Reviewed By: nicklockwood

Differential Revision: D2757564

fb-gh-sync-id: 793158b9082d542b74a6094ed0db4d5dc3a88f78
2015-12-15 05:40:27 -08:00
Mark Oswald bd3cb3ae1d add quotes to handle pathnames with spaces in it
Summary:
fixes #3135
Closes https://github.com/facebook/react-native/pull/4369

Reviewed By: svcscm

Differential Revision: D2752708

Pulled By: androidtrunkagent

fb-gh-sync-id: ada11eecb6bd5b8519e30636d18aa6b8962198aa
2015-12-11 20:33:28 -08:00
Nick Lockwood 88ac40666c Replaced RegExp method parser with recursive descent
Summary:
public

This diff replaces the RegEx module method parser with a handwritten recursive descent parser that's faster and easier to maintain.

The new parser is ~8 times faster when tested on the UIManager.managerChildren() method, and uses ~1/10 as much RAM.

The new parser also supports lightweight generics, and is more tolerant of white space.

(This means that you now can – and should – use types like `NSArray<NSString *> *` for your exported properties and method arguments, instead of `NSStringArray`).

Reviewed By: jspahrsummers

Differential Revision: D2736636

fb-gh-sync-id: f6a11431935fa8acc8ac36f3471032ec9a1c8490
2015-12-10 10:12:29 -08:00
tantan 90c7ad112f add Clipboard component for ios and android
Summary:
add Clipboard component for ios and android
 ```javascript
    import Clipboard from 'react-native'

    Clipboard.get((content)=>{
          console.log('here is content in clipboard:%s',content)
    });
    var content = 'here is a string';
    Clipboard.set(content);
```
Closes https://github.com/facebook/react-native/pull/4384

Reviewed By: svcscm

Differential Revision: D2738881

Pulled By: mkonicek

fb-gh-sync-id: a06df32d1eb2824cc9ca3de9d45e4e67fd2edbc9
2015-12-09 10:04:21 -08:00
Nick Lockwood b672294858 Added RCTImageSource
Summary:
public

The +[RCTConvert UIImage:] function, while convenient, is inherently limited by being synchronous, which means that it cannot be used to load remote images, and may not be efficient for local images either. It's also unable to access the bridge, which means that it cannot take advantage of the modular image-loading pipeline.

This diff introduces a new RCTImageSource class which can be used to pass image source objects over the bridge and defer loading until later.

I've also added automatic application of the `resolveAssetSource()` function based on prop type, and fixed up the image logic in NavigatorIOS and TabBarIOS.

Reviewed By: javache

Differential Revision: D2631541

fb-gh-sync-id: 6604635e8bb5394425102487f1ee7cd729321877
2015-12-08 03:32:30 -08:00
David Aurelio a26b89f8bd Add property mapping for `borderStyle` from JS to `RCTView` (iOS)
Reviewed By: nicklockwood

Differential Revision: D2540321

fb-gh-sync-id: 57316f7b8dc734ee784179dbfde83e6034827819
2015-12-01 09:00:28 -08:00