Commit Graph
887 Commits
Author SHA1 Message Date
Lorenzo Sciandra af79164b58 [0.57.8] Bump version numbers 2018-12-13 10:23:26 +00:00
Zack SheppardandLorenzo Sciandra ba5015104d Extend reason message for RCTFatalException (#22532)
Summary:
Fixes #22530

As described in the issue, the previous behavior for the `RCTFatal` macro was to truncate the `reason` on the resulting `NSException` to 75 characters. This would ensure the reason would fit on a single line, but resulted in issues debugging errors that occurred in the wild, as many crash logging tools (like Sentry) discard the `name` value of the exception and use the `reason` as their primary identifier. At 75 characters, useful information like the location of the error would usually be truncated.

- [x] This extends the truncation threshold to 175 characters, which should be short enough to prevent full-screen-takeover length errors, but long enough to provide useful context to the error.
- [x] This adds a `userInfo` value to the resulting `NSException`. It copies over the `userInfo` from the `NSError` passed to the macro, and adds an "untruncated message" value that contains the untruncated version of the `NSException`'s reason.

[iOS] [Changed] - RCTFatalExceptions now include more information in their reason and a userInfo.

<!--

  CATEGORY may be:

  - [General]
  - [iOS]
  - [Android]

  TYPE may be:

  - [Added] for new features.
  - [Changed] for changes in existing functionality.
  - [Deprecated] for soon-to-be removed features.
  - [Removed] for now removed features.
  - [Fixed] for any bug fixes.
  - [Security] in case of vulnerabilities.

  For more detail, see https://keepachangelog.com/en/1.0.0/#how

  MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

  EXAMPLES:

  [General] [Added] - Add snapToOffsets prop to ScrollView component
  [General] [Fixed] - Fix various issues in snapToInterval on ScrollView component
  [iOS] [Fixed] - Fix crash in RCTImagePicker

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

Differential Revision: D13373469

Pulled By: cpojer

fbshipit-source-id: ac140d14ce76e1664869437c2c178bdd65ab6e0e
2018-12-12 16:59:20 +00:00
Lorenzo Sciandra 2151c30474 [0.57.7] Bump version numbers 2018-11-27 13:10:20 +00:00
Lorenzo Sciandra d5332fbad2 [0.57.6] Bump version numbers 2018-11-26 17:19:28 +00:00
Lorenzo Sciandra 44bfffb116 [0.57.5] Bump version numbers 2018-11-13 15:07:04 +00:00
Lorenzo Sciandra 468161232e [0.57.4] Bump version numbers 2018-10-25 17:52:59 +01:00
Lorenzo Sciandra 8fd5bcc888 [0.57.3] Bump version numbers 2018-10-12 12:19:21 +01:00
Lorenzo Sciandra 46bb737b98 Revert "[0.57.3] Bump version numbers"
This reverts commit 56cde24863.
2018-10-12 10:28:20 +01:00
Mike Grabowski 56cde24863 [0.57.3] Bump version numbers 2018-10-11 23:39:41 +02:00
Hector Ramos 4a440f4018 [0.57.2] Bump version numbers 2018-10-04 13:29:30 -07:00
Hector Ramos 67dca8bbf9 Revert "[0.57.2] Bump version numbers"
This reverts commit b7437639df.
2018-10-04 13:29:04 -07:00
Hector Ramos b7437639df [0.57.2] Bump version numbers 2018-10-04 11:40:58 -07:00
Hector Ramos e4607a4ec3 Revert "[0.57.2] Bump version numbers"
This reverts commit 8e810838a2.
2018-10-04 11:40:24 -07:00
Mike Grabowski 8e810838a2 [0.57.2] Bump version numbers 2018-10-04 17:01:57 +02:00
Mike Grabowski 29fb119404 Revert "[0.57.2] Bump version numbers"
This reverts commit 4aec7c953e.
2018-10-04 17:01:51 +02:00
Mike Grabowski 4aec7c953e [0.57.2] Bump version numbers 2018-10-02 14:39:35 +02:00
Mike Grabowski 63cf888161 Revert "[0.57.2] Bump version numbers"
This reverts commit aae1e296e9.
2018-10-02 14:38:01 +02:00
Mike Grabowski aae1e296e9 [0.57.2] Bump version numbers 2018-10-02 14:30:15 +02:00
Hector Ramos ba89bf4252 [0.57.1] Bump version numbers 2018-09-21 09:22:17 -07:00
Sergei DryganetsandLorenzo Sciandra 0a5eefbf29 Debug only code were leaking into release builds on iOS. (#21232)
Summary:
RCT_DEBUG is always defined - it is just rather 0 or 1 so
```#ifndef RCT_DEBUG is always true```
Pull Request resolved: https://github.com/facebook/react-native/pull/21232

Differential Revision: D9982316

Pulled By: hramos

fbshipit-source-id: 5408bfcf95a6ed2beae38217a6ad1ee43950857d
2018-09-21 15:42:06 +01:00
Jeff ThomasandLorenzo Sciandra 5f85b256cc Way to register RCT_MODULE in Plugin2.0 instead of +load
Summary:
[RFC] WIP: Way to register RCT_MODULE in Plugin2.0 instead of +load

This seemed like the simplest way to do this to register in the existing
didNotFindModule callback so that we don't have to touch any opensource code.

NOTE: The new version of this fixes the problems with dylibs, but not the -ObjC flag removal. This seems like the right call to avoid users having to implement c-functions to return their classes; instead we used objc_getClass.

Reviewed By: dshahidehpour

Differential Revision: D9112719

fbshipit-source-id: cf8df97d7c443cafa0e06a1e61bdf2612944ed87
2018-09-21 15:42:03 +01:00
Mike Grabowski 3008c3ccba [0.57.0] Bump version numbers 2018-09-12 13:21:38 +02:00
Hector Ramos 8402c97f83 [0.57.0-rc.4] Bump version numbers 2018-09-06 16:13:03 -07:00
Hector Ramos cb471c7b3e Revert "[0.57.0-rc.4] Bump version numbers"
This reverts commit 9dcc39586c.
2018-09-06 16:12:06 -07:00
Hector Ramos 9dcc39586c [0.57.0-rc.4] Bump version numbers 2018-09-06 15:28:55 -07:00
Hector Ramos 5ffa4b319b Revert "[0.57.0-rc.4] Bump version numbers"
This reverts commit 9974d4f1e7.
2018-09-06 15:28:49 -07:00
Mike Grabowski 9974d4f1e7 [0.57.0-rc.4] Bump version numbers 2018-09-03 11:07:32 +02:00
Mike Grabowski f28a6bbc44 Revert "[0.57.0-rc.4] Bump version numbers"
This reverts commit 6d4970f886.
2018-09-03 11:06:17 +02:00
Mike Grabowski 6d4970f886 [0.57.0-rc.4] Bump version numbers 2018-09-02 19:13:46 +02:00
Hector Ramos a8aa8b673c [0.57.0-rc.3] Bump version numbers 2018-08-24 14:51:24 -07:00
Hector Ramos f7fc381eda [0.57.0-rc.2] Bump version numbers 2018-08-22 14:55:35 -07:00
Hector Ramos a92bb3b06e [0.57.0-rc.1] Bump version numbers 2018-08-22 13:20:20 -07:00
Hector Ramos 2739bf45cc Revert "[0.57.0-rc.1] Bump version numbers"
This reverts commit 8cd5be67ff.
2018-08-22 13:19:59 -07:00
Hector Ramos 8cd5be67ff [0.57.0-rc.1] Bump version numbers 2018-08-22 12:54:21 -07:00
Ramanpreet NaraandLorenzo Sciandra e0df3a1a8b Gate usage of WebKit 10.0 APIs
Reviewed By: mmmulani

Differential Revision: D9362001

fbshipit-source-id: 62cde6bcc1f190c168973b173ce55c029328bfbf
2018-08-22 17:17:12 +01:00
Ramanpreet NaraandLorenzo Sciandra 959aacff73 Dynamically load WebKit
Summary:
@public

We can't dynamically link `WebKit` because doing so will impact cold start of all our Apps.

This diff includes a few changes:
 1. Weakly link the `WebKit` framework in the `ReactInternal` library, so that the compiler doesn't die when it encounters a WebKit symbol.
 2. Undo dynamic linking of WebKit in Catalyst.
 3. Undo dynamic linking of WebKit in AdsManager
 4. Before the first `WKWebView` is instantiated, dynamically load the `WebKit` framework.

The end result of these changes is that WebKit will be loaded only when it's going to be used.

Reviewed By: mmmulani

Differential Revision: D6564328

fbshipit-source-id: a45a44e774d0c61c1fb578a6fa3d16bb08f68ac9
2018-08-22 17:17:12 +01:00
Ramanpreet NaraandLorenzo Sciandra d29c2534b8 Implement 'dataDetectorTypes' prop
Summary:
When text is rendered in `WKWebView` WebKit component, the component itself can detect things like phone numbers, flight numbers, links, etc. and render them with additional functionality.

For example, when the text `apple.com` is detected, if the `link` data detector type is enabled, the web view will actually render a link that takes the user to the Apple home page.

In this diff, I implement the `dataDetectorTypes` prop. The data detector types supported are:
1. phoneNumber
1. link
1. address
1. calendarEvent
1. trackingNumber
1. flightNumber
1. lookupSuggestion

These enums are documented in the [[ https://developer.apple.com/documentation/webkit/wkdatadetectortypes | WKDataDetectorTypes docs ]].

Reviewed By: shergin

Differential Revision: D6392546

fbshipit-source-id: 4dd373f0ac52f898163cd959eeef6672e55b42a6
2018-08-22 17:17:12 +01:00
Mike Grabowski 074845106d [0.57.0-rc.0] Bump version numbers 2018-08-14 13:07:16 +02:00
Mehdi MulaniandLorenzo Sciandra 7b0774811e Correctly find rootView when RCTTouchHandler is in a RCTSurface
Summary:
@public
I'm surprised this hasn't caused an issue earlier.
RCTTouchHandler is hooked up to RCTSurfaceView which itself contains a rootView. Thus when this calculation happens, a root view is never found.
We can't assign to the root view since it created and destroyed frequently, so it makes the most sense to look for the RCTSurfaceView here and treat it as a root view.

Reviewed By: fkgozali

Differential Revision: D9296840

fbshipit-source-id: ba5320583201f9d5c0176847cc6e6087b6a6459b
2018-08-13 21:38:58 +01:00
Steven CableandLorenzo Sciandra 7ad4d23409 Check return code from malloc (#20173)
Summary:
Calls abort() in cases where malloc returns NULL.

Checking the return value from malloc is good practice and is
required to pass a [Veracode security scan](https://www.veracode.com/). This will let
developers who are required to submit their software to Veracode
use React Native.
Pull Request resolved: https://github.com/facebook/react-native/pull/20173

Differential Revision: D9235096

Pulled By: hramos

fbshipit-source-id: 9fdc97f9e84f8d4d91ae59242093907f7a81d286
2018-08-13 21:38:57 +01:00
Valentin SherginandFacebook Github Bot 9042438975 Fabric: bridge prop was removed from RCTSurface interface
Summary:
@public
We are moving away from using `RCTBridge` instance in public APIs to enable us using more performance solutions in the future.
This change also fixes "SwipeBack issue" caused by RCTSurfaceHostingProxyRootView returning nil bridge.

Reviewed By: mdvacca

Differential Revision: D9094625

fbshipit-source-id: 6bde3c54773e75ca4c0b6fd908da9d7235b5c3be
2018-08-01 15:32:01 -07:00
Will WilsonandFacebook Github Bot d0917ed4f7 Fixes react native beta 5 break
Summary: This fixes an error that shows up when building with Xcode 10 beta 5.

Reviewed By: fkgozali, dinhviethoa

Differential Revision: D9086574

fbshipit-source-id: 1d70049eafd20a85d482dca101980c71935d838e
2018-07-31 21:53:56 -07:00
Mehdi MulaniandFacebook Github Bot 3d8b83927b Use module copies in RCTBridge APIs
Summary: This array can be modified while it's being iterated, so we need to take a copy. I also found another crash and guarded against it.

Reviewed By: fkgozali

Differential Revision: D8955708

fbshipit-source-id: 76250bc5d451776e74505733c0f3c14e555fb576
2018-07-23 14:47:45 -07:00
DouglasandFacebook Github Bot 569061dd83 Suppress spurious warning about RCTCxxModule (#19880)
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

On a relatively stock / default setup of RN on iOS you'll see the warning "Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?" pop up on every launch. This change resolves that issue.

Fixes #14806 .

This supersedes PR #19794 .

Try a fresh project by following the RN iOS tutorial, and observe that there are no more warnings after making this change.

[IOS] [MINOR] [CxxBridge] - Fix "Class RCTCxxModule was not exported"
Closes https://github.com/facebook/react-native/pull/19880

Differential Revision: D8653809

Pulled By: hramos

fbshipit-source-id: c48529c2d74ddd40a90bc0e06e405078e25b72e3
2018-06-26 17:47:28 -07:00
Hoa DinhandFacebook Github Bot 746b503024 Fixed RCTAssert()
Reviewed By: zats

Differential Revision: D8529663

fbshipit-source-id: ddedf1daa153f25bc62db19b8e1ace32b4ab3201
2018-06-20 09:47:41 -07:00
Hoa DinhandFacebook Github Bot e11cdc917c Fixed RCTAssert nullability
Summary:
```
Apps/Instagram/AppLibraries/IGReactKit/IGReactKit/IGReactRouteHelpers.m:54:5: error: implicit conversion from nullable pointer 'NSString * _Nullable' to non-nullable pointer type 'NSString * _Nonnull' [-Werror,-Wnullable-to-nonnull-conversion]
    RCTAssert(!(title != nil && logoAsTitle), @"Screen navigationOptions cannot have both title and logoAsTitle.");
    ^
Apps/Instagram/AppLibraries/IGReactKit/IGReactKit/IGReactRouteHelpers.m:54:5: error: implicit conversion from nullable pointer 'NSString * _Nullable' to non-nullable pointer type 'NSString * _Nonnull' [-Werror,-Wnullable-to-nonnull-conversion]
/data/sandcastle/boxes/trunk-hg-fbobjc-fbsource/xplat/js/react-native-github/React/Base/RCTAssert.h:28:14: note: expanded from macro 'RCTAssert'
        file:@(__FILE__) lineNumber:__LINE__ description:__VA_ARGS__]; \

```

Reviewed By: zats

Differential Revision: D8509133

fbshipit-source-id: ae7027efc18716193c86fbeeec74d41d1879797f
2018-06-18 23:46:15 -07:00
Dmitry ZakharovandFacebook Github Bot 2f53573d4f Fix Modules concurrent access
Reviewed By: fkgozali

Differential Revision: D8379392

fbshipit-source-id: 72495950ea5fcf37f5b1cc3413666879dfc81e5c
2018-06-18 07:47:26 -07:00
zhongwuzwandFacebook Github Bot 17982094e5 Fix typo
Summary: Closes https://github.com/facebook/react-native/pull/19317

Differential Revision: D8061509

Pulled By: hramos

fbshipit-source-id: 4a2a066d477b090ee1568df234cfda67d5bbd0f8
2018-05-18 20:22:45 -07:00
Kevin GozaliandFacebook Github Bot 42fc87eb8d remove unnecessary ExceptionManager abstraction
Reviewed By: sebmarkbage

Differential Revision: D8002124

fbshipit-source-id: 4e0bce9686549d0dd7b59b1323efd11ea168855b
2018-05-14 20:45:21 -07:00
Peter AmmonandFacebook Github Bot 9bbe736f23 Teach JS stack-parsing regex about alternative formats
Reviewed By: adamjernst

Differential Revision: D7706535

fbshipit-source-id: 83cc2defbcad3faa6bdbf4a5b2072b9c023e1c04
2018-04-20 09:01:27 -07:00