Compare commits

...
Author SHA1 Message Date
Mike Grabowski 60cf18fad4 [0.59.1] Bump version numbers 2019-03-14 12:12:02 +01:00
Mike Grabowski 4b996da470 [Android] Fixed template build gradle error on x86_64
See https://github.com/facebook/react-native/pull/23897
2019-03-13 17:57:25 +01:00
zhongwuzwandMike Grabowski 000119dea0 Fix build error warning of Text module (#23586)
Summary:
Throw error warning when build Text module, we can add tvOS available check to remove error.

[iOS] [Fixed] - Fix build error warning of Text module
Pull Request resolved: https://github.com/facebook/react-native/pull/23586

Differential Revision: D14181198

Pulled By: cpojer

fbshipit-source-id: 6a62c831ba119ddcbc6effa0b24f22bd4588b982
2019-03-13 17:52:46 +01:00
Mike Grabowski 7c73f2bb5a [0.59.0] Bump version numbers 2019-03-12 13:42:02 +01:00
Mike Grabowski fa190bab3f Fix flow error 2019-03-12 13:24:56 +01:00
Mike Grabowski 9f5946bdc2 Fix DatePicker tests 2019-03-12 13:11:02 +01:00
Vishwesh JainkuniyaandMike Grabowski f6ca4d0a96 Add prop to configure importantForAutofill. (#22763)
Summary:
In API 26, autofill framework was introduced in Android.
Read more about Autofill at https://developer.android.com/guide/topics/text/autofill.

Now, if in case for some text input if developer wants to disable
autofill then he can take help from this `importantForAutoFill` prop
and pass `no` to it.

Also important of auto fill can be configured with this prop, like:
* `auto`: Let the Android System use its heuristics to determine if the view is important for autofill.
* `no`: This view isn't important for autofill.
* `noExcludeDescendants`: This view and its children aren't important for autofill.
* `yes`: This view is important for autofill.
* `yesExcludeDescendants`: This view is important for autofill, but its children aren't important for autofill.

Default value if `auto`.

Read more at: https://developer.android.com/guide/topics/text/autofill-optimize

Changelog:
----------
[Android] [Added] - Add prop to configure `importantForAutofill` in `TextInput`.
Pull Request resolved: https://github.com/facebook/react-native/pull/22763

Differential Revision: D14121242

Pulled By: cpojer

fbshipit-source-id: aa4360480dd19f6dde66f0409d26a41a6a318c94
2019-03-12 06:43:00 +01:00
Mike Grabowski ffa6d2921a Disable Snapshot tests for Text component on iOS
One of the cherry-picks updates snapshot for Text component. We would need to cherry-pick
other few commits to make sure the code in this branch corresponds to the image provided.

Since re-generating an image takes a lot of time, I am going to skip running tests
for Text for now.
2019-03-11 21:51:10 +01:00
Tom DuncalfandMike Grabowski f0bc491452 Remove duplicated Yoga compile sources to prevent "duplicate symbols" errors when linking using -force_load (#23823)
Summary:
This change fixes https://github.com/facebook/react-native/issues/23645.

The issue is that the `YGMarker.cpp`, `YGValue.cpp`, `YGConfig.cpp` and `log.cpp` files are already included in the Yoga compilation unit, so including these files in React's compile sources too results in "duplicate symbols" errors when loading React Native with `-force_load` (which behaves slightly differently to `-ObjC` - according to a colleague, "ObjC will scan through each object file in each library and force linking of any object file that contains Objective C code, while force_load will link every object file in a particular staticlib (regardless of whether or not the object file contains Objective C code)").

These changes seemed to be introduced by a few commits:
- D13819111 -> https://github.com/facebook/react-native/commit/43601f1a1735c59c90a73ba2dc127ec4dcfa4fa6
- D13439602 -> https://github.com/facebook/react-native/commit/b5c66a3fbe869daf56b1b29d0a69efa2d83e30ce
- D14123390-> https://github.com/facebook/react-native/commit/e8f95dc7a1a630d9e90d3e044a0ccf6c9d76f651
- D7530369 -> https://github.com/facebook/react-native/commit/95f625e151c7abbb05efcd14404c8aa9583faa83

Perhaps we need to check with the original authors/any C++ experts to confirm if this fix is correct - it compiles for me but I'm not sure what the original intention of these changes was.

[iOS] [Fixed] - Remove duplicated Yoga compile sources to prevent "duplicate symbols" errors when linking using -force_load
Pull Request resolved: https://github.com/facebook/react-native/pull/23823

Reviewed By: davidaurelio

Differential Revision: D14387657

Pulled By: hramos

fbshipit-source-id: d85221b6dc1a0377662624f4201b27222aed8219
2019-03-11 21:22:37 +01:00
zhongwuzwandMike Grabowski 456a984722 Fix image wrong scale factor when load image from file system (#23446)
Summary:
Regression, fix image load from `~/Library` not respect scale factor.
Fixes #22383 , the bug comes from [Clean up some URL path handling](https://github.com/facebook/react-native/commit/998197f444aca06cde0d5258469b3d314f8ea8b9).

[iOS] [Fixed] - Fix image wrong scale factor when load image from file system
Pull Request resolved: https://github.com/facebook/react-native/pull/23446

Differential Revision: D14099614

Pulled By: cpojer

fbshipit-source-id: eb2267b195a05eb70cdc4671536a4c1d47fb03e2
2019-03-11 21:20:02 +01:00
Sunny LuoandMike Grabowski 8d95e734bb Text: Implement textAlign justify for android O+ (#22477)
Summary:
Add textAlign justify for android O+(api level >=26)
Resolves https://github.com/facebook/react-native/issues/22475

<img src="https://user-images.githubusercontent.com/615282/49341207-35e3b980-f685-11e8-91ab-dbc19c1ee4d0.gif" width="400" />

Changelog:
----------
[Android] [Added] - Implement textAlign justify for android O+
Pull Request resolved: https://github.com/facebook/react-native/pull/22477

Differential Revision: D13512004

Pulled By: cpojer

fbshipit-source-id: e20f4976bfd957a5faeae0bbed2ff27c03023bb1
2019-03-11 21:19:23 +01:00
ericlewisandMike Grabowski caba1cb2e1 Fix crash when calling substring() on a string containing emoji. (#23609)
Summary:
Fixes #23459. It is not legal to write the character array of a std::string, and can result in undefined behavior.

[General] [Fixed] - Crash when substring intersects with emoji
Pull Request resolved: https://github.com/facebook/react-native/pull/23609

Differential Revision: D14198159

Pulled By: mdvacca

fbshipit-source-id: 71060b1b99ddab89793c98c09f99ec9974479e62
2019-03-11 21:16:21 +01:00
Mike Grabowski 370947d2b2 Bump Jest version 2019-03-11 20:17:33 +01:00
Mike Grabowski 9cb4d3f2c1 [0.59.0-rc.3] Bump version numbers 2019-02-27 22:21:55 +01:00
Héctor RamosandMike Grabowski 52cdb7cf26 React sync for revisions f24a0da...8e25ed2
Summary:
This sync includes the following changes:

- **[8e25ed20b](https://github.com/facebook/react/commit/8e25ed20b )**: Unify noop and test renderer assertion APIs (#14952) //<Andrew Clark>//
- **[870214f37](https://github.com/facebook/react/commit/870214f37 )**: Deprecate ref.setNativeProps in favor of ReactNative.setNativeProps (#14912) //<Eli White>//
- **[3989c0950](https://github.com/facebook/react/commit/3989c0950 )**: eslint-plugin-react-hooks@1.3.0 //<Dan Abramov>//
- **[1bbfbc98d](https://github.com/facebook/react/commit/1bbfbc98d )**: [ESLint] Add more cases to exhaustive-deps rule (#14930) //<Dan Abramov>//
- **[412f88296](https://github.com/facebook/react/commit/412f88296 )**: fix(eslint-plugin-react-hooks): node engine updated to version 7 because of object.entries(#14951) //<Farhad Yasir>//
- **[ba708fa79](https://github.com/facebook/react/commit/ba708fa79 )**: Remove ReactNoop.flushDeferredPri and flushUnitsOfWork (#14934) //<Andrew Clark>//
- **[920b0bbb3](https://github.com/facebook/react/commit/920b0bbb3 )**: [scheduler] Pass didTimeout argument to callbacks (#14931) //<Andrew Clark>//
- **[f99fca3cb](https://github.com/facebook/react/commit/f99fca3cb )**: Fix sample ESLint configuration (#14926) //<Matt Thomson>//
- **[22bb94764](https://github.com/facebook/react/commit/22bb94764 )**: Release eslint-plugin-react-hooks@1.2.0 //<Dan Abramov>//
- **[a77bbf1a1](https://github.com/facebook/react/commit/a77bbf1a1 )**: [ESLint] Warn against assignments from inside Hooks (#14916) //<Dan Abramov>//
- **[219ce8a9c](https://github.com/facebook/react/commit/219ce8a9c )**: Fix tracing fixture (#14917) //<Dan Abramov>//
- **[8c1966590](https://github.com/facebook/react/commit/8c1966590 )**: Release 16.8.3 //<Dan Abramov>//
- **[7de4d2391](https://github.com/facebook/react/commit/7de4d2391 )**: Fix UMD builds by re-exporting the scheduler priorities (#14914) //<Dan Abramov>//
- **[d0318fb3f](https://github.com/facebook/react/commit/d0318fb3f )**: Updating copyright headers, dropping the year (#14893) //<Nathan Hunzaker>//
- **[f978d5fde](https://github.com/facebook/react/commit/f978d5fde )**: Fix warning message for new setNativeProps method. on -> with (#14909) //<Eli White>//
- **[b0f45c0fc](https://github.com/facebook/react/commit/b0f45c0fc )**: Adding ReactNative.setNativeProps that takes a ref (#14907) //<Eli White>//
- **[4f4aa69f1](https://github.com/facebook/react/commit/4f4aa69f1 )**: Adding setNativeProps tests for NativeMethodsMixin (#14901) //<Eli White>//
- **[b96b61dc4](https://github.com/facebook/react/commit/b96b61dc4 )**: Use the canonical nativeTag for Fabric's setNativeProps (#14900) //<Eli White>//
- **[dab2fdbbb](https://github.com/facebook/react/commit/dab2fdbbb )**: Add eslint-plugin-react-hooks/exhaustive-deps rule to check stale closure dependencies (#14636) //<Dan Abramov>//
- **[1493abd7e](https://github.com/facebook/react/commit/1493abd7e )**: Deleted empty App.css (#14149) //<Josh R>//
- **[13645d224](https://github.com/facebook/react/commit/13645d224 )**: Deal with fallback content in Partial Hydration (#14884) //<Sebastian Markbåge>//
- **[c506ded3b](https://github.com/facebook/react/commit/c506ded3b )**: Don't discard render phase state updates with the eager reducer optimization (#14852) //<Dan Abramov>//
- **[0e67969cb](https://github.com/facebook/react/commit/0e67969cb )**: Prompt to include UMD build artifact links in GitHub release (#14864) //<Brian Vaughn>//
- **[fad0842fd](https://github.com/facebook/react/commit/fad0842fd )**: Release scripts documentation (#14863) //<Brian Vaughn>//
- **[ab7a67b1d](https://github.com/facebook/react/commit/ab7a67b1d )**: Fix react-dom/server context leaks when render stream destroyed early (#14706) //<overlookmotel>//
- **[3e5556043](https://github.com/facebook/react/commit/3e5556043 )**: Release 16.8.2 //<Dan Abramov>//
- **[dfabb77a9](https://github.com/facebook/react/commit/dfabb77a9 )**: Include another change in 16.8.2 //<Dan Abramov>//
- **[c555c008b](https://github.com/facebook/react/commit/c555c008b )**: Include component stack in 'act(...)' warning (#14855) //<Sunil Pai>//
- **[ff188d666](https://github.com/facebook/react/commit/ff188d666 )**: Add React 16.8.2 changelog (#14851) //<Dan Abramov>//
- **[c4d8ef643](https://github.com/facebook/react/commit/c4d8ef643 )**: Fix typo in code comment (#14836) //<Deniz Susman>//
- **[08e955435](https://github.com/facebook/react/commit/08e955435 )**: Statically enable suspense/partial hydration flag in www (#14842) //<Sebastian Markbåge>//
- **[0e4135e8c](https://github.com/facebook/react/commit/0e4135e8c )**: Revert "[ShallowRenderer] Queue/rerender on dispatched action after render component with hooks (#14802)" (#14839) //<Dan Abramov>//
- **[6d4038f0a](https://github.com/facebook/react/commit/6d4038f0a )**: [ShallowRenderer] Queue/rerender on dispatched action after render component with hooks (#14802) //<Rodrigo Ribeiro>//
- **[fa6205d52](https://github.com/facebook/react/commit/fa6205d52 )**: Special case crossOrigin for SVG image elements (#14832) //<Brandon Dail>//
- **[c6bee765b](https://github.com/facebook/react/commit/c6bee765b )**: Remove false positive warning and add TODOs about `current` being non-null (#14821) //<DanAbramov>//
- **[3ae94e188](https://github.com/facebook/react/commit/3ae94e188 )**: Fix ignored sync work in passive effects (#14799) //<Dan Abramov>//
- **[f3a14951a](https://github.com/facebook/react/commit/f3a14951a )**: Partial Hydration (#14717) //<Sebastian Markbåge>//

Changelog:

[GENERAL] [Changed] React sync for revisions f24a0da...22bb947

Reviewed By: gaearon

Differential Revision: D14160361

fbshipit-source-id: fffdc922f3ee5dfeeee656a8f213a6d3c03e8481
2019-02-27 21:24:27 +01:00
Eric LewisandMike Grabowski c1392c2ff3 Toggle secureTextEntry cursor spacing (#23524)
Summary:
This is a fix for #5859, based on the feedback in #18587. Instead of using `didSetProps` it uses a setter. I will also note that setting to `nil` no longer works (crashes) so setting it to a blank string then back to the original works fine.

[iOS] [Fixed] - Toggling secureTextEntry correctly places cursor.
Pull Request resolved: https://github.com/facebook/react-native/pull/23524

Differential Revision: D14143028

Pulled By: cpojer

fbshipit-source-id: 5f3203d56b1329eb7359465f8ab50eb4f4fa5507
2019-02-27 21:22:31 +01:00
Wei YangandMike Grabowski 8e5eb6389f add talkback navigation support for links and header (#22447)
Summary:
1. add role description for heading
2. add talkback navigation support for link and header

Fixes #22440
Pull Request resolved: https://github.com/facebook/react-native/pull/22447

Differential Revision: D14205822

Pulled By: cpojer

fbshipit-source-id: 86bfc3bfc851f3544b1962012abaf8d1a357a9d2
2019-02-27 21:22:14 +01:00
Mike LambertandMike Grabowski 2b7346f4b3 Fix two bugs with Location when not using ACCESS_FINE_LOCATION (#10291)
Summary:
Fix two bugs with Location when not using ACCESS_FINE_LOCATION:
- If we request highAccuracy=false, because we don't have ACCESS_FINE_LOCATION, but we don't have access to the NETWORK_PROVIDER...then the code should not trigger a SecurityException because it fell-back to using GPS_PROVIDER (which we don't have permission for)
- If the device is pre-lollipop, and doesn't have a provider, we should detect this properly instead of letting the pre-lollipop code raise a SecurityException.

Unfortunately, SecurityExceptions cannot be caught by the calling JS code. But I am not fixing that one here, instead choosing to fix/obviate the SecurityExceptions altogether.
Pull Request resolved: https://github.com/facebook/react-native/pull/10291

Differential Revision: D4163659

Pulled By: cpojer

fbshipit-source-id: 18bb4ee7401bc4eac4fcc97341fc2b3a2a0957c9
2019-02-27 21:21:48 +01:00
Nate HunzakerandMike Grabowski d7c4c37f09 Use existing character set in POST body when possible (#23603)
Summary:
This commit fixes a bug introduced in a previous attempt (https://github.com/facebook/react-native/pull/23580) to address an issue where okhttp appended `charset=utf-8` to the Content-Type header when otherwise not specified.

In that commit, I converted all characters to UTF-8, however it should instead use an existing encoding when possible.

Related issues:
https://github.com/facebook/react-native/issues/8237#issuecomment-466304854

[Android][fixed] - Respect existing character set when specified in fetch() POST request
Pull Request resolved: https://github.com/facebook/react-native/pull/23603

Differential Revision: D14191750

Pulled By: hramos

fbshipit-source-id: 11c1bfd98ccd33cd8e54ea426285b7d2ce9c2d7c
2019-02-27 21:21:39 +01:00
Nate HunzakerandMike Grabowski 4cad737315 Prevent okhttp from adding ;charset=utf8 to ContentType Header (#23580)
Summary:
Before this commit, `fetch()` calls append `"charset=utf8"` to the `Content-Type` header on Android (and not on iOS). This is because of an implementation detail in the okhttp library. This means that you can make a call on the JavaScript side like:

```javascript
let body = JSON.stringify({ key: "value" });

let headers = {
  "Content-Type": "application/json"
};

fetch("http://10.0.2.2:3000", { method: "POST", body, headers });
```

However the resulting request appends the utf8 character:

```
POST - 13:34:32:
  content-type: application/json; charset=utf-8
  content-length: 15
  host: 10.0.2.2:3000
  connection: Keep-Alive
  accept-encoding: gzip
  user-agent: okhttp/3.12.1
```

Passing byte array into the RequestBody avoids this, as recommended by a maintainer of okhttp:

https://github.com/square/okhttp/issues/2099#issuecomment-366757161

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

[Android][fixed] - Prevent fetch() POST requests on Android from appending `charset=utf-8` to `Content-Type` header.
Pull Request resolved: https://github.com/facebook/react-native/pull/23580

Differential Revision: D14180849

Pulled By: cpojer

fbshipit-source-id: b84cadf83361331a9f64d1ff5f2e6399a55527a6
2019-02-27 21:21:34 +01:00
David VaccaandMike Grabowski fee5031748 Fix IllegalArgumentException when creating CookieManager
Summary:
This prevents this https://bugs.chromium.org/p/chromium/issues/detail?id=559720 to crash the app.
When using this fix the webView will not function correctly

More details about the bug https://bugs.chromium.org/p/chromium/issues/detail?id=559720

Reviewed By: fkgozali

Differential Revision: D14181851

fbshipit-source-id: 5a8c149df82a7373fe8b5b32006f034868532485
2019-02-27 21:21:25 +01:00
DulmandakhandMike Grabowski fbf039b126 add nullable annotations to some ViewManager methods (#23610)
Summary:
Add nullable annotations to BaseViewManager and ViewManager methods. This will improve Kotlin developer experience and help Android Studio to offer better autocomplete.

[Android] [Changed] - add nullable annotations to BaseViewManager and ViewManager methods. Might break ViewManagers in Kotlin.
Pull Request resolved: https://github.com/facebook/react-native/pull/23610

Differential Revision: D14198630

Pulled By: mdvacca

fbshipit-source-id: c596c88254e1d02f0af233a466f685200fac8917
2019-02-27 21:16:10 +01:00
Mikael SandandMike Grabowski f9097017de Don't reconnect inspector if connection refused (#22625)
Summary:
(Together with a pr to react-devtools) Fixes https://github.com/facebook/react-native/issues/21030

[iOS] [Fixed] - Fix infinite retry loop of inspector
Pull Request resolved: https://github.com/facebook/react-native/pull/22625

Differential Revision: D14169392

Pulled By: hramos

fbshipit-source-id: 2e301fd9d458598b62399fc61a9859ad29928483
2019-02-27 21:15:46 +01:00
DulmandakhandMike Grabowski 52e51368eb ReactTextView extends AppCompatTextView (#23321)
Summary:
Google recommends to use AppCompat widgets, and this PR changes ReactTextView to extend AppCompatTextView.

[Android] [Changed] - ReactTextView extends AppCompatTextView
Pull Request resolved: https://github.com/facebook/react-native/pull/23321

Differential Revision: D13986149

Pulled By: cpojer

fbshipit-source-id: 878849fff12dc5478bb0d0952b2c22695391e81a
2019-02-27 21:15:20 +01:00
DulmandakhandMike Grabowski 56fc630368 SYSTEM_ALERT_WINDOW only in debug builds (#23504)
Summary:
SYSTEM_ALERT_WINDOW permission is used only for debug builds to show draw overlay views or show warnings/errors. This permissions is unused in release builds, and there is an issue regarding removing unused permissions on Android build https://github.com/facebook/react-native/issues/5886#issuecomment-464495388. This PR removes SYSTEM_ALERT_WINDOW from all builds bug debug.

[Android] [Changed] - SYSTEM_ALERT_WINDOW permissions available only in debug builds
Pull Request resolved: https://github.com/facebook/react-native/pull/23504

Differential Revision: D14123045

Pulled By: cpojer

fbshipit-source-id: 68829a774ff23c7cb2721076a9d3870405f48fea
2019-02-27 21:14:41 +01:00
Levi BuzolicandMike Grabowski dff3f609f4 Map TextInput textContentType strings to Objective-C constants (#22611)
Summary:
This is an updated version of #22579 which uses compile conditionals to prevent `use of undeclared identifier` errors when compiling on older versions of Xcode.

--------

Currently the only `textContentType` values that work are: `username`, `password`, `location`, `name` and `nickname`. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue #22578 has more detail examples/explanation.
Pull Request resolved: https://github.com/facebook/react-native/pull/22611

Differential Revision: D13460949

Pulled By: cpojer

fbshipit-source-id: e6d1108422b850ebc3aea05693ed05118b77b5de
2019-02-27 21:14:20 +01:00
Mike Grabowski 40603bc9c4 [0.59.0-rc.2] Bump version numbers 2019-02-18 18:04:25 +01:00
Michael DiarmidandMike Grabowski 415cc25788 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-18 17:31:23 +01:00
Cassio ZenandMike Grabowski 179d490607 Add autoComplete prop (#21575)
Summary:
TL;DR: Setting `autoComplete` will allow the system to suggest autofill options for the `<TextInput>` component.

Android Oreo introduced the AutoFill Framework, for secure communication between an app and autofill services (e.g. Password managers). When using `<TextInput>` on Android Oreo+, the system already tries to autofill (based on heuristics), but there is no way to set configuring options or disable.

The quick solution would be to just add the same Android attributes (`autofillHints` & `importantForAutofill`) in React Native TextInput, but that doesn't bond well with the cross-platform nature of the library.

Introduces an `autoComplete` prop based on HTML's `autocomplete` attribute, mapping to Android `autofillHints` & `importantForAutofill` and serving as a proper placeholder for autofill/autocomplete in other platforms:

Also gives you the ability to disable autofill by setting autocomplete="off".
Pull Request resolved: https://github.com/facebook/react-native/pull/21575

Differential Revision: D14102949

Pulled By: hramos

fbshipit-source-id: 7601aeaca0332a1f3ce8da8020dba037b700853a
2019-02-18 17:30:38 +01:00
Kevin GozaliandMike Grabowski 2f33b50f4f Don't attempt to load RCTDevLoadingView lazily
Summary:
There's a very old issue with reload logic: invalidation and resetting up of the bridge could be racing. In this case, we hit a redbox when:
* Chrome debugger is enabled in previous app run, then we launch the app again
* The bridge starts, then immediately reloads itself to connect to Chrome
* On the 2nd setup, the logic to update the green loading bar, with the % indicator for loading off metro, failed to find the DevLoadingView module instance because the bridge is in the middle of invalidating

See https://github.com/facebook/react-native/issues/23235

To test:
Using react-native init from github, do the steps in https://github.com/facebook/react-native/issues/23235, no more redbox. Note that the loading indicator % won't be proper still, but at least it doesn't crash/redbox.

Reviewed By: JoshuaGross

Differential Revision: D14110814

fbshipit-source-id: 835061e50acc6968bffbcc2ddfbe8da79a100df9
2019-02-18 14:50:35 +01:00
Mike Grabowski 1768655971 [0.59.0-rc.1] Bump version numbers 2019-02-15 16:38:54 +01:00
Mike Grabowski 7df6416180 Invalidate Gradle cache 2019-02-15 16:18:14 +01:00
Mike Grabowski a7906b0d16 Invalidate Buck cache 2019-02-15 16:03:35 +01:00
Mike Grabowski 171c24d9d1 Invalidate Yarn cache 2019-02-15 15:52:29 +01:00
Mike Grabowski 72f44a2731 Merge branch '0.59-stable' of github.com:facebook/react-native into 0.59-stable 2019-02-15 15:38:21 +01:00
DulmandakhandMike Grabowski 51a7ad55ac bump android plugin to 3.3.1 (#23473)
Summary:
Bump Android Plugin to 3.3.1, with many bug fixes and performance improvements. Split the change from https://github.com/facebook/react-native/pull/23324 to make cherry-pick easy to 0.59 branch.

[Android] [Changed] - bump Android Plugin to 3.3.1
Pull Request resolved: https://github.com/facebook/react-native/pull/23473

Differential Revision: D14099741

Pulled By: cpojer

fbshipit-source-id: 7491c49cd2467f1bb8776345bdda2ab9cea11c06
2019-02-15 15:36:20 +01:00
DulmandakhandMike Grabowski 01d5a3bccf react_native_config available to all Android versions (#23470)
Summary:
Move react_native_config.xml so that it's available to all Android versions, and fixes https://github.com/facebook/react-native/issues/23445. It's my bad, I should've tested previous change on multiple versions of Android.

[Android] [Changed] - Fix network security
Pull Request resolved: https://github.com/facebook/react-native/pull/23470

Differential Revision: D14099612

Pulled By: cpojer

fbshipit-source-id: 15b5e5f575de8033bbfd524d9ad2aa0e22daa813
2019-02-15 15:36:10 +01:00
Mike Grabowski 560a484fc6 Revert "[0.59.0-rc.1] Bump version numbers"
This reverts commit 199de26f42.
2019-02-15 15:36:00 +01:00
Héctor Ramos 99ebebdee6 Revert "Use current user in cache key"
This reverts commit c532dfd237.
2019-02-14 13:26:56 -08:00
Héctor Ramos 85a2e7146e Revert "Fix id command"
This reverts commit ad279eef3d.
2019-02-14 13:26:48 -08:00
Héctor Ramos ad279eef3d Fix id command 2019-02-14 13:23:02 -08:00
Héctor Ramos c532dfd237 Use current user in cache key 2019-02-14 13:15:18 -08:00
Héctor Ramos ce046f0b10 Individually accept licenses 2019-02-14 12:52:23 -08:00
Héctor Ramos dcb7e5c2a1 Auto-accept licenses and unblock CI 2019-02-14 10:15:06 -08:00
Mike Grabowski 199de26f42 [0.59.0-rc.1] Bump version numbers 2019-02-14 10:12:20 +01:00
Mike Grabowski 4cb1646703 fix: bring local-cli back 2019-02-14 10:12:10 +01:00
Alejandro RuperezandMike Grabowski 11c12d522a 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-14 10:05:53 +01:00
Héctor Ramos 5a314690f2 [0.59.0-rc.0] Bump version numbers 2019-02-13 12:14:47 -08:00
Héctor Ramos 51b66c02f3 Do not use cache during release deploy 2019-02-13 12:14:14 -08:00
Héctor Ramos 2bc055a227 Revert "[0.59.0-rc.0] Bump version numbers"
This reverts commit af6de4e8c8.
2019-02-13 12:13:49 -08:00
Héctor Ramos af6de4e8c8 [0.59.0-rc.0] Bump version numbers 2019-02-13 12:03:09 -08:00
Héctor Ramos b2f5e451cf Revert to prior Circle CI Android config
The new Docker image lacks git and is blocking the 0.59 release
2019-02-13 11:59:26 -08:00
Héctor Ramos cef5ad6964 Revert "[0.59.0-rc.0] Bump version numbers"
This reverts commit 517c165dae.
2019-02-13 11:52:49 -08:00
Mike Grabowski 517c165dae [0.59.0-rc.0] Bump version numbers 2019-02-13 20:15:31 +01:00
Mike Grabowski 8b75677fdb Revert "[0.59.0-rc.0] Bump version numbers"
This reverts commit d47aa28ef7.
2019-02-13 20:15:00 +01:00
Mike Grabowski d47aa28ef7 [0.59.0-rc.0] Bump version numbers 2019-02-13 18:04:43 +01:00
Mike Grabowski aca5f05ffe Set ReactNativePath while building RNTester 2019-02-13 17:40:06 +01:00
Mike Grabowski 7f5e04443f Fix Android Gradle build 2019-02-13 17:33:10 +01:00
DulmandakhandMike Grabowski 724d83a966 improve Android Network Security config (#23429)
Summary:
This PR is trying to improve Android Network Security configuration introduced in https://github.com/facebook/react-native/commit/84572c4051f11f68ddf0928d2c3df5850ae15491. I found that Android merges all manifest files into a single manifest file when building an app, so this PR provides AndroidManifest.xml with network security config in debug folder, that will be used only for debug builds. Also the network security configuration will be applied to only app that target API 28. Moved security config file to xml-v28, so that it'll only visible to API 28 and above.

See https://developer.android.com/studio/build/manifest-merge

[Android] [Changed] -  Android Network Security configuration.
Pull Request resolved: https://github.com/facebook/react-native/pull/23429

Differential Revision: D14065124

Pulled By: cpojer

fbshipit-source-id: 0f5ac5addbe968ed7e5cb57f356e2572de2690a8
2019-02-13 17:12:28 +01:00
DulmandakhandMike Grabowski e6d8ac8424 @Nonnull annotation for ReactPackage (#23415)
Summary:
Here are some leftovers from nullable annotations for native modules, discovered while developing native module in Kotlin. This will help improve Kotlin developer experience

[Android] [Changed] - Add Nonnull annotations to ReactPackage
Pull Request resolved: https://github.com/facebook/react-native/pull/23415

Differential Revision: D14064607

Pulled By: cpojer

fbshipit-source-id: af2ce1fc1911ee03c54b20a4fc3a6d1aba9267da
2019-02-13 17:12:21 +01:00
DulmandakhandMike Grabowski 818f6bb248 bump targetSdkVersion to 28 (#23431)
Summary:
Bump targetSdkVersion to 28

[Android] [Changed] - Bump targetSdkVersion to 28
Pull Request resolved: https://github.com/facebook/react-native/pull/23431

Differential Revision: D14065177

Pulled By: cpojer

fbshipit-source-id: a161d1d385b7b40ec93d70851e5a41baeb58f830
2019-02-13 17:12:08 +01:00
Mike Grabowski d37ffc3cfd Fix React Native calling CLI wo location 2019-02-13 17:10:41 +01:00
Mike Grabowski a962cb659f Revert "[0.59.0-rc.0] Bump version numbers"
This reverts commit d059e74704.
2019-02-13 17:10:19 +01:00
Mike Grabowski d059e74704 [0.59.0-rc.0] Bump version numbers 2019-02-13 16:47:58 +01:00
Mike Grabowski 1f099672be Fix React Native calling private CLI APIs 2019-02-13 16:47:52 +01:00
Mike Grabowski 9f96606d32 Revert "[0.59.0-rc.0] Bump version numbers"
This reverts commit 69e5c2ddc1.
2019-02-13 16:47:27 +01:00
Mike Grabowski 69e5c2ddc1 [0.59.0-rc.0] Bump version numbers 2019-02-13 16:37:12 +01:00
Mike Grabowski 977458442c Revert "add basic signature in template (#22665)"
This reverts commit 63ebbd6bfc.
2019-02-13 16:35:06 +01:00
Mike Grabowski a252aee2ea Bump CLI dependency 2019-02-13 16:35:02 +01:00
Mike Grabowski 06bc4b5b7c Explicitly set path to React Native for development 2019-02-13 15:23:30 +01:00
Mike Grabowski 5e1504b0fc Update CLI dependency 2019-02-13 15:21:28 +01:00
74 changed files with 3261 additions and 1255 deletions
+101 -24
View File
@@ -2,12 +2,12 @@ aliases:
# Cache Management
- &restore-yarn-cache
keys:
- v1-yarn-cache-{{ arch }}-{{ checksum "package.json" }}
- v1-yarn-cache-{{ arch }}
- v2-yarn-cache-{{ arch }}-{{ checksum "package.json" }}
- v2-yarn-cache-{{ arch }}
- &save-yarn-cache
paths:
- ~/.cache/yarn
key: v1-yarn-cache-{{ arch }}-{{ checksum "package.json" }}
key: v2-yarn-cache-{{ arch }}-{{ checksum "package.json" }}
- &restore-node-modules
keys:
@@ -26,28 +26,44 @@ aliases:
- node_modules
key: v1-analysis-dependencies-{{ arch }}-{{ checksum "package.json" }}{{ checksum "bots/package.json" }}
- &restore-cache-android-packages
keys:
- v1-android-sdkmanager-packages-api-28-alpha-{{ checksum "scripts/.tests.env" }}
- &save-cache-android-packages
paths:
- /opt/android/sdk
key: v1-android-sdkmanager-packages-api-28-alpha-{{ checksum "scripts/.tests.env" }}
- &restore-cache-gradle
keys:
- v1-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-{{ checksum "ReactAndroid/build.gradle" }}
- v2-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-{{ checksum "ReactAndroid/build.gradle" }}
# Fallback in case checksum fails
- v1-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-
- v1-gradle-{{ .Branch }}-
- v2-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-
- v2-gradle-{{ .Branch }}-
# Fallback in case this is a first-time run on a fork
- v1-gradle-master-
- v2-gradle-master-
- &save-cache-gradle
paths:
- ~/.gradle
key: v1-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-{{ checksum "ReactAndroid/build.gradle" }}
key: v2-gradle-{{ .Branch }}-{{ checksum "build.gradle" }}-{{ checksum "ReactAndroid/build.gradle" }}
- &restore-cache-ndk
keys:
- v3-android-ndk-r17c-{{ checksum "scripts/android-setup.sh" }}
- &save-cache-ndk
paths:
- /opt/ndk
key: v3-android-ndk-r17c-{{ checksum "scripts/android-setup.sh" }}
- &restore-cache-downloads-buck
keys:
- v3-buck-v2019.01.10.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}}
- v3-buck-v2019.01.10.01-
- v4-buck-v2019.01.10.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}}
- v4-buck-v2019.01.10.01-
- &save-cache-downloads-buck
paths:
- ~/buck
- ~/okbuck
key: v3-buck-v2019.01.10.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}
key: v4-buck-v2019.01.10.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}
- &restore-cache-watchman
keys:
@@ -59,14 +75,14 @@ aliases:
- &restore-cache-downloads-gradle
keys:
- v1-gradle-{{ checksum "ReactAndroid/build.gradle" }}-{{ checksum "scripts/circleci/gradle_download_deps.sh" }}
- v1-gradle-
- v2-gradle-{{ checksum "ReactAndroid/build.gradle" }}-{{ checksum "scripts/circleci/gradle_download_deps.sh" }}
- v2-gradle-
- &save-cache-downloads-gradle
paths:
- ~/.gradle
- ReactAndroid/build/downloads
- ReactAndroid/build/third-party-ndk
key: v1-gradle-{{ checksum "ReactAndroid/build.gradle" }}-{{ checksum "scripts/circleci/gradle_download_deps.sh" }}
key: v2-gradle-{{ checksum "ReactAndroid/build.gradle" }}-{{ checksum "scripts/circleci/gradle_download_deps.sh" }}
- &restore-cache-homebrew
keys:
@@ -99,6 +115,11 @@ aliases:
- /.*-stable/
- gh-pages
# Dependency Management
- &install-ndk
name: Install Android NDK
command: source scripts/android-setup.sh && getAndroidNDK
- &yarn
name: Run Yarn
command: |
@@ -108,9 +129,20 @@ aliases:
yarn install --non-interactive --cache-folder ~/.cache/yarn
fi
- &install-yarn
name: Install Yarn
command: |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
- &install-buck
name: Install BUCK
command: |
if [[ ! -e ~/buck ]]; then
git clone https://github.com/facebook/buck.git ~/buck --branch v2019.01.10.01 --depth=1
fi
cd ~/buck && ant
buck --version
# Install related tooling
if [[ ! -e ~/okbuck ]]; then
@@ -118,6 +150,30 @@ aliases:
fi
mkdir -p ~/react-native/tooling/junit
cp -R ~/okbuck/tooling/junit/* ~/react-native/tooling/junit/.
- &create-ndk-directory
name: Create Android NDK Directory
command: |
if [[ ! -e /opt/ndk ]]; then
sudo mkdir /opt/ndk
fi
sudo chown ${USER:=$(/usr/bin/id -run)}:$USER /opt/ndk
# CircleCI does not support interpolating env variables in the environment
# https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables
- &configure-android-path
name: Configure Environment Variables
command: |
echo 'export PATH=${ANDROID_NDK}:~/buck/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
- &install-android-packages
name: Install Android SDK Packages
command: source scripts/android-setup.sh && getAndroidPackages
- &install-android-build-dependencies
name: Install Android Build Dependencies
command: ./scripts/circleci/apt-get-android-deps.sh
- &validate-android-sdk
name: Validate Android SDK Install
command: ./scripts/validate-android-sdk.sh
@@ -187,7 +243,7 @@ aliases:
- &build-js-bundle
name: Build JavaScript Bundle
command: node cli.js bundle --max-workers 2 --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
command: node cli.js bundle --max-workers 2 --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js --reactNativePath .
- &compile-native-libs
name: Compile Native Libs for Unit and Integration Tests
@@ -208,7 +264,7 @@ aliases:
- &build-android-rntester-app
name: Build Android RNTester App
command: ./gradlew RNTester:android:app:assembleRelease
command: ./gradlew RNTester:android:app:assembleRelease -Pjobs=$BUILD_THREADS
- &collect-android-test-results
name: Collect Test Results
@@ -283,13 +339,14 @@ js_defaults: &js_defaults
android_defaults: &android_defaults
<<: *defaults
docker:
- image: reactnativecommunity/react-native-android
- image: circleci/android:api-28-node8-alpha
resource_class: "large"
environment:
- TERM: "dumb"
- ADB_INSTALL_TIMEOUT: 10
- _JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
- GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError"'
- ANDROID_NDK: '/opt/ndk/android-ndk-r17c'
- BUILD_THREADS: 2
macos_defaults: &macos_defaults
@@ -415,6 +472,15 @@ jobs:
- attach_workspace:
at: ~/react-native
# Configure Android SDK and related dependencies
- run: *configure-android-path
# Android build deps install from the network faster than cache
- run: *install-android-build-dependencies
- restore-cache: *restore-cache-android-packages
- run: *install-android-packages
- save-cache: *save-cache-android-packages
# Validate Android SDK installation and packages
- run: *validate-android-sdk
@@ -424,6 +490,12 @@ jobs:
# Keep configuring Android dependencies while AVD boots up
# Install Android NDK
- run: *create-ndk-directory
- restore-cache: *restore-cache-ndk
- run: *install-ndk
- save-cache: *save-cache-ndk
# Install Buck
- restore-cache: *restore-cache-downloads-buck
- run: *install-buck
@@ -547,21 +619,26 @@ jobs:
<<: *android_defaults
steps:
- checkout
- restore-cache: *restore-yarn-cache
- run: *yarn
# Configure Android SDK and related dependencies
- run: *configure-android-path
- run: *install-android-build-dependencies
- run: *install-android-packages
# Install Android NDK
- run: *create-ndk-directory
- restore-cache: *restore-cache-ndk
- run: *install-ndk
# Fetch dependencies using Buck
- restore-cache: *restore-cache-downloads-buck
- run: *install-buck
- run: *download-dependencies-buck
# Fetch dependencies using Gradle
- restore-cache: *restore-cache-downloads-gradle
- run: *download-dependencies-gradle
- restore-cache: *restore-yarn-cache
- run: *yarn
- run:
name: Authenticate with npm
command: echo "//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}" > ~/.npmrc
@@ -31,7 +31,7 @@ watchman shutdown-server
# integration tests
# build JS bundle for instrumentation tests
node cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
node cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js --reactNativePath .
# build test APK
# shellcheck disable=SC1091
@@ -223,6 +223,21 @@ type IOSProps = $ReadOnly<{|
|}>;
type AndroidProps = $ReadOnly<{|
autoCompleteType?: ?(
| 'cc-csc'
| 'cc-exp'
| 'cc-exp-month'
| 'cc-exp-year'
| 'cc-number'
| 'email'
| 'name'
| 'password'
| 'postal-code'
| 'street-address'
| 'tel'
| 'username'
| 'off'
),
returnKeyLabel?: ?string,
numberOfLines?: ?number,
disableFullscreenUI?: ?boolean,
@@ -230,6 +245,13 @@ type AndroidProps = $ReadOnly<{|
underlineColorAndroid?: ?ColorValue,
inlineImageLeft?: ?string,
inlineImagePadding?: ?number,
importantForAutofill?: ?(
| 'auto'
| 'no'
| 'noExcludeDescendants'
| 'yes'
| 'yesExcludeDescendants'
),
|}>;
type Props = $ReadOnly<{|
@@ -413,6 +435,45 @@ const TextInput = createReactClass({
'words',
'characters',
]),
/**
* Determines which content to suggest on auto complete, e.g.`username`.
* To disable auto complete, use `off`.
*
* *Android Only*
*
* The following values work on Android only:
*
* - `username`
* - `password`
* - `email`
* - `name`
* - `tel`
* - `street-address`
* - `postal-code`
* - `cc-number`
* - `cc-csc`
* - `cc-exp`
* - `cc-exp-month`
* - `cc-exp-year`
* - `off`
*
* @platform android
*/
autoCompleteType: PropTypes.oneOf([
'cc-csc',
'cc-exp',
'cc-exp-month',
'cc-exp-year',
'cc-number',
'email',
'name',
'password',
'postal-code',
'street-address',
'tel',
'username',
'off',
]),
/**
* If `false`, disables auto-correct. The default value is `true`.
*/
+4 -4
View File
@@ -1,17 +1,17 @@
/**
* @generated by scripts/bump-oss-version.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @generated by scripts/bump-oss-version.js
* @flow
*/
exports.version = {
major: 0,
minor: 0,
patch: 0,
minor: 59,
patch: 1,
prerelease: null,
};
+1 -1
View File
@@ -1 +1 @@
f24a0da6e0f59484e5aafd0825bb1a6ed27d7182
8e25ed20bd27d126f670d04680db85209f779056
File diff suppressed because it is too large Load Diff
+95 -74
View File
@@ -3188,6 +3188,8 @@ function updateReducer(reducer) {
is(newState, hook.memoizedState) || (didReceiveUpdate = !0);
hook.memoizedState = newState;
hook.baseUpdate === queue.last && (hook.baseState = newState);
queue.eagerReducer = reducer;
queue.eagerState = newState;
return [newState, _dispatch];
}
}
@@ -3508,6 +3510,8 @@ function tryHydrate(fiber, nextInstance) {
(nextInstance = shim$1(nextInstance, fiber.pendingProps)),
null !== nextInstance ? ((fiber.stateNode = nextInstance), !0) : !1
);
case 13:
return !1;
default:
return !1;
}
@@ -4571,19 +4575,19 @@ function beginWork(current$$1, workInProgress, renderExpirationTime) {
null !== dependency &&
dependency.expirationTime < renderExpirationTime &&
(dependency.expirationTime = renderExpirationTime);
dependency = renderExpirationTime;
for (var node = oldValue.return; null !== node; ) {
dependency = node.alternate;
if (node.childExpirationTime < renderExpirationTime)
(node.childExpirationTime = renderExpirationTime),
null !== dependency &&
dependency.childExpirationTime <
renderExpirationTime &&
(dependency.childExpirationTime = renderExpirationTime);
var alternate = node.alternate;
if (node.childExpirationTime < dependency)
(node.childExpirationTime = dependency),
null !== alternate &&
alternate.childExpirationTime < dependency &&
(alternate.childExpirationTime = dependency);
else if (
null !== dependency &&
dependency.childExpirationTime < renderExpirationTime
null !== alternate &&
alternate.childExpirationTime < dependency
)
dependency.childExpirationTime = renderExpirationTime;
alternate.childExpirationTime = dependency;
else break;
node = node.return;
}
@@ -4713,12 +4717,11 @@ function beginWork(current$$1, workInProgress, renderExpirationTime) {
renderExpirationTime
)
);
default:
invariant(
!1,
"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue."
);
}
invariant(
!1,
"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue."
);
}
var valueCursor = { current: null },
currentlyRenderingFiber = null,
@@ -5361,6 +5364,8 @@ function unwindWork(workInProgress) {
workInProgress)
: null
);
case 18:
return null;
case 4:
return popHostContainer(workInProgress), null;
case 10:
@@ -5686,6 +5691,7 @@ function commitPassiveEffects(root, firstEffect) {
isRendering = previousIsRendering;
previousIsRendering = root.expirationTime;
0 !== previousIsRendering && requestWork(root, previousIsRendering);
isBatchingUpdates || isRendering || performWork(1073741823, !1);
}
function flushPassiveEffects() {
if (null !== passiveEffectCallbackHandle) {
@@ -5960,6 +5966,8 @@ function completeUnitOfWork(workInProgress) {
case 17:
isContextProvider(current$$1.type) && popContext(current$$1);
break;
case 18:
break;
default:
invariant(
!1,
@@ -6050,7 +6058,7 @@ function renderRoot(root$jscomp$0, isYieldy) {
do {
try {
if (isYieldy)
for (; null !== nextUnitOfWork && !shouldYieldToRenderer(); )
for (; null !== nextUnitOfWork && !(frameDeadline <= now$1()); )
nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
else
for (; null !== nextUnitOfWork; )
@@ -6136,27 +6144,24 @@ function renderRoot(root$jscomp$0, isYieldy) {
sourceFiber$jscomp$0.expirationTime = 1073741823;
break a;
}
sourceFiber$jscomp$0 = root.pingCache;
null === sourceFiber$jscomp$0
? ((sourceFiber$jscomp$0 = root.pingCache = new PossiblyWeakMap()),
(returnFiber$jscomp$0 = new Set()),
sourceFiber$jscomp$0.set(thenable, returnFiber$jscomp$0))
: ((returnFiber$jscomp$0 = sourceFiber$jscomp$0.get(
thenable
)),
void 0 === returnFiber$jscomp$0 &&
((returnFiber$jscomp$0 = new Set()),
sourceFiber$jscomp$0.set(
thenable,
returnFiber$jscomp$0
)));
returnFiber$jscomp$0.has(returnFiber) ||
(returnFiber$jscomp$0.add(returnFiber),
sourceFiber$jscomp$0 = root;
returnFiber$jscomp$0 = returnFiber;
var pingCache = sourceFiber$jscomp$0.pingCache;
null === pingCache
? ((pingCache = sourceFiber$jscomp$0.pingCache = new PossiblyWeakMap()),
(current$$1 = new Set()),
pingCache.set(thenable, current$$1))
: ((current$$1 = pingCache.get(thenable)),
void 0 === current$$1 &&
((current$$1 = new Set()),
pingCache.set(thenable, current$$1)));
current$$1.has(returnFiber$jscomp$0) ||
(current$$1.add(returnFiber$jscomp$0),
(sourceFiber$jscomp$0 = pingSuspendedRoot.bind(
null,
root,
sourceFiber$jscomp$0,
thenable,
returnFiber
returnFiber$jscomp$0
)),
thenable.then(sourceFiber$jscomp$0, sourceFiber$jscomp$0));
-1 === earliestTimeoutMs
@@ -6200,24 +6205,25 @@ function renderRoot(root$jscomp$0, isYieldy) {
break a;
case 1:
if (
((thenable = value),
(earliestTimeoutMs = root.type),
(startTimeMs = root.stateNode),
((earliestTimeoutMs = value),
(startTimeMs = root.type),
(sourceFiber$jscomp$0 = root.stateNode),
0 === (root.effectTag & 64) &&
("function" ===
typeof earliestTimeoutMs.getDerivedStateFromError ||
(null !== startTimeMs &&
"function" === typeof startTimeMs.componentDidCatch &&
typeof startTimeMs.getDerivedStateFromError ||
(null !== sourceFiber$jscomp$0 &&
"function" ===
typeof sourceFiber$jscomp$0.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(
startTimeMs
sourceFiber$jscomp$0
)))))
) {
root.effectTag |= 2048;
root.expirationTime = returnFiber;
returnFiber = createClassErrorUpdate(
root,
thenable,
earliestTimeoutMs,
returnFiber
);
enqueueCapturedUpdate(root, returnFiber);
@@ -6477,7 +6483,7 @@ function onSuspend(
msUntilTimeout
) {
root.expirationTime = rootExpirationTime;
0 !== msUntilTimeout || shouldYieldToRenderer()
0 !== msUntilTimeout || frameDeadline <= now$1()
? 0 < msUntilTimeout &&
(root.timeoutHandle = scheduleTimeout(
onTimeout.bind(null, root, finishedWork, suspendedExpirationTime),
@@ -6577,27 +6583,19 @@ function findHighestPriorityRoot() {
nextFlushedRoot = highestPriorityRoot;
nextFlushedExpirationTime = highestPriorityWork;
}
var didYield = !1;
function shouldYieldToRenderer() {
return didYield ? !0 : frameDeadline <= now$1() ? (didYield = !0) : !1;
}
function performAsyncWork() {
try {
if (!shouldYieldToRenderer() && null !== firstScheduledRoot) {
recomputeCurrentRendererTime();
var root = firstScheduledRoot;
do {
var expirationTime = root.expirationTime;
0 !== expirationTime &&
currentRendererTime <= expirationTime &&
(root.nextExpirationTimeToWorkOn = currentRendererTime);
root = root.nextScheduledRoot;
} while (root !== firstScheduledRoot);
}
performWork(0, !0);
} finally {
didYield = !1;
function performAsyncWork(didTimeout) {
if (didTimeout && null !== firstScheduledRoot) {
recomputeCurrentRendererTime();
didTimeout = firstScheduledRoot;
do {
var expirationTime = didTimeout.expirationTime;
0 !== expirationTime &&
currentRendererTime <= expirationTime &&
(didTimeout.nextExpirationTimeToWorkOn = currentRendererTime);
didTimeout = didTimeout.nextScheduledRoot;
} while (didTimeout !== firstScheduledRoot);
}
performWork(0, !0);
}
function performWork(minExpirationTime, isYieldy) {
findHighestPriorityRoot();
@@ -6608,7 +6606,10 @@ function performWork(minExpirationTime, isYieldy) {
null !== nextFlushedRoot &&
0 !== nextFlushedExpirationTime &&
minExpirationTime <= nextFlushedExpirationTime &&
!(didYield && currentRendererTime > nextFlushedExpirationTime);
!(
frameDeadline <= now$1() &&
currentRendererTime > nextFlushedExpirationTime
);
)
performWorkOnRoot(
@@ -6676,7 +6677,7 @@ function performWorkOnRoot(root, expirationTime, isYieldy) {
renderRoot(root, isYieldy),
(_finishedWork = root.finishedWork),
null !== _finishedWork &&
(shouldYieldToRenderer()
(frameDeadline <= now$1()
? (root.finishedWork = _finishedWork)
: completeRoot$1(root, _finishedWork, expirationTime)));
} else
@@ -6917,18 +6918,20 @@ var roots = new Map(),
maybeInstance = findHostInstance(this);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig =
var nativeTag =
maybeInstance._nativeTag || maybeInstance.canonical._nativeTag;
maybeInstance =
maybeInstance.viewConfig || maybeInstance.canonical.viewConfig;
nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
viewConfig.validAttributes
maybeInstance.validAttributes
);
null != nativeProps &&
UIManager.updateView(
maybeInstance._nativeTag,
viewConfig.uiViewClassName,
nativeTag,
maybeInstance.uiViewClassName,
nativeProps
);
}
@@ -6937,6 +6940,21 @@ var roots = new Map(),
})(React.Component);
})(findNodeHandle, findHostInstance),
findNodeHandle: findNodeHandle,
setNativeProps: function(handle, nativeProps) {
null != handle._nativeTag &&
((nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
handle.viewConfig.validAttributes
)),
null != nativeProps &&
UIManager.updateView(
handle._nativeTag,
handle.viewConfig.uiViewClassName,
nativeProps
));
},
render: function(element, containerTag, callback) {
var root = roots.get(containerTag);
if (!root) {
@@ -7022,17 +7040,20 @@ var roots = new Map(),
maybeInstance = findHostInstance(this);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig = maybeInstance.viewConfig;
var nativeTag =
maybeInstance._nativeTag || maybeInstance.canonical._nativeTag;
maybeInstance =
maybeInstance.viewConfig || maybeInstance.canonical.viewConfig;
nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
viewConfig.validAttributes
maybeInstance.validAttributes
);
null != nativeProps &&
UIManager.updateView(
maybeInstance._nativeTag,
viewConfig.uiViewClassName,
nativeTag,
maybeInstance.uiViewClassName,
nativeProps
);
}
@@ -7068,7 +7089,7 @@ var roots = new Map(),
findFiberByHostInstance: getInstanceFromInstance,
getInspectorDataForViewTag: getInspectorDataForViewTag,
bundleType: 0,
version: "16.8.1",
version: "16.8.3",
rendererPackageName: "react-native-renderer"
});
var ReactFabric$2 = { default: ReactFabric },
+93 -69
View File
@@ -3208,6 +3208,8 @@ function updateReducer(reducer) {
is(newState, hook.memoizedState) || (didReceiveUpdate = !0);
hook.memoizedState = newState;
hook.baseUpdate === queue.last && (hook.baseState = newState);
queue.eagerReducer = reducer;
queue.eagerState = newState;
return [newState, _dispatch];
}
}
@@ -3538,6 +3540,8 @@ function tryHydrate(fiber, nextInstance) {
(nextInstance = shim$1(nextInstance, fiber.pendingProps)),
null !== nextInstance ? ((fiber.stateNode = nextInstance), !0) : !1
);
case 13:
return !1;
default:
return !1;
}
@@ -4644,19 +4648,19 @@ function beginWork(current$$1, workInProgress, renderExpirationTime) {
null !== dependency &&
dependency.expirationTime < renderExpirationTime &&
(dependency.expirationTime = renderExpirationTime);
dependency = renderExpirationTime;
for (var node = oldValue.return; null !== node; ) {
dependency = node.alternate;
if (node.childExpirationTime < renderExpirationTime)
(node.childExpirationTime = renderExpirationTime),
null !== dependency &&
dependency.childExpirationTime <
renderExpirationTime &&
(dependency.childExpirationTime = renderExpirationTime);
var alternate = node.alternate;
if (node.childExpirationTime < dependency)
(node.childExpirationTime = dependency),
null !== alternate &&
alternate.childExpirationTime < dependency &&
(alternate.childExpirationTime = dependency);
else if (
null !== dependency &&
dependency.childExpirationTime < renderExpirationTime
null !== alternate &&
alternate.childExpirationTime < dependency
)
dependency.childExpirationTime = renderExpirationTime;
alternate.childExpirationTime = dependency;
else break;
node = node.return;
}
@@ -4786,12 +4790,11 @@ function beginWork(current$$1, workInProgress, renderExpirationTime) {
renderExpirationTime
)
);
default:
invariant(
!1,
"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue."
);
}
invariant(
!1,
"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue."
);
}
var valueCursor = { current: null },
currentlyRenderingFiber = null,
@@ -5465,22 +5468,23 @@ function throwException(
sourceFiber.expirationTime = 1073741823;
return;
}
sourceFiber = root.pingCache;
null === sourceFiber
? ((sourceFiber = root.pingCache = new PossiblyWeakMap()),
(returnFiber = new Set()),
sourceFiber.set(thenable, returnFiber))
: ((returnFiber = sourceFiber.get(thenable)),
void 0 === returnFiber &&
((returnFiber = new Set()),
sourceFiber.set(thenable, returnFiber)));
returnFiber.has(renderExpirationTime) ||
(returnFiber.add(renderExpirationTime),
sourceFiber = root;
returnFiber = renderExpirationTime;
var pingCache = sourceFiber.pingCache;
null === pingCache
? ((pingCache = sourceFiber.pingCache = new PossiblyWeakMap()),
(current$$1 = new Set()),
pingCache.set(thenable, current$$1))
: ((current$$1 = pingCache.get(thenable)),
void 0 === current$$1 &&
((current$$1 = new Set()), pingCache.set(thenable, current$$1)));
current$$1.has(returnFiber) ||
(current$$1.add(returnFiber),
(sourceFiber = pingSuspendedRoot.bind(
null,
root,
sourceFiber,
thenable,
renderExpirationTime
returnFiber
)),
(sourceFiber = tracing.unstable_wrap(sourceFiber)),
thenable.then(sourceFiber, sourceFiber));
@@ -5528,21 +5532,21 @@ function throwException(
return;
case 1:
if (
((thenable = value),
(earliestTimeoutMs = root.type),
(startTimeMs = root.stateNode),
((earliestTimeoutMs = value),
(startTimeMs = root.type),
(sourceFiber = root.stateNode),
0 === (root.effectTag & 64) &&
("function" === typeof earliestTimeoutMs.getDerivedStateFromError ||
(null !== startTimeMs &&
"function" === typeof startTimeMs.componentDidCatch &&
("function" === typeof startTimeMs.getDerivedStateFromError ||
(null !== sourceFiber &&
"function" === typeof sourceFiber.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(startTimeMs)))))
!legacyErrorBoundariesThatAlreadyFailed.has(sourceFiber)))))
) {
root.effectTag |= 2048;
root.expirationTime = renderExpirationTime;
renderExpirationTime = createClassErrorUpdate(
root,
thenable,
earliestTimeoutMs,
renderExpirationTime
);
enqueueCapturedUpdate(root, renderExpirationTime);
@@ -5583,6 +5587,8 @@ function unwindWork(workInProgress) {
workInProgress)
: null
);
case 18:
return null;
case 4:
return popHostContainer(workInProgress), null;
case 10:
@@ -5927,6 +5933,7 @@ function commitPassiveEffects(root, firstEffect) {
isRendering = previousIsRendering;
previousIsRendering = root.expirationTime;
0 !== previousIsRendering && requestWork(root, previousIsRendering);
isBatchingUpdates || isRendering || performWork(1073741823, !1);
}
function flushPassiveEffects() {
if (null !== passiveEffectCallbackHandle) {
@@ -6241,6 +6248,8 @@ function completeUnitOfWork(workInProgress) {
case 17:
isContextProvider(current$$1.type) && popContext(current$$1);
break;
case 18:
break;
default:
invariant(
!1,
@@ -6387,7 +6396,7 @@ function renderRoot(root, isYieldy) {
do {
try {
if (isYieldy)
for (; null !== nextUnitOfWork && !shouldYieldToRenderer(); )
for (; null !== nextUnitOfWork && !(frameDeadline <= now$1()); )
nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
else
for (; null !== nextUnitOfWork; )
@@ -6680,7 +6689,7 @@ function onSuspend(
msUntilTimeout
) {
root.expirationTime = rootExpirationTime;
0 !== msUntilTimeout || shouldYieldToRenderer()
0 !== msUntilTimeout || frameDeadline <= now$1()
? 0 < msUntilTimeout &&
(root.timeoutHandle = scheduleTimeout(
onTimeout.bind(null, root, finishedWork, suspendedExpirationTime),
@@ -6780,27 +6789,19 @@ function findHighestPriorityRoot() {
nextFlushedRoot = highestPriorityRoot;
nextFlushedExpirationTime = highestPriorityWork;
}
var didYield = !1;
function shouldYieldToRenderer() {
return didYield ? !0 : frameDeadline <= now$1() ? (didYield = !0) : !1;
}
function performAsyncWork() {
try {
if (!shouldYieldToRenderer() && null !== firstScheduledRoot) {
recomputeCurrentRendererTime();
var root = firstScheduledRoot;
do {
var expirationTime = root.expirationTime;
0 !== expirationTime &&
currentRendererTime <= expirationTime &&
(root.nextExpirationTimeToWorkOn = currentRendererTime);
root = root.nextScheduledRoot;
} while (root !== firstScheduledRoot);
}
performWork(0, !0);
} finally {
didYield = !1;
function performAsyncWork(didTimeout) {
if (didTimeout && null !== firstScheduledRoot) {
recomputeCurrentRendererTime();
didTimeout = firstScheduledRoot;
do {
var expirationTime = didTimeout.expirationTime;
0 !== expirationTime &&
currentRendererTime <= expirationTime &&
(didTimeout.nextExpirationTimeToWorkOn = currentRendererTime);
didTimeout = didTimeout.nextScheduledRoot;
} while (didTimeout !== firstScheduledRoot);
}
performWork(0, !0);
}
function performWork(minExpirationTime, isYieldy) {
findHighestPriorityRoot();
@@ -6811,7 +6812,10 @@ function performWork(minExpirationTime, isYieldy) {
null !== nextFlushedRoot &&
0 !== nextFlushedExpirationTime &&
minExpirationTime <= nextFlushedExpirationTime &&
!(didYield && currentRendererTime > nextFlushedExpirationTime);
!(
frameDeadline <= now$1() &&
currentRendererTime > nextFlushedExpirationTime
);
)
performWorkOnRoot(
@@ -6879,7 +6883,7 @@ function performWorkOnRoot(root, expirationTime, isYieldy) {
renderRoot(root, isYieldy),
(_finishedWork = root.finishedWork),
null !== _finishedWork &&
(shouldYieldToRenderer()
(frameDeadline <= now$1()
? (root.finishedWork = _finishedWork)
: completeRoot$1(root, _finishedWork, expirationTime)));
} else
@@ -7120,18 +7124,20 @@ var roots = new Map(),
maybeInstance = findHostInstance(this);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig =
var nativeTag =
maybeInstance._nativeTag || maybeInstance.canonical._nativeTag;
maybeInstance =
maybeInstance.viewConfig || maybeInstance.canonical.viewConfig;
nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
viewConfig.validAttributes
maybeInstance.validAttributes
);
null != nativeProps &&
UIManager.updateView(
maybeInstance._nativeTag,
viewConfig.uiViewClassName,
nativeTag,
maybeInstance.uiViewClassName,
nativeProps
);
}
@@ -7140,6 +7146,21 @@ var roots = new Map(),
})(React.Component);
})(findNodeHandle, findHostInstance),
findNodeHandle: findNodeHandle,
setNativeProps: function(handle, nativeProps) {
null != handle._nativeTag &&
((nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
handle.viewConfig.validAttributes
)),
null != nativeProps &&
UIManager.updateView(
handle._nativeTag,
handle.viewConfig.uiViewClassName,
nativeProps
));
},
render: function(element, containerTag, callback) {
var root = roots.get(containerTag);
if (!root) {
@@ -7230,17 +7251,20 @@ var roots = new Map(),
maybeInstance = findHostInstance(this);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig = maybeInstance.viewConfig;
var nativeTag =
maybeInstance._nativeTag || maybeInstance.canonical._nativeTag;
maybeInstance =
maybeInstance.viewConfig || maybeInstance.canonical.viewConfig;
nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
viewConfig.validAttributes
maybeInstance.validAttributes
);
null != nativeProps &&
UIManager.updateView(
maybeInstance._nativeTag,
viewConfig.uiViewClassName,
nativeTag,
maybeInstance.uiViewClassName,
nativeProps
);
}
@@ -7276,7 +7300,7 @@ var roots = new Map(),
findFiberByHostInstance: getInstanceFromInstance,
getInspectorDataForViewTag: getInspectorDataForViewTag,
bundleType: 0,
version: "16.8.1",
version: "16.8.3",
rendererPackageName: "react-native-renderer"
});
var ReactFabric$2 = { default: ReactFabric },
File diff suppressed because it is too large Load Diff
@@ -3224,6 +3224,8 @@ function updateReducer(reducer) {
is(newState, hook.memoizedState) || (didReceiveUpdate = !0);
hook.memoizedState = newState;
hook.baseUpdate === queue.last && (hook.baseState = newState);
queue.eagerReducer = reducer;
queue.eagerState = newState;
return [newState, _dispatch];
}
}
@@ -3544,6 +3546,8 @@ function tryHydrate(fiber, nextInstance) {
(nextInstance = shim$1(nextInstance, fiber.pendingProps)),
null !== nextInstance ? ((fiber.stateNode = nextInstance), !0) : !1
);
case 13:
return !1;
default:
return !1;
}
@@ -4607,19 +4611,19 @@ function beginWork(current$$1, workInProgress, renderExpirationTime) {
null !== dependency &&
dependency.expirationTime < renderExpirationTime &&
(dependency.expirationTime = renderExpirationTime);
dependency = renderExpirationTime;
for (var node = oldValue.return; null !== node; ) {
dependency = node.alternate;
if (node.childExpirationTime < renderExpirationTime)
(node.childExpirationTime = renderExpirationTime),
null !== dependency &&
dependency.childExpirationTime <
renderExpirationTime &&
(dependency.childExpirationTime = renderExpirationTime);
var alternate = node.alternate;
if (node.childExpirationTime < dependency)
(node.childExpirationTime = dependency),
null !== alternate &&
alternate.childExpirationTime < dependency &&
(alternate.childExpirationTime = dependency);
else if (
null !== dependency &&
dependency.childExpirationTime < renderExpirationTime
null !== alternate &&
alternate.childExpirationTime < dependency
)
dependency.childExpirationTime = renderExpirationTime;
alternate.childExpirationTime = dependency;
else break;
node = node.return;
}
@@ -4749,12 +4753,11 @@ function beginWork(current$$1, workInProgress, renderExpirationTime) {
renderExpirationTime
)
);
default:
invariant(
!1,
"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue."
);
}
invariant(
!1,
"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue."
);
}
var valueCursor = { current: null },
currentlyRenderingFiber = null,
@@ -5091,7 +5094,7 @@ function logCapturedError(capturedError) {
: Error("Unspecified error at:" + componentStack);
ExceptionsManager.handleException(error, !1);
}
var PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set;
var PossiblyWeakSet$1 = "function" === typeof WeakSet ? WeakSet : Set;
function logError(boundary, errorInfo) {
var source = errorInfo.source,
stack = errorInfo.stack;
@@ -5304,7 +5307,7 @@ function commitPlacement(finishedWork) {
parentFiber.sibling.return = parentFiber.return;
for (
parentFiber = parentFiber.sibling;
5 !== parentFiber.tag && 6 !== parentFiber.tag;
5 !== parentFiber.tag && 6 !== parentFiber.tag && 18 !== parentFiber.tag;
) {
if (parentFiber.effectTag & 2) continue b;
@@ -5548,9 +5551,9 @@ function commitWork(current$$1, finishedWork) {
finishedWork.updateQueue = null;
var retryCache = finishedWork.stateNode;
null === retryCache &&
(retryCache = finishedWork.stateNode = new PossiblyWeakSet());
(retryCache = finishedWork.stateNode = new PossiblyWeakSet$1());
instance.forEach(function(thenable) {
var retry = retryTimedOutBoundary.bind(null, finishedWork, thenable);
var retry = resolveRetryThenable.bind(null, finishedWork, thenable);
retryCache.has(thenable) ||
(retryCache.add(thenable), thenable.then(retry, retry));
});
@@ -5635,6 +5638,8 @@ function unwindWork(workInProgress) {
workInProgress)
: null
);
case 18:
return null;
case 4:
return popHostContainer(workInProgress), null;
case 10:
@@ -5890,6 +5895,7 @@ function commitPassiveEffects(root, firstEffect) {
isRendering = previousIsRendering;
previousIsRendering = root.expirationTime;
0 !== previousIsRendering && requestWork(root, previousIsRendering);
isBatchingUpdates || isRendering || performWork(1073741823, !1);
}
function flushPassiveEffects() {
if (null !== passiveEffectCallbackHandle) {
@@ -6167,6 +6173,8 @@ function completeUnitOfWork(workInProgress) {
case 17:
isContextProvider(current$$1.type) && popContext(current$$1);
break;
case 18:
break;
default:
invariant(
!1,
@@ -6260,7 +6268,7 @@ function renderRoot(root$jscomp$0, isYieldy) {
do {
try {
if (isYieldy)
for (; null !== nextUnitOfWork && !shouldYieldToRenderer(); )
for (; null !== nextUnitOfWork && !(frameDeadline <= now$1()); )
nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
else
for (; null !== nextUnitOfWork; )
@@ -6346,27 +6354,24 @@ function renderRoot(root$jscomp$0, isYieldy) {
sourceFiber$jscomp$0.expirationTime = 1073741823;
break a;
}
sourceFiber$jscomp$0 = root.pingCache;
null === sourceFiber$jscomp$0
? ((sourceFiber$jscomp$0 = root.pingCache = new PossiblyWeakMap()),
(returnFiber$jscomp$0 = new Set()),
sourceFiber$jscomp$0.set(thenable, returnFiber$jscomp$0))
: ((returnFiber$jscomp$0 = sourceFiber$jscomp$0.get(
thenable
)),
void 0 === returnFiber$jscomp$0 &&
((returnFiber$jscomp$0 = new Set()),
sourceFiber$jscomp$0.set(
thenable,
returnFiber$jscomp$0
)));
returnFiber$jscomp$0.has(returnFiber) ||
(returnFiber$jscomp$0.add(returnFiber),
sourceFiber$jscomp$0 = root;
returnFiber$jscomp$0 = returnFiber;
var pingCache = sourceFiber$jscomp$0.pingCache;
null === pingCache
? ((pingCache = sourceFiber$jscomp$0.pingCache = new PossiblyWeakMap()),
(current$$1 = new Set()),
pingCache.set(thenable, current$$1))
: ((current$$1 = pingCache.get(thenable)),
void 0 === current$$1 &&
((current$$1 = new Set()),
pingCache.set(thenable, current$$1)));
current$$1.has(returnFiber$jscomp$0) ||
(current$$1.add(returnFiber$jscomp$0),
(sourceFiber$jscomp$0 = pingSuspendedRoot.bind(
null,
root,
sourceFiber$jscomp$0,
thenable,
returnFiber
returnFiber$jscomp$0
)),
thenable.then(sourceFiber$jscomp$0, sourceFiber$jscomp$0));
-1 === earliestTimeoutMs
@@ -6410,24 +6415,25 @@ function renderRoot(root$jscomp$0, isYieldy) {
break a;
case 1:
if (
((thenable = value),
(earliestTimeoutMs = root.type),
(startTimeMs = root.stateNode),
((earliestTimeoutMs = value),
(startTimeMs = root.type),
(sourceFiber$jscomp$0 = root.stateNode),
0 === (root.effectTag & 64) &&
("function" ===
typeof earliestTimeoutMs.getDerivedStateFromError ||
(null !== startTimeMs &&
"function" === typeof startTimeMs.componentDidCatch &&
typeof startTimeMs.getDerivedStateFromError ||
(null !== sourceFiber$jscomp$0 &&
"function" ===
typeof sourceFiber$jscomp$0.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(
startTimeMs
sourceFiber$jscomp$0
)))))
) {
root.effectTag |= 2048;
root.expirationTime = returnFiber;
returnFiber = createClassErrorUpdate(
root,
thenable,
earliestTimeoutMs,
returnFiber
);
enqueueCapturedUpdate(root, returnFiber);
@@ -6604,7 +6610,7 @@ function pingSuspendedRoot(root, thenable, pingTime) {
0 !== pingTime && requestWork(root, pingTime);
}
}
function retryTimedOutBoundary(boundaryFiber, thenable) {
function resolveRetryThenable(boundaryFiber, thenable) {
var retryCache = boundaryFiber.stateNode;
null !== retryCache && retryCache.delete(thenable);
thenable = requestCurrentTime();
@@ -6701,7 +6707,7 @@ function onSuspend(
msUntilTimeout
) {
root.expirationTime = rootExpirationTime;
0 !== msUntilTimeout || shouldYieldToRenderer()
0 !== msUntilTimeout || frameDeadline <= now$1()
? 0 < msUntilTimeout &&
(root.timeoutHandle = scheduleTimeout(
onTimeout.bind(null, root, finishedWork, suspendedExpirationTime),
@@ -6801,27 +6807,19 @@ function findHighestPriorityRoot() {
nextFlushedRoot = highestPriorityRoot;
nextFlushedExpirationTime = highestPriorityWork;
}
var didYield = !1;
function shouldYieldToRenderer() {
return didYield ? !0 : frameDeadline <= now$1() ? (didYield = !0) : !1;
}
function performAsyncWork() {
try {
if (!shouldYieldToRenderer() && null !== firstScheduledRoot) {
recomputeCurrentRendererTime();
var root = firstScheduledRoot;
do {
var expirationTime = root.expirationTime;
0 !== expirationTime &&
currentRendererTime <= expirationTime &&
(root.nextExpirationTimeToWorkOn = currentRendererTime);
root = root.nextScheduledRoot;
} while (root !== firstScheduledRoot);
}
performWork(0, !0);
} finally {
didYield = !1;
function performAsyncWork(didTimeout) {
if (didTimeout && null !== firstScheduledRoot) {
recomputeCurrentRendererTime();
didTimeout = firstScheduledRoot;
do {
var expirationTime = didTimeout.expirationTime;
0 !== expirationTime &&
currentRendererTime <= expirationTime &&
(didTimeout.nextExpirationTimeToWorkOn = currentRendererTime);
didTimeout = didTimeout.nextScheduledRoot;
} while (didTimeout !== firstScheduledRoot);
}
performWork(0, !0);
}
function performWork(minExpirationTime, isYieldy) {
findHighestPriorityRoot();
@@ -6832,7 +6830,10 @@ function performWork(minExpirationTime, isYieldy) {
null !== nextFlushedRoot &&
0 !== nextFlushedExpirationTime &&
minExpirationTime <= nextFlushedExpirationTime &&
!(didYield && currentRendererTime > nextFlushedExpirationTime);
!(
frameDeadline <= now$1() &&
currentRendererTime > nextFlushedExpirationTime
);
)
performWorkOnRoot(
@@ -6900,7 +6901,7 @@ function performWorkOnRoot(root, expirationTime, isYieldy) {
renderRoot(root, isYieldy),
(_finishedWork = root.finishedWork),
null !== _finishedWork &&
(shouldYieldToRenderer()
(frameDeadline <= now$1()
? (root.finishedWork = _finishedWork)
: completeRoot(root, _finishedWork, expirationTime)));
} else
@@ -7141,18 +7142,20 @@ var roots = new Map(),
maybeInstance = findHostInstance(this);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig =
var nativeTag =
maybeInstance._nativeTag || maybeInstance.canonical._nativeTag;
maybeInstance =
maybeInstance.viewConfig || maybeInstance.canonical.viewConfig;
nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
viewConfig.validAttributes
maybeInstance.validAttributes
);
null != nativeProps &&
UIManager.updateView(
maybeInstance._nativeTag,
viewConfig.uiViewClassName,
nativeTag,
maybeInstance.uiViewClassName,
nativeProps
);
}
@@ -7161,6 +7164,21 @@ var roots = new Map(),
})(React.Component);
})(findNodeHandle, findHostInstance),
findNodeHandle: findNodeHandle,
setNativeProps: function(handle, nativeProps) {
null != handle._nativeTag &&
((nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
handle.viewConfig.validAttributes
)),
null != nativeProps &&
UIManager.updateView(
handle._nativeTag,
handle.viewConfig.uiViewClassName,
nativeProps
));
},
render: function(element, containerTag, callback) {
var root = roots.get(containerTag);
if (!root) {
@@ -7251,17 +7269,20 @@ var roots = new Map(),
maybeInstance = findHostInstance(this);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig = maybeInstance.viewConfig;
var nativeTag =
maybeInstance._nativeTag || maybeInstance.canonical._nativeTag;
maybeInstance =
maybeInstance.viewConfig || maybeInstance.canonical.viewConfig;
nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
viewConfig.validAttributes
maybeInstance.validAttributes
);
null != nativeProps &&
UIManager.updateView(
maybeInstance._nativeTag,
viewConfig.uiViewClassName,
nativeTag,
maybeInstance.uiViewClassName,
nativeProps
);
}
@@ -7302,7 +7323,7 @@ var roots = new Map(),
findFiberByHostInstance: getInstanceFromTag,
getInspectorDataForViewTag: getInspectorDataForViewTag,
bundleType: 0,
version: "16.8.1",
version: "16.8.3",
rendererPackageName: "react-native-renderer"
});
var ReactNativeRenderer$2 = { default: ReactNativeRenderer },
@@ -3244,6 +3244,8 @@ function updateReducer(reducer) {
is(newState, hook.memoizedState) || (didReceiveUpdate = !0);
hook.memoizedState = newState;
hook.baseUpdate === queue.last && (hook.baseState = newState);
queue.eagerReducer = reducer;
queue.eagerState = newState;
return [newState, _dispatch];
}
}
@@ -3574,6 +3576,8 @@ function tryHydrate(fiber, nextInstance) {
(nextInstance = shim$1(nextInstance, fiber.pendingProps)),
null !== nextInstance ? ((fiber.stateNode = nextInstance), !0) : !1
);
case 13:
return !1;
default:
return !1;
}
@@ -4680,19 +4684,19 @@ function beginWork(current$$1, workInProgress, renderExpirationTime) {
null !== dependency &&
dependency.expirationTime < renderExpirationTime &&
(dependency.expirationTime = renderExpirationTime);
dependency = renderExpirationTime;
for (var node = oldValue.return; null !== node; ) {
dependency = node.alternate;
if (node.childExpirationTime < renderExpirationTime)
(node.childExpirationTime = renderExpirationTime),
null !== dependency &&
dependency.childExpirationTime <
renderExpirationTime &&
(dependency.childExpirationTime = renderExpirationTime);
var alternate = node.alternate;
if (node.childExpirationTime < dependency)
(node.childExpirationTime = dependency),
null !== alternate &&
alternate.childExpirationTime < dependency &&
(alternate.childExpirationTime = dependency);
else if (
null !== dependency &&
dependency.childExpirationTime < renderExpirationTime
null !== alternate &&
alternate.childExpirationTime < dependency
)
dependency.childExpirationTime = renderExpirationTime;
alternate.childExpirationTime = dependency;
else break;
node = node.return;
}
@@ -4822,12 +4826,11 @@ function beginWork(current$$1, workInProgress, renderExpirationTime) {
renderExpirationTime
)
);
default:
invariant(
!1,
"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue."
);
}
invariant(
!1,
"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue."
);
}
var valueCursor = { current: null },
currentlyRenderingFiber = null,
@@ -5164,7 +5167,7 @@ function logCapturedError(capturedError) {
: Error("Unspecified error at:" + componentStack);
ExceptionsManager.handleException(error, !1);
}
var PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set;
var PossiblyWeakSet$1 = "function" === typeof WeakSet ? WeakSet : Set;
function logError(boundary, errorInfo) {
var source = errorInfo.source,
stack = errorInfo.stack;
@@ -5377,7 +5380,7 @@ function commitPlacement(finishedWork) {
parentFiber.sibling.return = parentFiber.return;
for (
parentFiber = parentFiber.sibling;
5 !== parentFiber.tag && 6 !== parentFiber.tag;
5 !== parentFiber.tag && 6 !== parentFiber.tag && 18 !== parentFiber.tag;
) {
if (parentFiber.effectTag & 2) continue b;
@@ -5621,9 +5624,9 @@ function commitWork(current$$1, finishedWork) {
finishedWork.updateQueue = null;
var retryCache = finishedWork.stateNode;
null === retryCache &&
(retryCache = finishedWork.stateNode = new PossiblyWeakSet());
(retryCache = finishedWork.stateNode = new PossiblyWeakSet$1());
instance.forEach(function(thenable) {
var retry = retryTimedOutBoundary.bind(null, finishedWork, thenable);
var retry = resolveRetryThenable.bind(null, finishedWork, thenable);
retry = tracing.unstable_wrap(retry);
retryCache.has(thenable) ||
(retryCache.add(thenable), thenable.then(retry, retry));
@@ -5740,22 +5743,23 @@ function throwException(
sourceFiber.expirationTime = 1073741823;
return;
}
sourceFiber = root.pingCache;
null === sourceFiber
? ((sourceFiber = root.pingCache = new PossiblyWeakMap()),
(returnFiber = new Set()),
sourceFiber.set(thenable, returnFiber))
: ((returnFiber = sourceFiber.get(thenable)),
void 0 === returnFiber &&
((returnFiber = new Set()),
sourceFiber.set(thenable, returnFiber)));
returnFiber.has(renderExpirationTime) ||
(returnFiber.add(renderExpirationTime),
sourceFiber = root;
returnFiber = renderExpirationTime;
var pingCache = sourceFiber.pingCache;
null === pingCache
? ((pingCache = sourceFiber.pingCache = new PossiblyWeakMap()),
(current$$1 = new Set()),
pingCache.set(thenable, current$$1))
: ((current$$1 = pingCache.get(thenable)),
void 0 === current$$1 &&
((current$$1 = new Set()), pingCache.set(thenable, current$$1)));
current$$1.has(returnFiber) ||
(current$$1.add(returnFiber),
(sourceFiber = pingSuspendedRoot.bind(
null,
root,
sourceFiber,
thenable,
renderExpirationTime
returnFiber
)),
(sourceFiber = tracing.unstable_wrap(sourceFiber)),
thenable.then(sourceFiber, sourceFiber));
@@ -5803,21 +5807,21 @@ function throwException(
return;
case 1:
if (
((thenable = value),
(earliestTimeoutMs = root.type),
(startTimeMs = root.stateNode),
((earliestTimeoutMs = value),
(startTimeMs = root.type),
(sourceFiber = root.stateNode),
0 === (root.effectTag & 64) &&
("function" === typeof earliestTimeoutMs.getDerivedStateFromError ||
(null !== startTimeMs &&
"function" === typeof startTimeMs.componentDidCatch &&
("function" === typeof startTimeMs.getDerivedStateFromError ||
(null !== sourceFiber &&
"function" === typeof sourceFiber.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(startTimeMs)))))
!legacyErrorBoundariesThatAlreadyFailed.has(sourceFiber)))))
) {
root.effectTag |= 2048;
root.expirationTime = renderExpirationTime;
renderExpirationTime = createClassErrorUpdate(
root,
thenable,
earliestTimeoutMs,
renderExpirationTime
);
enqueueCapturedUpdate(root, renderExpirationTime);
@@ -5858,6 +5862,8 @@ function unwindWork(workInProgress) {
workInProgress)
: null
);
case 18:
return null;
case 4:
return popHostContainer(workInProgress), null;
case 10:
@@ -6132,6 +6138,7 @@ function commitPassiveEffects(root, firstEffect) {
isRendering = previousIsRendering;
previousIsRendering = root.expirationTime;
0 !== previousIsRendering && requestWork(root, previousIsRendering);
isBatchingUpdates || isRendering || performWork(1073741823, !1);
}
function flushPassiveEffects() {
if (null !== passiveEffectCallbackHandle) {
@@ -6453,6 +6460,8 @@ function completeUnitOfWork(workInProgress) {
case 17:
isContextProvider(current$$1.type) && popContext(current$$1);
break;
case 18:
break;
default:
invariant(
!1,
@@ -6607,7 +6616,7 @@ function renderRoot(root, isYieldy) {
do {
try {
if (isYieldy)
for (; null !== nextUnitOfWork && !shouldYieldToRenderer(); )
for (; null !== nextUnitOfWork && !(frameDeadline <= now$1()); )
nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
else
for (; null !== nextUnitOfWork; )
@@ -6788,7 +6797,7 @@ function pingSuspendedRoot(root, thenable, pingTime) {
0 !== pingTime && requestWork(root, pingTime);
}
}
function retryTimedOutBoundary(boundaryFiber, thenable) {
function resolveRetryThenable(boundaryFiber, thenable) {
var retryCache = boundaryFiber.stateNode;
null !== retryCache && retryCache.delete(thenable);
thenable = requestCurrentTime();
@@ -6911,7 +6920,7 @@ function onSuspend(
msUntilTimeout
) {
root.expirationTime = rootExpirationTime;
0 !== msUntilTimeout || shouldYieldToRenderer()
0 !== msUntilTimeout || frameDeadline <= now$1()
? 0 < msUntilTimeout &&
(root.timeoutHandle = scheduleTimeout(
onTimeout.bind(null, root, finishedWork, suspendedExpirationTime),
@@ -7011,27 +7020,19 @@ function findHighestPriorityRoot() {
nextFlushedRoot = highestPriorityRoot;
nextFlushedExpirationTime = highestPriorityWork;
}
var didYield = !1;
function shouldYieldToRenderer() {
return didYield ? !0 : frameDeadline <= now$1() ? (didYield = !0) : !1;
}
function performAsyncWork() {
try {
if (!shouldYieldToRenderer() && null !== firstScheduledRoot) {
recomputeCurrentRendererTime();
var root = firstScheduledRoot;
do {
var expirationTime = root.expirationTime;
0 !== expirationTime &&
currentRendererTime <= expirationTime &&
(root.nextExpirationTimeToWorkOn = currentRendererTime);
root = root.nextScheduledRoot;
} while (root !== firstScheduledRoot);
}
performWork(0, !0);
} finally {
didYield = !1;
function performAsyncWork(didTimeout) {
if (didTimeout && null !== firstScheduledRoot) {
recomputeCurrentRendererTime();
didTimeout = firstScheduledRoot;
do {
var expirationTime = didTimeout.expirationTime;
0 !== expirationTime &&
currentRendererTime <= expirationTime &&
(didTimeout.nextExpirationTimeToWorkOn = currentRendererTime);
didTimeout = didTimeout.nextScheduledRoot;
} while (didTimeout !== firstScheduledRoot);
}
performWork(0, !0);
}
function performWork(minExpirationTime, isYieldy) {
findHighestPriorityRoot();
@@ -7042,7 +7043,10 @@ function performWork(minExpirationTime, isYieldy) {
null !== nextFlushedRoot &&
0 !== nextFlushedExpirationTime &&
minExpirationTime <= nextFlushedExpirationTime &&
!(didYield && currentRendererTime > nextFlushedExpirationTime);
!(
frameDeadline <= now$1() &&
currentRendererTime > nextFlushedExpirationTime
);
)
performWorkOnRoot(
@@ -7110,7 +7114,7 @@ function performWorkOnRoot(root, expirationTime, isYieldy) {
renderRoot(root, isYieldy),
(_finishedWork = root.finishedWork),
null !== _finishedWork &&
(shouldYieldToRenderer()
(frameDeadline <= now$1()
? (root.finishedWork = _finishedWork)
: completeRoot(root, _finishedWork, expirationTime)));
} else
@@ -7351,18 +7355,20 @@ var roots = new Map(),
maybeInstance = findHostInstance(this);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig =
var nativeTag =
maybeInstance._nativeTag || maybeInstance.canonical._nativeTag;
maybeInstance =
maybeInstance.viewConfig || maybeInstance.canonical.viewConfig;
nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
viewConfig.validAttributes
maybeInstance.validAttributes
);
null != nativeProps &&
UIManager.updateView(
maybeInstance._nativeTag,
viewConfig.uiViewClassName,
nativeTag,
maybeInstance.uiViewClassName,
nativeProps
);
}
@@ -7371,6 +7377,21 @@ var roots = new Map(),
})(React.Component);
})(findNodeHandle, findHostInstance),
findNodeHandle: findNodeHandle,
setNativeProps: function(handle, nativeProps) {
null != handle._nativeTag &&
((nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
handle.viewConfig.validAttributes
)),
null != nativeProps &&
UIManager.updateView(
handle._nativeTag,
handle.viewConfig.uiViewClassName,
nativeProps
));
},
render: function(element, containerTag, callback) {
var root = roots.get(containerTag);
if (!root) {
@@ -7466,17 +7487,20 @@ var roots = new Map(),
maybeInstance = findHostInstance(this);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig = maybeInstance.viewConfig;
var nativeTag =
maybeInstance._nativeTag || maybeInstance.canonical._nativeTag;
maybeInstance =
maybeInstance.viewConfig || maybeInstance.canonical.viewConfig;
nativeProps = diffProperties(
null,
emptyObject,
nativeProps,
viewConfig.validAttributes
maybeInstance.validAttributes
);
null != nativeProps &&
UIManager.updateView(
maybeInstance._nativeTag,
viewConfig.uiViewClassName,
nativeTag,
maybeInstance.uiViewClassName,
nativeProps
);
}
@@ -7517,7 +7541,7 @@ var roots = new Map(),
findFiberByHostInstance: getInstanceFromTag,
getInspectorDataForViewTag: getInspectorDataForViewTag,
bundleType: 0,
version: "16.8.1",
version: "16.8.3",
rendererPackageName: "react-native-renderer"
});
var ReactNativeRenderer$2 = { default: ReactNativeRenderer },
@@ -131,6 +131,7 @@ type SecretInternalsFabricType = {
export type ReactNativeType = {
NativeComponent: typeof ReactNativeComponent,
findNodeHandle(componentOrHandle: any): ?number,
setNativeProps(handle: any, nativeProps: Object): void,
render(
element: React$Element<any>,
containerTag: any,
@@ -146,6 +147,7 @@ export type ReactNativeType = {
export type ReactFabricType = {
NativeComponent: typeof ReactNativeComponent,
findNodeHandle(componentOrHandle: any): ?number,
setNativeProps(handle: any, nativeProps: Object): void,
render(
element: React$Element<any>,
containerTag: any,
@@ -43,6 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) BOOL blurOnSubmit;
@property (nonatomic, assign) BOOL selectTextOnFocus;
@property (nonatomic, assign) BOOL clearTextOnFocus;
@property (nonatomic, assign) BOOL secureTextEntry;
@property (nonatomic, copy) RCTTextSelection *selection;
@property (nonatomic, strong, nullable) NSNumber *maxLength;
@property (nonatomic, copy) NSAttributedString *attributedText;
@@ -141,9 +141,9 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
[attributedTextCopy removeAttribute:RCTTextAttributesTagAttributeName
range:NSMakeRange(0, attributedTextCopy.length)];
textNeedsUpdate = ([self textOf:attributedTextCopy equals:backedTextInputViewTextCopy] == NO);
if (eventLag == 0 && textNeedsUpdate) {
UITextRange *selection = self.backedTextInputView.selectedTextRange;
NSInteger oldTextLength = self.backedTextInputView.attributedText.string.length;
@@ -203,9 +203,65 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
{
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
if (@available(iOS 10.0, *)) {
static dispatch_once_t onceToken;
static NSDictionary<NSString *, NSString *> *contentTypeMap;
dispatch_once(&onceToken, ^{
contentTypeMap = @{@"none": @"",
@"URL": UITextContentTypeURL,
@"addressCity": UITextContentTypeAddressCity,
@"addressCityAndState":UITextContentTypeAddressCityAndState,
@"addressState": UITextContentTypeAddressState,
@"countryName": UITextContentTypeCountryName,
@"creditCardNumber": UITextContentTypeCreditCardNumber,
@"emailAddress": UITextContentTypeEmailAddress,
@"familyName": UITextContentTypeFamilyName,
@"fullStreetAddress": UITextContentTypeFullStreetAddress,
@"givenName": UITextContentTypeGivenName,
@"jobTitle": UITextContentTypeJobTitle,
@"location": UITextContentTypeLocation,
@"middleName": UITextContentTypeMiddleName,
@"name": UITextContentTypeName,
@"namePrefix": UITextContentTypeNamePrefix,
@"nameSuffix": UITextContentTypeNameSuffix,
@"nickname": UITextContentTypeNickname,
@"organizationName": UITextContentTypeOrganizationName,
@"postalCode": UITextContentTypePostalCode,
@"streetAddressLine1": UITextContentTypeStreetAddressLine1,
@"streetAddressLine2": UITextContentTypeStreetAddressLine2,
@"sublocality": UITextContentTypeSublocality,
@"telephoneNumber": UITextContentTypeTelephoneNumber,
};
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
if (@available(iOS 11.0, tvOS 11.0, *)) {
NSDictionary<NSString *, NSString *> * iOS11extras = @{@"username": UITextContentTypeUsername,
@"password": UITextContentTypePassword};
NSMutableDictionary<NSString *, NSString *> * iOS11baseMap = [contentTypeMap mutableCopy];
[iOS11baseMap addEntriesFromDictionary:iOS11extras];
contentTypeMap = [iOS11baseMap copy];
}
#endif
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 120000 /* __IPHONE_12_0 */
if (@available(iOS 12.0, tvOS 12.0, *)) {
NSDictionary<NSString *, NSString *> * iOS12extras = @{@"newPassword": UITextContentTypeNewPassword,
@"oneTimeCode": UITextContentTypeOneTimeCode};
NSMutableDictionary<NSString *, NSString *> * iOS12baseMap = [contentTypeMap mutableCopy];
[iOS12baseMap addEntriesFromDictionary:iOS12extras];
contentTypeMap = [iOS12baseMap copy];
}
#endif
});
// Setting textContentType to an empty string will disable any
// default behaviour, like the autofill bar for password inputs
self.backedTextInputView.textContentType = [type isEqualToString:@"none"] ? @"" : type;
self.backedTextInputView.textContentType = contentTypeMap[type] ?: type;
}
#endif
}
@@ -227,6 +283,24 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
}
}
- (BOOL)secureTextEntry {
return self.backedTextInputView.secureTextEntry;
}
- (void)setSecureTextEntry:(BOOL)secureTextEntry {
UIView<RCTBackedTextInputViewProtocol> *textInputView = self.backedTextInputView;
if (textInputView.secureTextEntry != secureTextEntry) {
textInputView.secureTextEntry = secureTextEntry;
// Fix #5859, see https://stackoverflow.com/questions/14220187/uitextfield-has-trailing-whitespace-after-securetextentry-toggle/22537788#22537788
NSAttributedString *originalText = [textInputView.attributedText copy];
self.backedTextInputView.attributedText = [NSAttributedString new];
self.backedTextInputView.attributedText = originalText;
}
}
#pragma mark - RCTBackedTextInputDelegate
- (BOOL)textInputShouldBeginEditing
@@ -43,12 +43,12 @@ RCT_REMAP_VIEW_PROPERTY(keyboardAppearance, backedTextInputView.keyboardAppearan
RCT_REMAP_VIEW_PROPERTY(placeholder, backedTextInputView.placeholder, NSString)
RCT_REMAP_VIEW_PROPERTY(placeholderTextColor, backedTextInputView.placeholderColor, UIColor)
RCT_REMAP_VIEW_PROPERTY(returnKeyType, backedTextInputView.returnKeyType, UIReturnKeyType)
RCT_REMAP_VIEW_PROPERTY(secureTextEntry, backedTextInputView.secureTextEntry, BOOL)
RCT_REMAP_VIEW_PROPERTY(selectionColor, backedTextInputView.tintColor, UIColor)
RCT_REMAP_VIEW_PROPERTY(spellCheck, backedTextInputView.spellCheckingType, UITextSpellCheckingType)
RCT_REMAP_VIEW_PROPERTY(caretHidden, backedTextInputView.caretHidden, BOOL)
RCT_REMAP_VIEW_PROPERTY(clearButtonMode, backedTextInputView.clearButtonMode, UITextFieldViewMode)
RCT_REMAP_VIEW_PROPERTY(scrollEnabled, backedTextInputView.scrollEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(secureTextEntry, BOOL)
RCT_EXPORT_VIEW_PROPERTY(blurOnSubmit, BOOL)
RCT_EXPORT_VIEW_PROPERTY(clearTextOnFocus, BOOL)
RCT_EXPORT_VIEW_PROPERTY(keyboardType, UIKeyboardType)
+1 -1
View File
@@ -1688,7 +1688,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n$SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js\n";
shellScript = "export EXTRA_PACKAGER_ARGS=\"--reactNativePath $SRCROOT/../\"\nexport NODE_BINARY=node\n$SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -39,7 +39,7 @@ RCT_TEST(ViewExample)
RCT_TEST(LayoutExample)
RCT_TEST(ARTExample)
RCT_TEST(ScrollViewExample)
RCT_TEST(TextExample)
//RCT_TEST(TextExample)
#if !TARGET_OS_TV
// No switch or slider available on tvOS
RCT_TEST(SwitchExample)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

After

Width:  |  Height:  |  Size: 309 KiB

+3 -2
View File
@@ -69,7 +69,8 @@ project.ext.react = [
bundleAssetName: "RNTesterApp.android.bundle",
entryFile: file("../../js/RNTesterApp.android.js"),
root: "$rootDir",
inputExcludes: ["android/**", "./**", ".gradle/**"]
inputExcludes: ["android/**", "./**", ".gradle/**"],
extraPackagerArgs: ["--reactNativePath", "$rootDir"]
]
apply from: "../../../react.gradle"
@@ -101,7 +102,7 @@ android {
defaultConfig {
applicationId "com.facebook.react.uiapp"
minSdkVersion 16
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
+9 -8
View File
@@ -27,33 +27,34 @@ describe('DatePickerIOS', () => {
it('Should change indicator with datetime picker', async () => {
await openExampleWithTitle('Date and time picker');
const testID = 'date-and-time';
const indicatorID = 'date-and-time-indicator';
const testElement = await element(
by.type('UIPickerView').withAncestor(by.id(testID)),
);
const indicator = await element(by.id(indicatorID));
const dateIndicator = await element(by.id('date-indicator'));
const timeIndicator = await element(by.id('time-indicator'));
await expect(testElement).toBeVisible();
await expect(indicator).toBeVisible();
await expect(dateIndicator).toBeVisible();
await expect(timeIndicator).toBeVisible();
await testElement.setColumnToValue(0, 'Dec 4');
await testElement.setColumnToValue(1, '4');
await testElement.setColumnToValue(2, '10');
await testElement.setColumnToValue(3, 'AM');
await expect(indicator).toHaveText('12/4/2005 4:10 AM');
await expect(dateIndicator).toHaveText('12/4/2005');
await expect(timeIndicator).toHaveText('4:10 AM');
});
it('Should change indicator with date-only picker', async () => {
await openExampleWithTitle('Date only');
await openExampleWithTitle('Date only picker');
const testID = 'date-only';
const indicatorID = 'date-and-time-indicator';
const testElement = await element(
by.type('UIPickerView').withAncestor(by.id(testID)),
);
const indicator = await element(by.id(indicatorID));
const indicator = await element(by.id('date-indicator'));
await expect(testElement).toBeVisible();
await expect(indicator).toBeVisible();
@@ -62,6 +63,6 @@ describe('DatePickerIOS', () => {
await testElement.setColumnToValue(1, '3');
await testElement.setColumnToValue(2, '2006');
await expect(indicator).toHaveText('11/3/2006 4:10 AM');
await expect(indicator).toHaveText('11/3/2006');
});
});
@@ -111,6 +111,31 @@ class AccessibilityAndroidExample extends React.Component {
</View>
</RNTesterBlock>
<RNTesterBlock title="Touchable with accessibilityRole = header">
<View
accessible={true}
accessibilityLabel="I'm a header, so I read it instead of embedded text."
accessibilityRole="header">
<Text style={{color: 'green'}}>This is</Text>
<Text style={{color: 'blue'}}>
nontouchable accessible view with label.
</Text>
</View>
</RNTesterBlock>
<RNTesterBlock title="Touchable with accessibilityRole = link">
<TouchableWithoutFeedback
onPress={() =>
ToastAndroid.show('Toasts work by default', ToastAndroid.SHORT)
}
accessibilityRole="link">
<View style={styles.embedded}>
<Text>Click me</Text>
<Text>Or not</Text>
</View>
</TouchableWithoutFeedback>
</RNTesterBlock>
<RNTesterBlock title="Touchable with accessibilityRole = button">
<TouchableWithoutFeedback
onPress={() =>
+13 -34
View File
@@ -12,11 +12,10 @@
const React = require('react');
const ReactNative = require('react-native');
const {DatePickerIOS, StyleSheet, Text, TextInput, View} = ReactNative;
const {DatePickerIOS, StyleSheet, Text, View} = ReactNative;
type State = {|
date: Date,
timeZoneOffsetInHours: number,
|};
type Props = {|
@@ -26,43 +25,25 @@ type Props = {|
class WithDatePickerData extends React.Component<Props, State> {
state = {
date: new Date(),
timeZoneOffsetInHours: (-1 * new Date().getTimezoneOffset()) / 60,
};
onDateChange = date => {
this.setState({date: date});
};
onTimezoneChange = event => {
const offset = parseInt(event.nativeEvent.text, 10);
if (isNaN(offset)) {
return;
}
this.setState({timeZoneOffsetInHours: offset});
};
render() {
// Ideally, the timezone input would be a picker rather than a
// text input, but we don't have any pickers yet :(
return (
<View>
<WithLabel label="Value:">
<Text testID="date-and-time-indicator">
{this.state.date.toLocaleDateString() +
' ' +
this.state.date.toLocaleTimeString([], {
hour: '2-digit',
minute: '2-digit',
})}
<Text testID="date-indicator">
{this.state.date.toLocaleDateString()}
</Text>
<Text testID="time-indicator">
{this.state.date.toLocaleTimeString([], {
hour: '2-digit',
minute: '2-digit',
})}
</Text>
</WithLabel>
<WithLabel label="Timezone:">
<TextInput
onChange={this.onTimezoneChange}
style={styles.textinput}
value={this.state.timeZoneOffsetInHours.toString()}
/>
<Text> hours from UTC</Text>
</WithLabel>
{this.props.children(this.state, this.onDateChange)}
</View>
@@ -124,7 +105,6 @@ exports.examples = [
testID="date-and-time"
date={state.date}
mode="datetime"
timeZoneOffsetInMinutes={state.timeZoneOffsetInHours * 60}
onDateChange={onDateChange}
/>
)}
@@ -142,7 +122,6 @@ exports.examples = [
testID="date-only"
date={state.date}
mode="date"
timeZoneOffsetInMinutes={state.timeZoneOffsetInHours * 60}
onDateChange={onDateChange}
/>
)}
@@ -151,16 +130,16 @@ exports.examples = [
},
},
{
title: 'Time only picker, 10-minute interval',
title: 'Picker with 20-minute interval',
render: function(): React.Element<any> {
return (
<WithDatePickerData>
{(state, onDateChange) => (
<DatePickerIOS
testID="time-only"
testID="date-and-time-with-interval"
date={state.date}
mode="time"
timeZoneOffsetInMinutes={state.timeZoneOffsetInHours * 60}
minuteInterval={20}
mode="datetime"
onDateChange={onDateChange}
/>
)}
+9 -1
View File
@@ -325,6 +325,12 @@ class TextExample extends React.Component<{}> {
right right right right right right right right right right right
right right
</Text>
<Text style={{textAlign: 'justify'}}>
justify (works when api level >= 26 otherwise fallbacks to "left"):
this text component{"'"}s contents are laid out with "textAlign:
justify" and as you can see all of the lines except the last one
span the available width of the parent container.
</Text>
</RNTesterBlock>
<RNTesterBlock title="Unicode">
<View>
@@ -615,11 +621,13 @@ class TextExample extends React.Component<{}> {
Works with other text styles
</Text>
</RNTesterBlock>
<RNTesterBlock title="Substring Emoji (should only see 'test')">
<Text>{'test🙃'.substring(0, 5)}</Text>
</RNTesterBlock>
</RNTesterPage>
);
}
}
const styles = StyleSheet.create({
backgroundColorText: {
left: 5,
+6
View File
@@ -428,6 +428,12 @@ exports.examples = [
);
},
},
{
title: "Substring Emoji (should only see 'test')",
render: function() {
return <Text>{'test🙃'.substring(0, 5)}</Text>;
},
},
{
title: 'Text metrics',
render: function() {
+40 -1
View File
@@ -212,7 +212,11 @@ class SecureEntryExample extends React.Component<$FlowFixMeProps, any> {
* comment and run Flow. */
constructor(props) {
super(props);
this.state = {text: ''};
this.state = {
text: '',
password: '',
isSecureTextEntry: true,
};
}
render() {
return (
@@ -225,6 +229,26 @@ class SecureEntryExample extends React.Component<$FlowFixMeProps, any> {
value={this.state.text}
/>
<Text>Current text is: {this.state.text}</Text>
<View
style={{
flex: 1,
flexDirection: 'row',
}}>
<TextInput
style={styles.default}
defaultValue="cde"
onChangeText={text => this.setState({password: text})}
secureTextEntry={this.state.isSecureTextEntry}
value={this.state.password}
/>
<Switch
onValueChange={value => {
this.setState({isSecureTextEntry: value});
}}
style={{marginLeft: 4}}
value={this.state.isSecureTextEntry}
/>
</View>
</View>
);
}
@@ -1085,4 +1109,19 @@ exports.examples = [
);
},
},
{
title: 'Text Content Type',
render: function() {
return (
<View>
<WithLabel label="emailAddress">
<TextInput textContentType="emailAddress" style={styles.default} />
</WithLabel>
<WithLabel label="name">
<TextInput textContentType="name" style={styles.default} />
</WithLabel>
</View>
);
},
},
];
+7
View File
@@ -66,6 +66,7 @@ Pod::Spec.new do |s|
"React/Views/RCTSlider*",
"React/Views/RCTSwitch*",
"React/Views/RCTWebView*"
ss.compiler_flags = folly_compiler_flags
ss.header_dir = "React"
ss.framework = "JavaScriptCore"
ss.libraries = "stdc++"
@@ -116,6 +117,8 @@ Pod::Spec.new do |s|
ss.dependency "React/cxxreact"
ss.dependency "React/jsi"
ss.dependency "Folly", folly_version
ss.dependency "DoubleConversion"
ss.dependency "glog"
ss.compiler_flags = folly_compiler_flags
ss.source_files = "ReactCommon/jsiexecutor/jsireact/*.{cpp,h}"
ss.private_header_files = "ReactCommon/jsiexecutor/jsireact/*.h"
@@ -125,6 +128,8 @@ Pod::Spec.new do |s|
s.subspec "jsi" do |ss|
ss.dependency "Folly", folly_version
ss.dependency "DoubleConversion"
ss.dependency "glog"
ss.compiler_flags = folly_compiler_flags
ss.source_files = "ReactCommon/jsi/*.{cpp,h}"
ss.private_header_files = "ReactCommon/jsi/*.h"
@@ -142,6 +147,8 @@ Pod::Spec.new do |s|
ss.dependency "React/jsinspector"
ss.dependency "boost-for-react-native", "1.63.0"
ss.dependency "Folly", folly_version
ss.dependency "DoubleConversion"
ss.dependency "glog"
ss.compiler_flags = folly_compiler_flags
ss.source_files = "ReactCommon/cxxreact/*.{cpp,h}"
ss.exclude_files = "ReactCommon/cxxreact/SampleCxxModule.*"
+2
View File
@@ -292,6 +292,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
* Any thread
*/
dispatch_async(dispatch_get_main_queue(), ^{
// WARNING: Invalidation is async, so it may not finish before re-setting up the bridge,
// causing some issues. TODO: revisit this post-Fabric/TurboModule.
[self invalidate];
// Reload is a special case, do not preserve launchOptions and treat reload as a fresh start
self->_launchOptions = nil;
+4 -6
View File
@@ -708,13 +708,11 @@ UIImage *__nullable RCTImageFromLocalAssetURL(NSURL *imageURL)
if (!image) {
// Attempt to load from the file system
NSData *fileData;
if (imageURL.pathExtension.length == 0) {
fileData = [NSData dataWithContentsOfURL:[imageURL URLByAppendingPathExtension:@"png"]];
} else {
fileData = [NSData dataWithContentsOfURL:imageURL];
NSString *filePath = [NSString stringWithUTF8String:[imageURL fileSystemRepresentation]];
if (filePath.pathExtension.length == 0) {
filePath = [filePath stringByAppendingPathExtension:@"png"];
}
image = [UIImage imageWithData:fileData];
image = [UIImage imageWithContentsOfFile:filePath];
}
if (!image && !bundle) {
+2 -2
View File
@@ -21,8 +21,8 @@ static void __makeVersion()
{
__rnVersion = @{
RCTVersionMajor: @(0),
RCTVersionMinor: @(0),
RCTVersionPatch: @(0),
RCTVersionMinor: @(59),
RCTVersionPatch: @(1),
RCTVersionPrerelease: [NSNull null],
};
}
+3 -1
View File
@@ -357,7 +357,9 @@ struct RCTInstanceCallback : public InstanceCallback {
dispatch_group_leave(prepareBridge);
} onProgress:^(RCTLoadingProgress *progressData) {
#if RCT_DEV && __has_include("RCTDevLoadingView.h")
RCTDevLoadingView *loadingView = [weakSelf moduleForClass:[RCTDevLoadingView class]];
// Note: RCTDevLoadingView should have been loaded at this point, so no need to allow lazy loading.
RCTDevLoadingView *loadingView = [weakSelf moduleForName:RCTBridgeModuleNameForClass([RCTDevLoadingView class])
lazilyLoadIfNecessary:NO];
[loadingView updateProgress:progressData];
#endif
}];
@@ -201,7 +201,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
[self abort:@"Websocket exception"
withCause:error];
}
if (!_closed) {
if (!_closed && [error code] != ECONNREFUSED) {
[self reconnect];
}
}
-6
View File
@@ -985,7 +985,6 @@
59EDBCC61FDF4E55003573DE /* (null) in Copy Headers */ = {isa = PBXBuildFile; };
59EDBCC71FDF4E55003573DE /* RCTScrollView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA31FDF4E0C003573DE /* RCTScrollView.h */; };
59EDBCC81FDF4E55003573DE /* RCTScrollViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA51FDF4E0C003573DE /* RCTScrollViewManager.h */; };
5CE2080220772F7D009A43B3 /* YGConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CE2080020772F7C009A43B3 /* YGConfig.cpp */; };
5CE2080320772F7D009A43B3 /* YGConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE2080120772F7C009A43B3 /* YGConfig.h */; };
657734841EE834C900A0E9EA /* RCTInspectorDevServerHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 657734821EE834C900A0E9EA /* RCTInspectorDevServerHelper.h */; };
657734851EE834C900A0E9EA /* RCTInspectorDevServerHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 657734831EE834C900A0E9EA /* RCTInspectorDevServerHelper.mm */; };
@@ -1047,13 +1046,11 @@
A2440AA21DF8D854006E7BFC /* RCTReloadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; };
A2440AA31DF8D854006E7BFC /* RCTReloadCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = A2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */; };
A2440AA41DF8D865006E7BFC /* RCTReloadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; };
AC4A6AF921FB4EA900FBEC39 /* YGMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC4A6AF821FB4EA900FBEC39 /* YGMarker.cpp */; };
AC4A6AFA21FB4EBF00FBEC39 /* YGMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC4A6AF821FB4EA900FBEC39 /* YGMarker.cpp */; };
AC4A6AFB21FB4ECA00FBEC39 /* YGMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC4A6AF821FB4EA900FBEC39 /* YGMarker.cpp */; };
AC52CEDE21FB3FF9003C6BEC /* instrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = AC52CEDD21FB3FF9003C6BEC /* instrumentation.h */; };
AC52CEDF21FB401D003C6BEC /* instrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = AC52CEDD21FB3FF9003C6BEC /* instrumentation.h */; };
AC52CEE021FB403B003C6BEC /* instrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = AC52CEDD21FB3FF9003C6BEC /* instrumentation.h */; };
AC6B69E321B1467C00B2B68A /* YGValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC6B69E121B1467C00B2B68A /* YGValue.cpp */; };
AC6B69E421B1467C00B2B68A /* YGValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6B69E221B1467C00B2B68A /* YGValue.h */; };
AC6B69E521B1469A00B2B68A /* YGValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6B69E221B1467C00B2B68A /* YGValue.h */; };
AC6B69E621B146A500B2B68A /* YGValue.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = AC6B69E221B1467C00B2B68A /* YGValue.h */; };
@@ -4427,7 +4424,6 @@
352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */,
66CD94B71F1045E700CB3C7C /* RCTMaskedViewManager.m in Sources */,
008341F61D1DB34400876D9A /* RCTJSStackFrame.m in Sources */,
AC4A6AF921FB4EA900FBEC39 /* YGMarker.cpp in Sources */,
13134C961E296B2A00B9F3CB /* RCTObjcExecutor.mm in Sources */,
59D031FB1F8353D3008361F0 /* RCTSafeAreaViewManager.m in Sources */,
83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */,
@@ -4459,7 +4455,6 @@
13134C8E1E296B2A00B9F3CB /* RCTMessageThread.mm in Sources */,
599FAA381FB274980058CCF6 /* RCTSurface.mm in Sources */,
59D031EF1F8353D3008361F0 /* RCTSafeAreaShadowView.m in Sources */,
AC6B69E321B1467C00B2B68A /* YGValue.cpp in Sources */,
3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */,
14F3620E1AABD06A001CE568 /* RCTSwitchManager.m in Sources */,
13B080201A69489C00A75B9A /* RCTActivityIndicatorViewManager.m in Sources */,
@@ -4516,7 +4511,6 @@
13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */,
83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */,
130443C61E401A8C00D93A67 /* RCTConvert+Transform.m in Sources */,
5CE2080220772F7D009A43B3 /* YGConfig.cpp in Sources */,
191E3EC11C29DC3800C180A6 /* RCTRefreshControl.m in Sources */,
3DCE532B1FEAB23100613583 /* RCTDatePickerManager.m in Sources */,
13C156051AB1A2840079392D /* RCTWebView.m in Sources */,
+1 -1
View File
@@ -274,7 +274,7 @@ android {
defaultConfig {
minSdkVersion(16)
targetSdkVersion(27)
targetSdkVersion(28)
versionCode(1)
versionName("1.0")
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0-master
VERSION_NAME=0.59.1
GROUP=com.facebook.react
POM_NAME=ReactNative
@@ -1,7 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.facebook.react">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application />
</manifest>
@@ -34,10 +34,12 @@ public interface ReactPackage {
* @param reactContext react application context that can be used to create modules
* @return list of native modules to register with the newly created catalyst instance
*/
@Nonnull
List<NativeModule> createNativeModules(@Nonnull ReactApplicationContext reactContext);
/**
* @return a list of view managers that should be registered with {@link UIManagerModule}
*/
@Nonnull
List<ViewManager> createViewManagers(@Nonnull ReactApplicationContext reactContext);
}
@@ -7,6 +7,7 @@
package com.facebook.react.modules.core;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import android.net.Uri;
@@ -27,7 +28,7 @@ import com.facebook.react.module.annotations.ReactModule;
public class DeviceEventManagerModule extends ReactContextBaseJavaModule {
public static final String NAME = "DeviceEventManager";
public interface RCTDeviceEventEmitter extends JavaScriptModule {
void emit(String eventName, @Nullable Object data);
void emit(@Nonnull String eventName, @Nullable Object data);
}
private final Runnable mInvokeDefaultBackPressRunnable;
@@ -8,6 +8,7 @@ rn_android_library(
],
deps = [
react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"),
react_native_dep("third-party/android/support/v4:lib-support-v4"),
react_native_dep("third-party/java/infer-annotations:infer-annotations"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_target("java/com/facebook/react/bridge:bridge"),
@@ -9,6 +9,7 @@ package com.facebook.react.modules.location;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
@@ -16,6 +17,7 @@ import android.location.LocationProvider;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.content.ContextCompat;
import com.facebook.common.logging.FLog;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Callback;
@@ -193,7 +195,7 @@ public class LocationModule extends ReactContextBaseJavaModule {
}
@Nullable
private static String getValidProvider(LocationManager locationManager, boolean highAccuracy) {
private String getValidProvider(LocationManager locationManager, boolean highAccuracy) {
String provider =
highAccuracy ? LocationManager.GPS_PROVIDER : LocationManager.NETWORK_PROVIDER;
if (!locationManager.isProviderEnabled(provider)) {
@@ -204,6 +206,11 @@ public class LocationModule extends ReactContextBaseJavaModule {
return null;
}
}
// If it's an enabled provider, but we don't have permissions, ignore it
int finePermission = ContextCompat.checkSelfPermission(getReactApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION);
if (provider.equals(LocationManager.GPS_PROVIDER) && finePermission != PackageManager.PERMISSION_GRANTED) {
return null;
}
return provider;
}
@@ -56,7 +56,10 @@ public class ForwardingCookieHandler extends CookieHandler {
@Override
public Map<String, List<String>> get(URI uri, Map<String, List<String>> headers)
throws IOException {
String cookies = getCookieManager().getCookie(uri.toString());
CookieManager cookieManager = getCookieManager();
if (cookieManager == null) return Collections.emptyMap();
String cookies = cookieManager.getCookie(uri.toString());
if (TextUtils.isEmpty(cookies)) {
return Collections.emptyMap();
}
@@ -80,7 +83,10 @@ public class ForwardingCookieHandler extends CookieHandler {
new GuardedResultAsyncTask<Boolean>(mContext) {
@Override
protected Boolean doInBackgroundGuarded() {
getCookieManager().removeAllCookie();
CookieManager cookieManager = getCookieManager();
if (cookieManager != null) {
cookieManager.removeAllCookie();
}
mCookieSaver.onCookiesModified();
return true;
}
@@ -96,31 +102,40 @@ public class ForwardingCookieHandler extends CookieHandler {
}
private void clearCookiesAsync(final Callback callback) {
getCookieManager().removeAllCookies(
new ValueCallback<Boolean>() {
@Override
public void onReceiveValue(Boolean value) {
mCookieSaver.onCookiesModified();
callback.invoke(value);
}
});
CookieManager cookieManager = getCookieManager();
if (cookieManager != null) {
cookieManager.removeAllCookies(
new ValueCallback<Boolean>() {
@Override
public void onReceiveValue(Boolean value) {
mCookieSaver.onCookiesModified();
callback.invoke(value);
}
});
}
}
public void destroy() {
if (USES_LEGACY_STORE) {
getCookieManager().removeExpiredCookie();
CookieManager cookieManager = getCookieManager();
if (cookieManager != null) {
cookieManager.removeExpiredCookie();
}
mCookieSaver.persistCookies();
}
}
private void addCookies(final String url, final List<String> cookies) {
final CookieManager cookieManager = getCookieManager();
if (cookieManager == null) return;
if (USES_LEGACY_STORE) {
runInBackground(
new Runnable() {
@Override
public void run() {
for (String cookie : cookies) {
getCookieManager().setCookie(url, cookie);
cookieManager.setCookie(url, cookie);
}
mCookieSaver.onCookiesModified();
}
@@ -129,14 +144,17 @@ public class ForwardingCookieHandler extends CookieHandler {
for (String cookie : cookies) {
addCookieAsync(url, cookie);
}
getCookieManager().flush();
cookieManager.flush();
mCookieSaver.onCookiesModified();
}
}
@TargetApi(21)
private void addCookieAsync(String url, String cookie) {
getCookieManager().setCookie(url, cookie, null);
CookieManager cookieManager = getCookieManager();
if (cookieManager != null) {
cookieManager.setCookie(url, cookie, null);
}
}
private static boolean isCookieHeader(String name) {
@@ -156,10 +174,15 @@ public class ForwardingCookieHandler extends CookieHandler {
* Instantiating CookieManager in KitKat+ will load the Chromium task taking a 100ish ms so we
* do it lazily to make sure it's done on a background thread as needed.
*/
private CookieManager getCookieManager() {
private @Nullable CookieManager getCookieManager() {
if (mCookieManager == null) {
possiblyWorkaroundSyncManager(mContext);
mCookieManager = CookieManager.getInstance();
try {
mCookieManager = CookieManager.getInstance();
} catch (IllegalArgumentException ex) {
// https://bugs.chromium.org/p/chromium/issues/detail?id=559720
return null;
}
if (USES_LEGACY_STORE) {
mCookieManager.removeExpiredCookie();
@@ -228,7 +251,10 @@ public class ForwardingCookieHandler extends CookieHandler {
@TargetApi(21)
private void flush() {
getCookieManager().flush();
CookieManager cookieManager = getCookieManager();
if (cookieManager != null) {
cookieManager.flush();
}
}
}
}
@@ -372,7 +372,13 @@ public final class NetworkingModule extends ReactContextBaseJavaModule {
return;
}
} else {
requestBody = RequestBody.create(contentMediaType, body);
// Use getBytes() to convert the body into a byte[], preventing okhttp from
// appending the character set to the Content-Type header when otherwise unspecified
// https://github.com/facebook/react-native/issues/8237
Charset charset = contentMediaType == null
? StandardCharsets.UTF_8
: contentMediaType.charset(StandardCharsets.UTF_8);
requestBody = RequestBody.create(contentMediaType, body.getBytes(charset));
}
} else if (data.hasKey(REQUEST_BODY_KEY_BASE64)) {
if (contentType == null) {
@@ -16,7 +16,7 @@ import java.util.Map;
public class ReactNativeVersion {
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
"major", 0,
"minor", 0,
"patch", 0,
"minor", 59,
"patch", 1,
"prerelease", null);
}
@@ -9,6 +9,9 @@ import android.content.Context;
import android.support.v4.view.AccessibilityDelegateCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat;
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.CollectionItemInfoCompat;
import android.text.SpannableString;
import android.text.style.URLSpan;
import android.view.View;
import com.facebook.react.R;
import java.util.Locale;
@@ -98,7 +101,6 @@ public class AccessibilityDelegateUtil {
public void onInitializeAccessibilityNodeInfo(
View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
setRole(info, accessibilityRole, view.getContext());
if (!(accessibilityHint == null)) {
String contentDescription=(String)info.getContentDescription();
if (contentDescription != null) {
@@ -108,6 +110,8 @@ public class AccessibilityDelegateUtil {
info.setContentDescription(accessibilityHint);
}
}
setRole(info, accessibilityRole, view.getContext());
}
});
}
@@ -127,6 +131,18 @@ public class AccessibilityDelegateUtil {
if (Locale.getDefault().getLanguage().equals(new Locale("en").getLanguage())) {
if (role.equals(AccessibilityRole.LINK)) {
nodeInfo.setRoleDescription(context.getString(R.string.link_description));
if (nodeInfo.getContentDescription() != null) {
SpannableString spannable = new SpannableString(nodeInfo.getContentDescription());
spannable.setSpan(new URLSpan(""), 0, spannable.length(), 0);
nodeInfo.setContentDescription(spannable);
}
if (nodeInfo.getText() != null) {
SpannableString spannable = new SpannableString(nodeInfo.getText());
spannable.setSpan(new URLSpan(""), 0, spannable.length(), 0);
nodeInfo.setText(spannable);
}
}
if (role.equals(AccessibilityRole.SEARCH)) {
nodeInfo.setRoleDescription(context.getString(R.string.search_description));
@@ -140,6 +156,12 @@ public class AccessibilityDelegateUtil {
if (role.equals(AccessibilityRole.ADJUSTABLE)) {
nodeInfo.setRoleDescription(context.getString(R.string.adjustable_description));
}
if (role.equals(AccessibilityRole.HEADER)) {
nodeInfo.setRoleDescription(context.getString(R.string.header_description));
final AccessibilityNodeInfoCompat.CollectionItemInfoCompat itemInfo =
AccessibilityNodeInfoCompat.CollectionItemInfoCompat.obtain(0, 1, 0, 1, true);
nodeInfo.setCollectionItemInfo(itemInfo);
}
}
if (role.equals(AccessibilityRole.IMAGEBUTTON)) {
nodeInfo.setClickable(true);
@@ -15,7 +15,9 @@ import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.AccessibilityDelegateUtil.AccessibilityRole;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.util.ReactFindViewUtil;
import java.util.Locale;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* Base class that should be suitable for the majority of subclasses of {@link ViewManager}.
@@ -58,12 +60,12 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
private static double[] sTransformDecompositionArray = new double[16];
@ReactProp(name = PROP_BACKGROUND_COLOR, defaultInt = Color.TRANSPARENT, customType = "Color")
public void setBackgroundColor(T view, int backgroundColor) {
public void setBackgroundColor(@Nonnull T view, int backgroundColor) {
view.setBackgroundColor(backgroundColor);
}
@ReactProp(name = PROP_TRANSFORM)
public void setTransform(T view, ReadableArray matrix) {
public void setTransform(@Nonnull T view, @Nullable ReadableArray matrix) {
if (matrix == null) {
resetTransformProperty(view);
} else {
@@ -72,20 +74,17 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
}
@ReactProp(name = ViewProps.OPACITY, defaultFloat = 1.f)
public void setOpacity(T view, float opacity) {
public void setOpacity(@Nonnull T view, float opacity) {
view.setAlpha(opacity);
}
@ReactProp(name = PROP_ELEVATION)
public void setElevation(T view, float elevation) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
view.setElevation(PixelUtil.toPixelFromDIP(elevation));
}
// Do nothing on API < 21
public void setElevation(@Nonnull T view, float elevation) {
ViewCompat.setElevation(view, PixelUtil.toPixelFromDIP(elevation));
}
@ReactProp(name = PROP_Z_INDEX)
public void setZIndex(T view, float zIndex) {
public void setZIndex(@Nonnull T view, float zIndex) {
int integerZIndex = Math.round(zIndex);
ViewGroupManager.setViewZIndex(view, integerZIndex);
ViewParent parent = view.getParent();
@@ -95,12 +94,12 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
}
@ReactProp(name = PROP_RENDER_TO_HARDWARE_TEXTURE)
public void setRenderToHardwareTexture(T view, boolean useHWTexture) {
public void setRenderToHardwareTexture(@Nonnull T view, boolean useHWTexture) {
view.setLayerType(useHWTexture ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE, null);
}
@ReactProp(name = PROP_TEST_ID)
public void setTestId(T view, String testId) {
public void setTestId(@Nonnull T view, String testId) {
view.setTag(R.id.react_test_id, testId);
// temporarily set the tag and keyed tags to avoid end to end test regressions
@@ -108,28 +107,28 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
}
@ReactProp(name = PROP_NATIVE_ID)
public void setNativeId(T view, String nativeId) {
public void setNativeId(@Nonnull T view, String nativeId) {
view.setTag(R.id.view_tag_native_id, nativeId);
ReactFindViewUtil.notifyViewRendered(view);
}
@ReactProp(name = PROP_ACCESSIBILITY_LABEL)
public void setAccessibilityLabel(T view, String accessibilityLabel) {
public void setAccessibilityLabel(@Nonnull T view, String accessibilityLabel) {
view.setContentDescription(accessibilityLabel);
}
@ReactProp(name = PROP_ACCESSIBILITY_COMPONENT_TYPE)
public void setAccessibilityComponentType(T view, String accessibilityComponentType) {
public void setAccessibilityComponentType(@Nonnull T view, String accessibilityComponentType) {
AccessibilityHelper.updateAccessibilityComponentType(view, accessibilityComponentType);
}
@ReactProp(name = PROP_ACCESSIBILITY_HINT)
public void setAccessibilityHint(T view, String accessibilityHint) {
public void setAccessibilityHint(@Nonnull T view, String accessibilityHint) {
view.setTag(R.id.accessibility_hint, accessibilityHint);
}
@ReactProp(name = PROP_ACCESSIBILITY_ROLE)
public void setAccessibilityRole(T view, String accessibilityRole) {
public void setAccessibilityRole(@Nonnull T view, @Nullable String accessibilityRole) {
if (accessibilityRole == null) {
return;
}
@@ -138,7 +137,7 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
}
@ReactProp(name = PROP_ACCESSIBILITY_STATES)
public void setViewStates(T view, ReadableArray accessibilityStates) {
public void setViewStates(@Nonnull T view, @Nullable ReadableArray accessibilityStates) {
view.setSelected(false);
view.setEnabled(true);
if (accessibilityStates == null) {
@@ -155,7 +154,7 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
}
@ReactProp(name = PROP_IMPORTANT_FOR_ACCESSIBILITY)
public void setImportantForAccessibility(T view, String importantForAccessibility) {
public void setImportantForAccessibility(@Nonnull T view, @Nullable String importantForAccessibility) {
if (importantForAccessibility == null || importantForAccessibility.equals("auto")) {
ViewCompat.setImportantForAccessibility(view, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
} else if (importantForAccessibility.equals("yes")) {
@@ -169,48 +168,46 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
@Deprecated
@ReactProp(name = PROP_ROTATION)
public void setRotation(T view, float rotation) {
public void setRotation(@Nonnull T view, float rotation) {
view.setRotation(rotation);
}
@Deprecated
@ReactProp(name = PROP_SCALE_X, defaultFloat = 1f)
public void setScaleX(T view, float scaleX) {
public void setScaleX(@Nonnull T view, float scaleX) {
view.setScaleX(scaleX);
}
@Deprecated
@ReactProp(name = PROP_SCALE_Y, defaultFloat = 1f)
public void setScaleY(T view, float scaleY) {
public void setScaleY(@Nonnull T view, float scaleY) {
view.setScaleY(scaleY);
}
@Deprecated
@ReactProp(name = PROP_TRANSLATE_X, defaultFloat = 0f)
public void setTranslateX(T view, float translateX) {
public void setTranslateX(@Nonnull T view, float translateX) {
view.setTranslationX(PixelUtil.toPixelFromDIP(translateX));
}
@Deprecated
@ReactProp(name = PROP_TRANSLATE_Y, defaultFloat = 0f)
public void setTranslateY(T view, float translateY) {
public void setTranslateY(@Nonnull T view, float translateY) {
view.setTranslationY(PixelUtil.toPixelFromDIP(translateY));
}
@ReactProp(name = PROP_ACCESSIBILITY_LIVE_REGION)
public void setAccessibilityLiveRegion(T view, String liveRegion) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
public void setAccessibilityLiveRegion(@Nonnull T view, @Nullable String liveRegion) {
if (liveRegion == null || liveRegion.equals("none")) {
view.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_NONE);
ViewCompat.setAccessibilityLiveRegion(view, ViewCompat.ACCESSIBILITY_LIVE_REGION_NONE);
} else if (liveRegion.equals("polite")) {
view.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_POLITE);
ViewCompat.setAccessibilityLiveRegion(view, ViewCompat.ACCESSIBILITY_LIVE_REGION_POLITE);
} else if (liveRegion.equals("assertive")) {
view.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_ASSERTIVE);
ViewCompat.setAccessibilityLiveRegion(view, ViewCompat.ACCESSIBILITY_LIVE_REGION_ASSERTIVE);
}
}
}
private static void setTransformProperty(View view, ReadableArray transforms) {
private static void setTransformProperty(@Nonnull View view, ReadableArray transforms) {
TransformHelper.processTransform(transforms, sTransformDecompositionArray);
MatrixMathHelper.decomposeMatrix(sTransformDecompositionArray, sMatrixDecompositionContext);
view.setTranslationX(
@@ -246,7 +243,7 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
}
}
private static void resetTransformProperty(View view) {
private static void resetTransformProperty(@Nonnull View view) {
view.setTranslationX(PixelUtil.toPixelFromDIP(0));
view.setTranslationY(PixelUtil.toPixelFromDIP(0));
view.setRotation(0);
@@ -257,12 +254,12 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
view.setCameraDistance(0);
}
private void updateViewAccessibility(T view) {
private void updateViewAccessibility(@Nonnull T view) {
AccessibilityDelegateUtil.setDelegate(view);
}
@Override
protected void onAfterUpdateTransaction(T view) {
protected void onAfterUpdateTransaction(@Nonnull T view) {
super.onAfterUpdateTransaction(view);
updateViewAccessibility(view);
}
@@ -20,6 +20,8 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
import com.facebook.react.uimanager.annotations.ReactPropertyHolder;
import com.facebook.yoga.YogaMeasureMode;
import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
@@ -31,7 +33,7 @@ import javax.annotation.Nullable;
public abstract class ViewManager<T extends View, C extends ReactShadowNode>
extends BaseJavaModule {
public final void updateProperties(T viewToUpdate, ReactStylesDiffMap props) {
public final void updateProperties(@Nonnull T viewToUpdate, ReactStylesDiffMap props) {
ViewManagerPropertyUpdater.updateProps(this, viewToUpdate, props);
onAfterUpdateTransaction(viewToUpdate);
}
@@ -39,8 +41,8 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
/**
* Creates a view and installs event emitters on it.
*/
public final T createView(
ThemedReactContext reactContext,
public final @Nonnull T createView(
@Nonnull ThemedReactContext reactContext,
JSResponderHandler jsResponderHandler) {
T view = createViewInstance(reactContext);
addEventEmitters(reactContext, view);
@@ -54,7 +56,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
* @return the name of this view manager. This will be the name used to reference this view
* manager from JavaScript in createReactNativeComponentClass.
*/
public abstract String getName();
public abstract @Nonnull String getName();
/**
* This method should return a subclass of {@link ReactShadowNode} which will be then used for
@@ -65,7 +67,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
throw new RuntimeException("ViewManager subclasses must implement createShadowNodeInstance()");
}
public C createShadowNodeInstance(ReactApplicationContext context) {
public @Nonnull C createShadowNodeInstance(@Nonnull ReactApplicationContext context) {
return createShadowNodeInstance();
}
@@ -85,13 +87,13 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
* Subclasses should return a new View instance of the proper type.
* @param reactContext
*/
protected abstract T createViewInstance(ThemedReactContext reactContext);
protected abstract @Nonnull T createViewInstance(@Nonnull ThemedReactContext reactContext);
/**
* Called when view is detached from view hierarchy and allows for some additional cleanup by
* the {@link ViewManager} subclass.
*/
public void onDropViewInstance(T view) {
public void onDropViewInstance(@Nonnull T view) {
}
/**
@@ -99,7 +101,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
* might want to override this method if your view needs to emit events besides basic touch events
* to JS (e.g. scroll events).
*/
protected void addEventEmitters(ThemedReactContext reactContext, T view) {
protected void addEventEmitters(@Nonnull ThemedReactContext reactContext, @Nonnull T view) {
}
/**
@@ -108,7 +110,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
* you want to override this method you should call super.onAfterUpdateTransaction from it as
* the parent class of the ViewManager may rely on callback being executed.
*/
protected void onAfterUpdateTransaction(T view) {
protected void onAfterUpdateTransaction(@Nonnull T view) {
}
/**
@@ -122,7 +124,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
*
* TODO(7247021): Replace updateExtraData with generic update props mechanism after D2086999
*/
public abstract void updateExtraData(T root, Object extraData);
public abstract void updateExtraData(@Nonnull T root, Object extraData);
/**
* Subclasses may use this method to receive events/commands directly from JS through the
@@ -133,7 +135,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
* @param commandId code of the command
* @param args optional arguments for the command
*/
public void receiveCommand(T root, int commandId, @Nullable ReadableArray args) {
public void receiveCommand(@Nonnull T root, int commandId, @Nullable ReadableArray args) {
}
/**
@@ -209,7 +211,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
/**
*
*/
public @Nullable Object updateLocalData(T view, ReactStylesDiffMap props, ReactStylesDiffMap localData) {
public @Nullable Object updateLocalData(@Nonnull T view, ReactStylesDiffMap props, ReactStylesDiffMap localData) {
return null;
}
@@ -9,6 +9,8 @@ rn_android_library(
],
deps = [
YOGA_TARGET,
react_native_dep("third-party/android/support/v4:lib-support-v4"),
react_native_dep("third-party/android/support/v7/appcompat-orig:appcompat"),
react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"),
react_native_dep("third-party/java/infer-annotations:infer-annotations"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
@@ -265,6 +265,9 @@ public abstract class ReactBaseTextShadowNode extends LayoutShadowNode {
protected int mTextAlign = Gravity.NO_GRAVITY;
protected int mTextBreakStrategy =
(Build.VERSION.SDK_INT < Build.VERSION_CODES.M) ? 0 : Layout.BREAK_STRATEGY_HIGH_QUALITY;
protected int mJustificationMode =
(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) ? 0 : Layout.JUSTIFICATION_MODE_NONE;
protected TextTransform mTextTransform = TextTransform.UNSET;
protected float mTextShadowOffsetDx = 0;
protected float mTextShadowOffsetDy = 0;
@@ -357,19 +360,28 @@ public abstract class ReactBaseTextShadowNode extends LayoutShadowNode {
@ReactProp(name = ViewProps.TEXT_ALIGN)
public void setTextAlign(@Nullable String textAlign) {
if (textAlign == null || "auto".equals(textAlign)) {
mTextAlign = Gravity.NO_GRAVITY;
} else if ("left".equals(textAlign)) {
mTextAlign = Gravity.LEFT;
} else if ("right".equals(textAlign)) {
mTextAlign = Gravity.RIGHT;
} else if ("center".equals(textAlign)) {
mTextAlign = Gravity.CENTER_HORIZONTAL;
} else if ("justify".equals(textAlign)) {
// Fallback gracefully for cross-platform compat instead of error
if ("justify".equals(textAlign)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mJustificationMode = Layout.JUSTIFICATION_MODE_INTER_WORD;
}
mTextAlign = Gravity.LEFT;
} else {
throw new JSApplicationIllegalArgumentException("Invalid textAlign: " + textAlign);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mJustificationMode = Layout.JUSTIFICATION_MODE_NONE;
}
if (textAlign == null || "auto".equals(textAlign)) {
mTextAlign = Gravity.NO_GRAVITY;
} else if ("left".equals(textAlign)) {
mTextAlign = Gravity.LEFT;
} else if ("right".equals(textAlign)) {
mTextAlign = Gravity.RIGHT;
} else if ("center".equals(textAlign)) {
mTextAlign = Gravity.CENTER_HORIZONTAL;
} else {
throw new JSApplicationIllegalArgumentException("Invalid textAlign: " + textAlign);
}
}
markUpdated();
}
@@ -99,14 +99,18 @@ public class ReactTextShadowNode extends ReactBaseTextShadowNode {
new StaticLayout(
text, textPaint, hintWidth, alignment, 1.f, 0.f, mIncludeFontPadding);
} else {
layout =
StaticLayout.Builder builder =
StaticLayout.Builder.obtain(text, 0, text.length(), textPaint, hintWidth)
.setAlignment(alignment)
.setLineSpacing(0.f, 1.f)
.setIncludePad(mIncludeFontPadding)
.setBreakStrategy(mTextBreakStrategy)
.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NORMAL)
.build();
.setAlignment(alignment)
.setLineSpacing(0.f, 1.f)
.setIncludePad(mIncludeFontPadding)
.setBreakStrategy(mTextBreakStrategy)
.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NORMAL);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
builder.setJustificationMode(mJustificationMode);
}
layout = builder.build();
}
} else if (boring != null && (unconstrainedWidth || boring.width <= width)) {
@@ -217,7 +221,8 @@ public class ReactTextShadowNode extends ReactBaseTextShadowNode {
getPadding(Spacing.END),
getPadding(Spacing.BOTTOM),
getTextAlign(),
mTextBreakStrategy);
mTextBreakStrategy,
mJustificationMode);
uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), reactTextUpdate);
}
}
@@ -26,6 +26,7 @@ public class ReactTextUpdate {
private final float mPaddingBottom;
private final int mTextAlign;
private final int mTextBreakStrategy;
private final int mJustificationMode;
/**
* @deprecated Use a non-deprecated constructor for ReactTextUpdate instead. This one remains
@@ -49,7 +50,8 @@ public class ReactTextUpdate {
paddingEnd,
paddingBottom,
textAlign,
Layout.BREAK_STRATEGY_HIGH_QUALITY);
Layout.BREAK_STRATEGY_HIGH_QUALITY,
Layout.JUSTIFICATION_MODE_NONE);
}
public ReactTextUpdate(
@@ -61,7 +63,8 @@ public class ReactTextUpdate {
float paddingEnd,
float paddingBottom,
int textAlign,
int textBreakStrategy) {
int textBreakStrategy,
int justificationMode) {
mText = text;
mJsEventCounter = jsEventCounter;
mContainsImages = containsImages;
@@ -71,6 +74,7 @@ public class ReactTextUpdate {
mPaddingBottom = paddingBottom;
mTextAlign = textAlign;
mTextBreakStrategy = textBreakStrategy;
mJustificationMode = justificationMode;
}
public Spannable getText() {
@@ -108,4 +112,8 @@ public class ReactTextUpdate {
public int getTextBreakStrategy() {
return mTextBreakStrategy;
}
public int getJustificationMode() {
return mJustificationMode;
}
}
@@ -10,13 +10,13 @@ package com.facebook.react.views.text;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.v7.widget.AppCompatTextView;
import android.text.Layout;
import android.text.Spannable;
import android.text.Spanned;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.TextView;
import com.facebook.common.logging.FLog;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.uimanager.ReactCompoundView;
@@ -24,7 +24,7 @@ import com.facebook.react.uimanager.ViewDefaults;
import com.facebook.react.views.view.ReactViewBackgroundManager;
import javax.annotation.Nullable;
public class ReactTextView extends TextView implements ReactCompoundView {
public class ReactTextView extends AppCompatTextView implements ReactCompoundView {
private static final ViewGroup.LayoutParams EMPTY_LAYOUT_PARAMS =
new ViewGroup.LayoutParams(0, 0);
@@ -72,6 +72,11 @@ public class ReactTextView extends TextView implements ReactCompoundView {
setBreakStrategy(update.getTextBreakStrategy());
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (getJustificationMode() != update.getJustificationMode()) {
setJustificationMode(update.getJustificationMode());
}
}
}
@Override
@@ -82,8 +82,10 @@ public class ReactTextViewManager
// TODO add textBreakStrategy prop into local Data
int textBreakStrategy = Layout.BREAK_STRATEGY_HIGH_QUALITY;
return
new ReactTextUpdate(
// TODO add justificationMode prop into local Data
int justificationMode = Layout.JUSTIFICATION_MODE_NONE;
return new ReactTextUpdate(
spanned,
-1, // TODO add this into local Data?
false, // TODO add this into local Data
@@ -92,7 +94,8 @@ public class ReactTextViewManager
textViewProps.getEndPadding(),
textViewProps.getBottomPadding(),
textViewProps.getTextAlign(),
textBreakStrategy
textBreakStrategy,
justificationMode
);
}
@@ -50,6 +50,8 @@ public class TextAttributeProps {
protected int mTextAlign = Gravity.NO_GRAVITY;
protected int mTextBreakStrategy =
(Build.VERSION.SDK_INT < Build.VERSION_CODES.M) ? 0 : Layout.BREAK_STRATEGY_HIGH_QUALITY;
protected int mJustificationMode =
(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) ? 0 : Layout.JUSTIFICATION_MODE_NONE;
protected TextTransform mTextTransform = TextTransform.UNSET;
protected float mTextShadowOffsetDx = 0;
@@ -204,19 +206,28 @@ public class TextAttributeProps {
}
public void setTextAlign(@Nullable String textAlign) {
if (textAlign == null || "auto".equals(textAlign)) {
mTextAlign = Gravity.NO_GRAVITY;
} else if ("left".equals(textAlign)) {
mTextAlign = Gravity.LEFT;
} else if ("right".equals(textAlign)) {
mTextAlign = Gravity.RIGHT;
} else if ("center".equals(textAlign)) {
mTextAlign = Gravity.CENTER_HORIZONTAL;
} else if ("justify".equals(textAlign)) {
// Fallback gracefully for cross-platform compat instead of error
if ("justify".equals(textAlign)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mJustificationMode = Layout.JUSTIFICATION_MODE_INTER_WORD;
}
mTextAlign = Gravity.LEFT;
} else {
throw new JSApplicationIllegalArgumentException("Invalid textAlign: " + textAlign);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mJustificationMode = Layout.JUSTIFICATION_MODE_NONE;
}
if (textAlign == null || "auto".equals(textAlign)) {
mTextAlign = Gravity.NO_GRAVITY;
} else if ("left".equals(textAlign)) {
mTextAlign = Gravity.LEFT;
} else if ("right".equals(textAlign)) {
mTextAlign = Gravity.RIGHT;
} else if ("center".equals(textAlign)) {
mTextAlign = Gravity.CENTER_HORIZONTAL;
} else {
throw new JSApplicationIllegalArgumentException("Invalid textAlign: " + textAlign);
}
}
}
@@ -10,10 +10,12 @@ package com.facebook.react.views.textinput;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import android.text.Editable;
import android.text.InputFilter;
import android.text.InputType;
import android.text.Layout;
import android.text.Spannable;
import android.text.TextWatcher;
import android.util.TypedValue;
@@ -279,6 +281,24 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
}
}
@ReactProp(name = "importantForAutofill")
public void setImportantForAutofill(ReactEditText view, @Nullable String value) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return;
}
int mode = View.IMPORTANT_FOR_AUTOFILL_AUTO;
if ("no".equals(value)) {
mode = View.IMPORTANT_FOR_AUTOFILL_NO;
} else if ("noExcludeDescendants".equals(value)) {
mode = View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS;
} else if ("yes".equals(value)) {
mode = View.IMPORTANT_FOR_AUTOFILL_YES;
} else if ("yesExcludeDescendants".equals(value)) {
mode = View.IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS;
}
view.setImportantForAutofill(mode);
}
@ReactProp(name = "onSelectionChange", defaultBoolean = false)
public void setOnSelectionChange(final ReactEditText view, boolean onSelectionChange) {
if (onSelectionChange) {
@@ -435,19 +455,28 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
@ReactProp(name = ViewProps.TEXT_ALIGN)
public void setTextAlign(ReactEditText view, @Nullable String textAlign) {
if (textAlign == null || "auto".equals(textAlign)) {
view.setGravityHorizontal(Gravity.NO_GRAVITY);
} else if ("left".equals(textAlign)) {
view.setGravityHorizontal(Gravity.LEFT);
} else if ("right".equals(textAlign)) {
view.setGravityHorizontal(Gravity.RIGHT);
} else if ("center".equals(textAlign)) {
view.setGravityHorizontal(Gravity.CENTER_HORIZONTAL);
} else if ("justify".equals(textAlign)) {
// Fallback gracefully for cross-platform compat instead of error
if ("justify".equals(textAlign)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
view.setJustificationMode(Layout.JUSTIFICATION_MODE_INTER_WORD);
}
view.setGravityHorizontal(Gravity.LEFT);
} else {
throw new JSApplicationIllegalArgumentException("Invalid textAlign: " + textAlign);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
view.setJustificationMode(Layout.JUSTIFICATION_MODE_NONE);
}
if (textAlign == null || "auto".equals(textAlign)) {
view.setGravityHorizontal(Gravity.NO_GRAVITY);
} else if ("left".equals(textAlign)) {
view.setGravityHorizontal(Gravity.LEFT);
} else if ("right".equals(textAlign)) {
view.setGravityHorizontal(Gravity.RIGHT);
} else if ("center".equals(textAlign)) {
view.setGravityHorizontal(Gravity.CENTER_HORIZONTAL);
} else {
throw new JSApplicationIllegalArgumentException("Invalid textAlign: " + textAlign);
}
}
}
@@ -528,6 +557,41 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
view.setFilters(newFilters);
}
@ReactProp(name = "autoComplete")
public void setTextContentType(ReactEditText view, @Nullable String autocomplete) {
if (autocomplete == null) {
view.setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO);
} else if ("username".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_USERNAME);
} else if ("password".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_PASSWORD);
} else if ("email".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_EMAIL_ADDRESS);
} else if ("name".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_NAME);
} else if ("tel".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_PHONE);
} else if ("street-address".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_POSTAL_ADDRESS);
} else if ("postal-code".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_POSTAL_CODE);
} else if ("cc-number".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_CREDIT_CARD_NUMBER);
} else if ("cc-csc".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE);
} else if ("cc-exp".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE);
} else if ("cc-exp-month".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH);
} else if ("cc-exp-year".equals(autocomplete)) {
view.setAutofillHints(View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR);
} else if ("off".equals(autocomplete)) {
view.setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO);
} else {
throw new JSApplicationIllegalArgumentException("Invalid autocomplete option: " + autocomplete);
}
}
@ReactProp(name = "autoCorrect")
public void setAutoCorrect(ReactEditText view, @Nullable Boolean autoCorrect) {
// clear auto correct flags, set SUGGESTIONS or NO_SUGGESTIONS depending on value
@@ -204,7 +204,8 @@ public class ReactTextInputShadowNode extends ReactBaseTextShadowNode
getPadding(Spacing.RIGHT),
getPadding(Spacing.BOTTOM),
mTextAlign,
mTextBreakStrategy);
mTextBreakStrategy,
mJustificationMode);
uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), reactTextUpdate);
}
}
@@ -20,4 +20,8 @@
name="adjustable_description"
translatable="false"
>Adjustable</string>
<string
name="header_description"
translatable="false"
>Heading</string>
</resources>
@@ -18,6 +18,7 @@ import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.common.StandardCharsets;
import com.facebook.react.common.network.OkHttpCallUtil;
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;
@@ -247,7 +248,7 @@ public class NetworkingModuleTest {
body.putString("string", "This is request body");
mockEvents();
networkingModule.sendRequest(
"POST",
"http://somedomain/bar",
@@ -309,6 +310,131 @@ public class NetworkingModuleTest {
assertThat(requestHeaders.get("User-Agent")).isEqualTo("React test agent/1.0");
}
@Test
public void testPostJsonContentTypeHeader() throws Exception {
OkHttpClient httpClient = mock(OkHttpClient.class);
when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Call callMock = mock(Call.class);
return callMock;
}
});
OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);
when(clientBuilder.build()).thenReturn(httpClient);
when(httpClient.newBuilder()).thenReturn(clientBuilder);
NetworkingModule networkingModule =
new NetworkingModule(mock(ReactApplicationContext.class), "", httpClient);
JavaOnlyMap body = new JavaOnlyMap();
body.putString("string", "{ \"key\": \"value\" }");
networkingModule.sendRequest(
"POST",
"http://somedomain/bar",
0,
JavaOnlyArray.of(JavaOnlyArray.of("Content-Type", "application/json")),
body,
/* responseType */ "text",
/* useIncrementalUpdates*/ true,
/* timeout */ 0,
/* withCredentials */ false);
ArgumentCaptor<Request> argumentCaptor = ArgumentCaptor.forClass(Request.class);
verify(httpClient).newCall(argumentCaptor.capture());
// Verify okhttp does not append "charset=utf-8"
assertThat(argumentCaptor.getValue().body().contentType().toString()).isEqualTo("application/json");
}
@Test
public void testRespectsExistingCharacterSet() throws Exception {
RCTDeviceEventEmitter emitter = mock(RCTDeviceEventEmitter.class);
ReactApplicationContext context = mock(ReactApplicationContext.class);
when(context.getJSModule(any(Class.class))).thenReturn(emitter);
OkHttpClient httpClient = mock(OkHttpClient.class);
when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Call callMock = mock(Call.class);
return callMock;
}
});
OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);
when(clientBuilder.build()).thenReturn(httpClient);
when(httpClient.newBuilder()).thenReturn(clientBuilder);
NetworkingModule networkingModule = new NetworkingModule(context, "", httpClient);
JavaOnlyMap body = new JavaOnlyMap();
body.putString("string", "Friðjónsson");
mockEvents();
networkingModule.sendRequest(
"POST",
"http://somedomain/bar",
0,
JavaOnlyArray.of(JavaOnlyArray.of("Content-Type", "text/plain; charset=utf-16")),
body,
/* responseType */ "text",
/* useIncrementalUpdates*/ true,
/* timeout */ 0,
/* withCredentials */ false);
ArgumentCaptor<Request> argumentCaptor = ArgumentCaptor.forClass(Request.class);
verify(httpClient).newCall(argumentCaptor.capture());
Buffer contentBuffer = new Buffer();
argumentCaptor.getValue().body().writeTo(contentBuffer);
assertThat(contentBuffer.readString(StandardCharsets.UTF_16)).isEqualTo("Friðjónsson");
}
@Test
public void testGracefullyRecoversFromInvalidContentType() throws Exception {
RCTDeviceEventEmitter emitter = mock(RCTDeviceEventEmitter.class);
ReactApplicationContext context = mock(ReactApplicationContext.class);
when(context.getJSModule(any(Class.class))).thenReturn(emitter);
OkHttpClient httpClient = mock(OkHttpClient.class);
when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Call callMock = mock(Call.class);
return callMock;
}
});
OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);
when(clientBuilder.build()).thenReturn(httpClient);
when(httpClient.newBuilder()).thenReturn(clientBuilder);
NetworkingModule networkingModule = new NetworkingModule(context, "", httpClient);
JavaOnlyMap body = new JavaOnlyMap();
body.putString("string", "test");
mockEvents();
networkingModule.sendRequest(
"POST",
"http://somedomain/bar",
0,
JavaOnlyArray.of(JavaOnlyArray.of("Content-Type", "invalid")),
body,
/* responseType */ "text",
/* useIncrementalUpdates*/ true,
/* timeout */ 0,
/* withCredentials */ false);
ArgumentCaptor<Request> argumentCaptor = ArgumentCaptor.forClass(Request.class);
verify(httpClient).newCall(argumentCaptor.capture());
Buffer contentBuffer = new Buffer();
argumentCaptor.getValue().body().writeTo(contentBuffer);
assertThat(contentBuffer.readString(StandardCharsets.UTF_8)).isEqualTo("test");
assertThat(argumentCaptor.getValue().header("Content-Type")).isEqualTo("invalid");
}
@Test
public void testMultipartPostRequestSimple() throws Exception {
PowerMockito.mockStatic(RequestBodyUtil.class);
@@ -15,6 +15,7 @@ import static org.mockito.Mockito.mock;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.text.Layout;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.AbsoluteSizeSpan;
@@ -419,6 +420,21 @@ public class ReactTextTest {
assertThat(textView.getEllipsize()).isEqualTo(TextUtils.TruncateAt.END);
}
@TargetApi(Build.VERSION_CODES.O)
@Test
public void testTextAlignJustifyApplied() {
UIManagerModule uiManager = getUIManagerModule();
ReactRootView rootView = createText(
uiManager,
JavaOnlyMap.of("textAlign", "justify"),
JavaOnlyMap.of(ReactRawTextShadowNode.PROP_TEXT, "test text"));
TextView textView = (TextView) rootView.getChildAt(0);
assertThat(textView.getText().toString()).isEqualTo("test text");
assertThat(textView.getJustificationMode()).isEqualTo(Layout.JUSTIFICATION_MODE_INTER_WORD);
}
/**
* Make sure TextView has exactly one span and that span has given type.
*/
@@ -9,8 +9,10 @@ package com.facebook.react.views.textinput;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.os.Build;
import android.text.InputType;
import android.text.InputFilter;
import android.text.Layout;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.inputmethod.EditorInfo;
@@ -344,6 +346,10 @@ public class ReactTextInputPropertyTest {
assertThat(view.getGravity() & Gravity.HORIZONTAL_GRAVITY_MASK).isEqualTo(Gravity.CENTER_HORIZONTAL);
mManager.updateProperties(view, buildStyles("textAlign", null));
assertThat(view.getGravity() & Gravity.HORIZONTAL_GRAVITY_MASK).isEqualTo(defaultHorizontalGravity);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mManager.updateProperties(view, buildStyles("textAlign", "justify"));
assertThat(view.getJustificationMode()).isEqualTo(Layout.JUSTIFICATION_MODE_INTER_WORD);
}
// TextAlignVertical
mManager.updateProperties(view, buildStyles("textAlignVertical", "top"));
+3 -7
View File
@@ -238,14 +238,10 @@ class JSCRuntime : public jsi::Runtime {
// JSStringRef utilities
namespace {
std::string JSStringToSTLString(JSStringRef str) {
std::string result;
size_t maxBytes = JSStringGetMaximumUTF8CStringSize(str);
result.resize(maxBytes);
size_t bytesWritten = JSStringGetUTF8CString(str, &result[0], maxBytes);
// JSStringGetUTF8CString writes the null terminator, so we want to resize
// to `bytesWritten - 1` so that `result` has the correct length.
result.resize(bytesWritten - 1);
return result;
std::vector<char> buffer(maxBytes);
JSStringGetUTF8CString(str, buffer.data(), maxBytes);
return std::string(buffer.data());
}
JSStringRef getLengthString() {
+1 -1
View File
@@ -10,7 +10,7 @@ buildscript {
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.3.0")
classpath("com.android.tools.build:gradle:3.3.1")
classpath("de.undercouch:gradle-download-task:3.4.3")
// NOTE: Do not place your application dependencies here; they belong
+2 -1
View File
@@ -25,7 +25,8 @@ if (REACT_NATIVE_CI) {
function getPlugins() {
try {
// @todo do not rely on private files
const findPlugins = require('@react-native-community/cli/build/core/findPlugins');
const findPlugins = require('@react-native-community/cli/build/core/findPlugins')
.default;
return findPlugins(path.resolve(__dirname, pluginsPath));
} catch (e) {
+9 -8
View File
@@ -1,6 +1,6 @@
{
"name": "react-native",
"version": "1000.0.0",
"version": "0.59.1",
"description": "A framework for building native apps using React",
"license": "MIT",
"repository": {
@@ -109,6 +109,7 @@
"cli.js",
"flow",
"init.sh",
"local-cli",
"scripts/ios-configure-glog.sh",
"scripts/ios-install-third-party.sh",
"scripts/launchPackager.bat",
@@ -132,7 +133,7 @@
"template"
],
"scripts": {
"start": "node cli.js start",
"start": "node cli.js start --reactNativePath .",
"test": "jest",
"test-ci": "jest --maxWorkers=2 --ci --reporters=\"default\" --reporters=\"jest-junit\"",
"flow": "flow",
@@ -154,11 +155,11 @@
"test-ios-e2e": "detox test -c ios.sim.release"
},
"peerDependencies": {
"react": "16.8.1"
"react": "16.8.3"
},
"dependencies": {
"@babel/runtime": "^7.0.0",
"@react-native-community/cli": "^1.1.0",
"@react-native-community/cli": "^1.2.1",
"absolute-path": "^0.0.0",
"art": "^0.10.0",
"base64-js": "^1.1.2",
@@ -227,13 +228,13 @@
"eslint-plugin-react-hooks": "^1.0.1",
"eslint-plugin-react-native": "3.5.0",
"flow-bin": "^0.92.0",
"jest": "24.0.0-alpha.6",
"jest": "24.1.0",
"jest-junit": "5.2.0",
"jscodeshift": "^0.6.2",
"prettier": "1.13.6",
"react": "16.8.1",
"react": "16.8.3",
"react-native-dummy": "0.2.0",
"react-test-renderer": "16.8.1",
"react-test-renderer": "16.8.3",
"shelljs": "^0.7.8"
},
"detox": {
@@ -255,4 +256,4 @@
}
}
}
}
}
+6 -6
View File
@@ -17,18 +17,18 @@ function getAndroidPackages {
# Package names can be obtained using `sdkmanager --list`
if [ ! -e "$DEPS" ] || [ ! "$CI" ]; then
echo "Installing Android API level $ANDROID_SDK_TARGET_API_LEVEL, Google APIs, $AVD_ABI system image..."
sdkmanager "system-images;android-$ANDROID_SDK_TARGET_API_LEVEL;google_apis;$AVD_ABI"
echo y | sdkmanager "system-images;android-$ANDROID_SDK_TARGET_API_LEVEL;google_apis;$AVD_ABI"
echo "Installing build SDK for Android API level $ANDROID_SDK_BUILD_API_LEVEL..."
sdkmanager "platforms;android-$ANDROID_SDK_BUILD_API_LEVEL"
echo y | sdkmanager "platforms;android-$ANDROID_SDK_BUILD_API_LEVEL"
echo "Installing target SDK for Android API level $ANDROID_SDK_TARGET_API_LEVEL..."
sdkmanager "platforms;android-$ANDROID_SDK_TARGET_API_LEVEL"
echo y | sdkmanager "platforms;android-$ANDROID_SDK_TARGET_API_LEVEL"
echo "Installing SDK build tools, revision $ANDROID_SDK_BUILD_TOOLS_REVISION..."
sdkmanager "build-tools;$ANDROID_SDK_BUILD_TOOLS_REVISION"
echo y | sdkmanager "build-tools;$ANDROID_SDK_BUILD_TOOLS_REVISION"
# These moved to "system-images;android-$ANDROID_SDK_BUILD_API_LEVEL;google_apis;x86" starting with API level 25, but there is no ARM version.
echo "Installing Google APIs $ANDROID_GOOGLE_API_LEVEL..."
sdkmanager "add-ons;addon-google_apis-google-$ANDROID_GOOGLE_API_LEVEL"
echo y | sdkmanager "add-ons;addon-google_apis-google-$ANDROID_GOOGLE_API_LEVEL"
echo "Installing Android Support Repository"
sdkmanager "extras;android;m2repository"
echo y | sdkmanager "extras;android;m2repository"
$CI && touch "$DEPS"
fi
}
@@ -17,7 +17,7 @@ echo "Compiling native code..."
./gradlew :ReactAndroid:packageReactNdkLibsForBuck
echo "Building JS bundle..."
node cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
node cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js --reactNativePath .
echo "Installing test app on the device..."
buck fetch ReactAndroid/src/androidTest/buck-runner:instrumentation-tests
+2 -16
View File
@@ -113,25 +113,11 @@ android {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86-64"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
@@ -141,7 +127,7 @@ android {
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86-64": 4]
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
Binary file not shown.
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" />
</manifest>
@@ -1,9 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.helloworld">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application
android:name=".MainApplication"
@@ -11,9 +9,7 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config"
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
<domain includeSubdomains="false">10.0.3.2</domain>
</domain-config>
</network-security-config>
+2 -2
View File
@@ -5,7 +5,7 @@ buildscript {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 27
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
@@ -13,7 +13,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:3.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
+8
View File
@@ -0,0 +1,8 @@
keystore(
name = "debug",
properties = "debug.keystore.properties",
store = "debug.keystore",
visibility = [
"PUBLIC",
],
)
@@ -0,0 +1,4 @@
key.store=debug.keystore
key.alias=androiddebugkey
key.store.password=android
key.alias.password=android
+899 -391
View File
File diff suppressed because it is too large Load Diff