Skip to content

Commit

Permalink
Merge branch 'master' into feature/x64_support
Browse files Browse the repository at this point in the history
  • Loading branch information
hramos authored Jun 15, 2018
2 parents fc3ea39 + 86d8c7a commit f5e579d
Show file tree
Hide file tree
Showing 47 changed files with 662 additions and 354 deletions.
3 changes: 2 additions & 1 deletion .buckconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

[android]
target = Google Inc.:Google APIs:23
target = android-26

[download]
max_number_of_retries = 3

[maven_repositories]
central = https://repo1.maven.org/maven2
google = https://maven.google.com

[alias]
rntester = //RNTester/android/app:app
31 changes: 20 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,12 @@ jobs:
- run: *run-android-unit-tests
- run: *run-android-instrumentation-tests

# Build Android RNTester
- run:
name: Build Android RNTester
command: |
./gradlew RNTester:android:app:assembleRelease
# Collect Results
- run: *collect-android-test-results
- store_test_results:
Expand Down Expand Up @@ -652,6 +658,20 @@ workflows:
requires:
- checkout_code

# Only runs on vX.X.X tags if all tests are green
- publish_npm_package:
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/
requires:
- test_javascript
- test_ios
- test_tvos
- test_end_to_end
- analyze

# Only runs on PRs
analyze:
jobs:
Expand All @@ -665,17 +685,6 @@ workflows:
requires:
- checkout_code

# Only runs on NN-stable branches
deploy:
jobs:
# If we are on a stable branch, wait for approval to deploy to npm
- approve_publish_npm_package:
filters: *filter-only-stable
type: approval

- publish_npm_package:
requires:
- approve_publish_npm_package

# These tests are flaky or are yet to be fixed. They are placed on their own
# workflow to avoid marking benign PRs as broken.
Expand Down
19 changes: 5 additions & 14 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,13 @@ about: Report a reproducible bug or regression in the core React Native library.
<!-- Requirements: please go through this checklist before opening a new issue -->
- [ ] Review the documentation: https://facebook.github.io/react-native
- [ ] Search for existing issues: https://github.com/facebook/react-native/issues
- [ ] Use the latest React Native version: https://github.com/facebook/react-native/releases
- [ ] Run `react-native info` in your terminal and paste its contents under "Environment"
- [ ] Let us know how to reproduce the issue. Include a code sample, share a project, or
share an app that reproduces the issue using https://snack.expo.io/
- [ ] Use the latest React Native release: https://github.com/facebook/react-native/releases

## Environment
<!-- Required. -->
Run `react-native info` in your terminal and paste its contents here.

## Description
<!-- Describe your issue in detail. -->
Describe your issue in detail. Include screenshots if needed. If this is a regression, let us know.

## Steps to Reproduce
<!-- Required. -->

## Expected Behavior
<!-- Write what you thought would happen. -->

## Actual Behavior
<!-- Write what happened. Include screenshots if needed. If this is a regression, let us know. -->
## Reproducible Demo
Let us know how to reproduce the issue. Include a code sample, share a project, or share an app that reproduces the issue using https://snack.expo.io/. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve
14 changes: 9 additions & 5 deletions .github/ISSUE_TEMPLATE/discussion.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
---
name: 🗣 Start a Discussion
about: Use https://discuss.reactjs.org/ to propose changes or discuss feature requests.
---

Please use https://discuss.reactjs.org/ to propose changes or discuss feature requests.

If you feel strongly about starting a discussion as a GitHub Issue instead of using the discussion forum, you may follow this template.

We kindly ask that issues of this type are kept to a minimum to ensure bug reports and regressions are given the priority they require.

guidelines: |
If you feel strongly about starting a discussion as a GitHub Issue instead of using the discussion forum, please follow this template.
We kindly ask that issues of this type are kept to a minimum to ensure bug reports and regressions are given the priority they require.
Maintainers may flag an issue for Stack Overflow or kindly ask you to move the discussion to https://discuss.reactjs.org at their own discretion.
Maintainers may flag an issue for Stack Overflow or kindly ask you to move the discussion to https://discuss.reactjs.org at their own discretion.

---

## For Discussion
# For Discussion

<!-- Describe your issue in detail. -->

4 changes: 2 additions & 2 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ export type KeyboardType =
| 'numeric'
| 'phone-pad'
| 'number-pad'
| 'decimal-pad'
// iOS-only
| 'ascii-capable'
| 'numbers-and-punctuation'
| 'url'
| 'name-phone-pad'
| 'decimal-pad'
| 'twitter'
| 'web-search'
// Android-only
Expand Down Expand Up @@ -388,6 +388,7 @@ const TextInput = createReactClass({
* - `default`
* - `numeric`
* - `number-pad`
* - `decimal-pad`
* - `email-address`
* - `phone-pad`
*
Expand All @@ -399,7 +400,6 @@ const TextInput = createReactClass({
* - `numbers-and-punctuation`
* - `url`
* - `name-phone-pad`
* - `decimal-pad`
* - `twitter`
* - `web-search`
*
Expand Down
19 changes: 9 additions & 10 deletions Libraries/Image/ImageSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@
'use strict';

// This is to sync with ImageSourcePropTypes.js.

type ImageURISource = $ReadOnly<{|
uri?: string,
bundle?: string,
method?: string,
headers?: Object,
body?: string,
cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached',
width?: number,
height?: number,
scale?: number,
uri?: ?string,
bundle?: ?string,
method?: ?string,
headers?: ?Object,
body?: ?string,
cache?: ?('default' | 'reload' | 'force-cache' | 'only-if-cached'),
width?: ?number,
height?: ?number,
scale?: ?number,
|}>;

export type ImageSource = ImageURISource | number | Array<ImageURISource>;
32 changes: 16 additions & 16 deletions Libraries/StyleSheet/StyleSheetTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,23 @@ export type ____ViewStyle_Internal = $ReadOnly<{|
borderRightColor?: ColorValue,
borderStartColor?: ColorValue,
borderTopColor?: ColorValue,
borderRadius?: number,
borderBottomEndRadius?: number,
borderBottomLeftRadius?: number,
borderBottomRightRadius?: number,
borderBottomStartRadius?: number,
borderTopEndRadius?: number,
borderTopLeftRadius?: number,
borderTopRightRadius?: number,
borderTopStartRadius?: number,
borderRadius?: number | AnimatedNode,
borderBottomEndRadius?: number | AnimatedNode,
borderBottomLeftRadius?: number | AnimatedNode,
borderBottomRightRadius?: number | AnimatedNode,
borderBottomStartRadius?: number | AnimatedNode,
borderTopEndRadius?: number | AnimatedNode,
borderTopLeftRadius?: number | AnimatedNode,
borderTopRightRadius?: number | AnimatedNode,
borderTopStartRadius?: number | AnimatedNode,
borderStyle?: 'solid' | 'dotted' | 'dashed',
borderWidth?: number,
borderBottomWidth?: number,
borderEndWidth?: number,
borderLeftWidth?: number,
borderRightWidth?: number,
borderStartWidth?: number,
borderTopWidth?: number,
borderWidth?: number | AnimatedNode,
borderBottomWidth?: number | AnimatedNode,
borderEndWidth?: number | AnimatedNode,
borderLeftWidth?: number | AnimatedNode,
borderRightWidth?: number | AnimatedNode,
borderStartWidth?: number | AnimatedNode,
borderTopWidth?: number | AnimatedNode,
opacity?: number | AnimatedNode,
elevation?: number,
|}>;
Expand Down
1 change: 1 addition & 0 deletions Libraries/Text/TextInput/RCTBaseTextInputView.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong, nullable) NSNumber *maxLength;
@property (nonatomic, copy) NSAttributedString *attributedText;
@property (nonatomic, copy) NSString *inputAccessoryViewID;
@property (nonatomic, assign) UIKeyboardType keyboardType;

@end

Expand Down
24 changes: 23 additions & 1 deletion Libraries/Text/TextInput/RCTBaseTextInputView.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,23 @@ - (void)setTextContentType:(NSString *)type
#endif
}

- (UIKeyboardType)keyboardType
{
return self.backedTextInputView.keyboardType;
}

- (void)setKeyboardType:(UIKeyboardType)keyboardType
{
UIView<RCTBackedTextInputViewProtocol> *textInputView = self.backedTextInputView;
if (textInputView.keyboardType != keyboardType) {
textInputView.keyboardType = keyboardType;
// Without the call to reloadInputViews, the keyboard will not change until the textview field (the first responder) loses and regains focus.
if (textInputView.isFirstResponder) {
[textInputView reloadInputViews];
}
}
}

#pragma mark - RCTBackedTextInputDelegate

- (BOOL)textInputShouldBeginEditing
Expand Down Expand Up @@ -289,7 +306,12 @@ - (BOOL)textInputShouldChangeTextInRange:(NSRange)range replacementText:(NSStrin

NSString *previousText = [_predictedText substringWithRange:range] ?: @"";

if (_predictedText) {
// After clearing the text by replacing it with an empty string, `_predictedText`
// still preserves the deleted text.
// As the first character in the TextInput always comes with the range value (0, 0),
// we should check the range value in order to avoid appending a character to the deleted string
// (which caused the issue #18374)
if (!NSEqualRanges(range, NSMakeRange(0, 0)) && _predictedText) {
_predictedText = [_predictedText stringByReplacingCharactersInRange:range withString:text];
} else {
_predictedText = text;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Text/TextInput/RCTBaseTextInputViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ @implementation RCTBaseTextInputViewManager
RCT_REMAP_VIEW_PROPERTY(editable, backedTextInputView.editable, BOOL)
RCT_REMAP_VIEW_PROPERTY(enablesReturnKeyAutomatically, backedTextInputView.enablesReturnKeyAutomatically, BOOL)
RCT_REMAP_VIEW_PROPERTY(keyboardAppearance, backedTextInputView.keyboardAppearance, UIKeyboardAppearance)
RCT_REMAP_VIEW_PROPERTY(keyboardType, backedTextInputView.keyboardType, UIKeyboardType)
RCT_REMAP_VIEW_PROPERTY(placeholder, backedTextInputView.placeholder, NSString)
RCT_REMAP_VIEW_PROPERTY(placeholderTextColor, backedTextInputView.placeholderColor, UIColor)
RCT_REMAP_VIEW_PROPERTY(returnKeyType, backedTextInputView.returnKeyType, UIReturnKeyType)
Expand All @@ -51,6 +50,7 @@ @implementation RCTBaseTextInputViewManager
RCT_REMAP_VIEW_PROPERTY(clearButtonMode, backedTextInputView.clearButtonMode, UITextFieldViewMode)
RCT_EXPORT_VIEW_PROPERTY(blurOnSubmit, BOOL)
RCT_EXPORT_VIEW_PROPERTY(clearTextOnFocus, BOOL)
RCT_EXPORT_VIEW_PROPERTY(keyboardType, UIKeyboardType)
RCT_EXPORT_VIEW_PROPERTY(maxLength, NSNumber)
RCT_EXPORT_VIEW_PROPERTY(selectTextOnFocus, BOOL)
RCT_EXPORT_VIEW_PROPERTY(selection, RCTTextSelection)
Expand Down
Loading

0 comments on commit f5e579d

Please sign in to comment.