Summary:
This will allow us to present a user with a different template depending on the type of help they need.
To do:
1. Update the bot so that it auto-closes any issue that contains text from `question.md` (i.e. tried to ask a question through GitHub).
2. In a separate PR: new template to handle feature requests (update the bot to allow these to remain open)
3. Allow multiple other types of issues, such as requesting a cherry pick, or reporting a regression vs. something that does not work as expected.
4. Link to Stack Overflow / Discuss directly if and when GitHub allows the 'Get Started' button to point to a URL.
Closes https://github.com/facebook/react-native/pull/19334
Differential Revision: D8051229
Pulled By: hramos
fbshipit-source-id: 9e8aea232688c53dcbb0c047e92799e68b8b7842
Summary:
Now ConcreteComponentDescriptor can infer `ComponentName` from `ShadowNodeT` automatically,
so in the most cases we even don't need to create a subclass of that.
Reviewed By: fkgozali
Differential Revision: D8016965
fbshipit-source-id: d910597093c9f4c9f32ca06cb3ef1b12538b9543
Summary: We don't use them at all; moreover they complicate adding/changing signatures of those methods (because arguments with defaults must be grouped at the end and some arguments cannot have defaults).
Reviewed By: fkgozali
Differential Revision: D7981456
fbshipit-source-id: d7dd098e83630d1ab3342d2ca52ade9c4e27b2c3
Summary: Note: not all scrollview props and features (especially event listeners and imperative calls) are supported yet.
Reviewed By: fkgozali
Differential Revision: D7961868
fbshipit-source-id: 5277674fe976e089fd963066f78e705ad846d78d
Summary:
All the props of a scrollview, and local data.
LocalData part is probably the most interesting: with it we precompute content size which we use inside native scrollview. Previously we rely on some assumptions like "ScrollView must have only one subview" instead, and that was not so efficient and straight-forward.
Reviewed By: fkgozali
Differential Revision: D7961869
fbshipit-source-id: fa070b8423a3e7739aeb62220e51213683e1a223
Summary:
This PR fixes a bug where in `RCTNetworking` not all tasks/handlers were not being cleared when invalidating the class.
I came across this issue when writing some unit tests for my native plugins, sometimes a test would finish running (and the bridge invalidated), and only afterwards a callback from RCTNetworking would come, resulting in this exception:
```
2018-05-07 15:23:34.264494-0700 Guardian[73794:10710945] *** Assertion failure in -[RCTEventEmitter sendEventWithName:body:](), /Users/.../app/node_modules/react-native/React/Modules/RCTEventEmitter.m:41
2018-05-07 15:23:34.276505-0700 Guardian[73794:10710945] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error when sending event: didCompleteNetworkResponse with body: (
2,
cancelled,
0
). Bridge is not set. This is probably because you've explicitly synthesized the bridge in RCTNetworking, even though it's inherited from RCTEventEmitter.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010d5b21e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010be6f031 objc_exception_throw + 48
2 CoreFoundation 0x000000010d5b7472 +[NSException raise:format:arguments:] + 98
3 Foundation 0x000000010b94864f -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 165
4 Guardian 0x0000000106ff5227 -[RCTEventEmitter sendEventWithName:body:] + 567
5 Guardian 0x0000000106e9ebab __76-[RCTNetworking sendRequest:responseType:incrementalUpdates:responseSender:]_block_invoke.423 + 1115
6 Guardian 0x0000000106e8f48c __50-[RCTNetworkTask URLRequest:didCompleteWithError:]_block_invoke + 92
7 Guardian 0x0000000106e8ded1 -[RCTNetworkTask dispatchCallback:] + 113
8 Guardian 0x0000000106e8f37a -[RCTNetworkTask URLRequest:didCompleteWithError:] + 410
9 Guardian 0x0000000106ea1aa3 -[RCTHTTPRequestHandler URLSession:task:didCompleteWithError:] + 403
10 CFNetwork 0x000000010cf3a437 __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.207 + 80
11 Foundation 0x000000010b885363 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
12 Foundation 0x000000010b8851ca -[NSBlockOperation main] + 68
13 Foundation 0x000000010b8836b2 -[__NSOperationInternal _start:] + 766
14 libdispatch.dylib 0x0000000112457779 _dispatch_client_callout + 8
15 libdispatch.dylib 0x000000011245c931 _dispatch_block_invoke_direct + 317
16 libdispatch.dylib 0x0000000112457779 _dispatch_client_callout + 8
17 libdispatch.dylib 0x000000011245c931 _dispatch_block_invoke_direct + 317
18 libdispatch.dylib 0x000000011245c7d4 dispatch_block_perform + 109
19 Foundation 0x000000010b87f75b __NSOQSchedule_f + 337
20 libdispatch.dylib 0x0000000112457779 _dispatch_client_callout + 8
21 libdispatch.dylib 0x000000011245f1b2 _dispatch_queue_serial_drain + 735
22 libdispatch.dylib 0x000000011245f9af _dispatch_queue_invoke + 321
23 libdispatch.dylib 0x0000000112461cf8 _dispatch_root_queue_drain + 473
24 libdispatch.dylib 0x0000000112461ac1 _dispatch_worker_thread3 + 119
25 libsystem_pthread.dylib 0x000000011297a169 _pthread_wqthread + 1387
26 libsystem_pthread.dylib 0x0000000112979be9 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
```
Bug can be reproduced by making a `XMLHttpRequest` (uses `RCTNetworking` internally) that takes a couple seconds to perform, and issuing a RCTBridge reload command in the meantime.
You can add the following code to the react-native template project,
```
componentDidMount() {
var oReq = new XMLHttpRequest();
oReq.addEventListener("load", () => console.log('Finished'));
oReq.open("GET", "https://www.dropbox.com/s/o01hz0chqvjafhv/file.bin?dl=1");
oReq.send();
console.log('Request is being performed...')
}
```
In my case I download a 1MB file.
Run the project and reload the a couple times. Bug is triggered.
[INTERNAL] [BUGFIX] [RCTNetworking] - Clear handlers and tasks on RCTNetworking invalidation
Closes https://github.com/facebook/react-native/pull/19169
Differential Revision: D8053070
Pulled By: hramos
fbshipit-source-id: d8af54fecd99173905363f962ffc638ef8b85082
Summary:
a275eac56e removed TextInput.State but we should keep it as it was a public-ish API and we don't have any migration plan off it. Also bring back `focusTextInput` and `blurTextInput` with a deprecation warning.
Tested TextInput.State is back
[GENERAL][ENHANCEMENT][TextInput] - Bring back TextInput.State, deprecate focusTextInput and blurTextInput
Closes https://github.com/facebook/react-native/pull/18936
Differential Revision: D8044439
Pulled By: hramos
fbshipit-source-id: fde145f04bb1d46ef58b5954cb7963adf495b21c
Summary:
add google maven repo required by appcompat-v7 26
CI will download appcompat-v7 version 26.0.2
[GENERAL][MINOR][Android] - add google maven repo required by appcompat-v7 26
Closes https://github.com/facebook/react-native/pull/19316
Differential Revision: D8039324
Pulled By: hramos
fbshipit-source-id: 3e9f4dd20560f4337e81967ee9b5c30ec61016de
Summary:
If `package.json` has changed, let's throw away the cache and let yarn install do its thing.
Circle CI.
[INTERNAL][MINOR][CircleCI] - Remove checksum fallbacks
Closes https://github.com/facebook/react-native/pull/19303
Differential Revision: D8029286
Pulled By: hramos
fbshipit-source-id: 528681e4da9f0215bf63f9f8b3920a95036badca
Summary:
A few fixes:
* missing include: folly/Optional.h
* switch folly::Optional's `has_value()` to `hasValue()` for now until folly is upgraded to newer version
* fix up import for RCTTextAttributes.h
* fix up includes for "conversions.h" to use namespaced includes
Reviewed By: mmmulani
Differential Revision: D8021149
fbshipit-source-id: d3955986d3ab6b1d9b61ac1e385767893ce57e5e
Summary:
Packages are now defined in `scripts/.tests.env`, so the checksum is updated accordingly.
We also throw away the cache if the checksum fails as not doing so may prevent us from picking up new packages due to the filesystem check in `scripts/android-setup.sh`#getAndroidPackages(), as the presence of the `installed-dependencies` file restored from cache will incorrectly flag all deps as being installed.
Closes https://github.com/facebook/react-native/pull/19298
Differential Revision: D8025918
Pulled By: hramos
fbshipit-source-id: 189492baac2fea39280884ea20e376a368e23c2e
Summary: We will need this for several components, first of all for ScrollView.
Reviewed By: fkgozali
Differential Revision: D7958246
fbshipit-source-id: 364b939abe8f0734376448149bbdc735abd00189
Summary: Trivial. We will need them soon at least for ScrollView.
Reviewed By: fkgozali
Differential Revision: D7958244
fbshipit-source-id: ce92c6e6181181ac17d817292af18ffa46a4d975
Summary: Apparently, `calculateMutationInstructions` must also produce mutation instructions for root node as well. To make it possible we have to change the signature of the function and weak some restrictions in TreeMutationInstruction.
Reviewed By: fkgozali
Differential Revision: D7958248
fbshipit-source-id: 4109a6bce3a77f7eb89157201fd0e80f98487dbd
Summary: Conceptually, it always must be node owner's responsibility, but for the root node, we have to make an exception because there is no another parent node and there is no another component which has access to YogaNode.
Reviewed By: fkgozali
Differential Revision: D7958251
fbshipit-source-id: 0bdaea87adbd323c758bc3c28f325be615aa90f3
Summary:
a3931e9531 bumped buildToolsVersions to 26.0.3, and `test_android` started failing because that particular build tools version was not getting installed in CircleCI.
Closes https://github.com/facebook/react-native/pull/19276
Differential Revision: D8020664
Pulled By: hramos
fbshipit-source-id: 561aa8186ed165b3652923a9bcaf56134acfd90b
Summary:
Update `scripts/run-android-emulator.sh` to use same settings as Circle CI when creating and launching an AVD. This helps provide a known good configuration, useful for running Android tests locally.
Run `scripts/run-android-emulator.sh` and confirm AVD is created && launched
Run `scripts/run-android-emulator.sh` again and see message about AVD already running
Run `test_android` on CI and observe AVD is launched.
Run `runXcodeTests.sh` and confirm unit tests run.
Run CI and confirm iOS unit tests run.
[GENERAL][MINOR][`scripts`] - Consolidate CI/local test scripts
Closes https://github.com/facebook/react-native/pull/19228
Differential Revision: D8019888
Pulled By: hramos
fbshipit-source-id: 28b12c2e781ee80bcc90c22e691a5acb16232369
Summary:
I propose halving the time required to flag and close an issue due to inactivity. The new time period would be 90 days (~3 months), at which point the bot will flag an issue as stale. This starts the second timer, where if the issue sees no further activity within 30 days, it will be closed by the bot.
_Extra: Do not automatically mark as stale issues labeled as regressions or "Help Wanted"_
Currently, an issue must see no activity for 180 days (~six months), at which point it is labeled stale. It will then take a further 60 days of inactivity before the issue is closed.
Take for example issue 9773. It was opened in September 2016, and closed for inactivity in November 2016. It was then resurrected February 2018. Three months later, no activity has occurred. This is, in my opinion, too lenient and the issue should be closed.
Last year, we reached a point where the repo has over 1,500 open issues. After finding some of these issues had no activity for over a year, I enabled a Stale bot on the repository which took care of closing any issue that saw no activity over a two week period. This helped us get to 200 open issues after some time.
After hearing feedback from the community that the bot was too aggressive on new issues, and considering that 200 open issues on such a broad project as React Native is not too high of a number, I dialed down the Stale bot so that it would take up to ~8 months to close a stale issue. In hindsight, I believe this was too big of an over-correction on my part. With open issues now topping 600, I think it's about time the Stale bot starts closing inactive issues again.
My view is that closing an issue does not indicate the issue is invalid. Closing an issue for inactivity is a sign that the issue is not problematic enough to inspire a member of the community to followup and/or propose a fix through a PR. Closing stale issues as soon as possible should help maintainers surface active issues with the greatest impact on users of the library.
None, configuration change.
[INTERNAL] [MINOR] [stale.yml] - Update Stale bot to halve stale closing times.
Closes https://github.com/facebook/react-native/pull/19253
Differential Revision: D8019532
Pulled By: hramos
fbshipit-source-id: 405b87ac3229c5ffb20a2ce2234cdcbec1f01c66
Summary:
fix issue https://github.com/facebook/react-native/issues/11701.
Pass current ci
<!--
Does this PR require a documentation change?
Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->
<!--
Required.
Help reviewers and the release process by writing your own release notes. See below for an example.
-->
[GENERAL] [BUGFIX] [JEST] - add missing jest mock in StatusBarManager
<!--
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [ {Component} ]
[ INTERNAL ] [ ENHANCEMENT ] [ {Filename} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/19017
Differential Revision: D8014888
Pulled By: hramos
fbshipit-source-id: 1be29f9643cf0faa53ad64f79e11d48b654a97b3
Summary:
Starting August 2018, Google Play will require targetSdkVersion 26 for new applications, and November 2018 for application updates.
This PR will use Android build tools 26.0.3 and compilerSdk 26, then support library version 26.0.2 to make targeting 26 easier in the future.
I think this PR will help to people compile and test their applications, thus make transition easier (smoother). Also we'll have opportunity and time to migrate code to target 26.
https://github.com/facebook/react-native/issues/18095
React Native on android must work as usual
Closes https://github.com/facebook/react-native/pull/19257
Differential Revision: D8010354
Pulled By: mdvacca
fbshipit-source-id: 63ba03585e918b38c2a2adb5d2f2e85d7ce46fae
Summary:
When `keyboardShouldPersistTaps` is `"never"` it would break when doing the following steps:
- Tap input 1, keyboard goes up
- Tap input 2, keyboard stays down (The bug I expected without the isTextInput check was that it would dismiss instead :o )
- Tap outside, keyboard stays down. It should dismiss here since it should never persist taps (unless tapping another input)
What seems to happen is that RN `currentlyFocusedTextInput` goes out of sync with the focused text input and is null even if there is still a text input focused. I haven't had time to investigate the cause of that (probably some race condition because of trying to focus and blur at the same time) but we should not try to dismiss the keyboard when tapping another TextInput in the first place.
I reproduced the bug mentioned by setting `keyboardShouldPersistTaps` to `"never"` in RNTesterPage.js and then using the steps described above. I made sure that the bug did not happen after this change.
[GENERAL][BUGFIX][ScrollResponder] - Fix keyboard handling with keyboardShouldPersistTaps: never
Closes https://github.com/facebook/react-native/pull/19255
Differential Revision: D8002818
Pulled By: mdvacca
fbshipit-source-id: 6ecb8d2c30eb9338529471a958b5dc04037c7ec6
Summary: Fix the typo in `RTLExample.js` that is now detected by Flow.
Reviewed By: TheSavior
Differential Revision: D7987526
fbshipit-source-id: d30f536b2f41e2127909675ea065a3355e5576ad
Summary:
Refactors `KeyboardAvoidingView` by using class syntax and fixing all Flow errors.
Note that there's still a bunch of sketchy stuff going on in this component with mutated instance variables (that are used in `render`!) and unsafe lifecycle methods. But at least now it's a little bit less painful on the eyes.
Reviewed By: TheSavior
Differential Revision: D7987443
fbshipit-source-id: f5c27a9dd383c430d9a5a9dc0b6e10e2c4fe8dd9
Summary:
Yoga represents concepts like `margin`, `padding` and `position` as `edges` (aka std::array<YGValue, YGEdgeCount>).
This diff improves conversion of this data structure to string (primarily for debugging purposes).
Reviewed By: fkgozali
Differential Revision: D7958241
fbshipit-source-id: 6931c7b5d2395c28821c8daef62f609b13f112c6
Summary: Oh, my! No more `#define`s related to props conversions and debug-printing.
Reviewed By: fkgozali
Differential Revision: D7958250
fbshipit-source-id: 86950070c55f134aa3a575b9fd68fc90d865cf44
Summary:
Same as previous one.
Adopting template-generated `convertRawProp` and `debugStringConvertibleItem` functions in `core` module.
Note, to do so we have to change signatures of some conversions functions to make them more overloading-friendly.
Reviewed By: fkgozali
Differential Revision: D7958243
fbshipit-source-id: 500ee420d9aa562ee3c5810ef625e06541eda8fb
Summary:
Same as previous one.
Adopting template-generated `convertRawProp` and `debugStringConvertibleItem` functions in `view` module.
Note, to do so we have to change signatures of some conversions functions to make them more overloading-friendly.
Reviewed By: fkgozali
Differential Revision: D7958242
fbshipit-source-id: 10199d1fbb43329de93604aa383c884f5cc64dc5
Summary:
Same as previous one.
Adopting template-generated `convertRawProp` and `debugStringConvertibleItem` functions in `graphics` module.
Note, to do so we have to change signatures of some conversions functions to make them more overloading-friendly.
Reviewed By: fkgozali
Differential Revision: D7958252
fbshipit-source-id: 0f33a2e6aad60befacee31486acdb9b6114d3e07
Summary:
Adopting template-generated `convertRawProp` and `debugStringConvertibleItem` functions in `attributedstring` module.
Note, to do so we have to change signatures of some conversions functions to make them more overloading-friendly.
Reviewed By: fkgozali
Differential Revision: D7958245
fbshipit-source-id: 275a58bd3955a6ceb4881bffff86bf1d4501b3d2
Summary:
We have to have automatic treatment for `optional` types. So, if we can process type `T` we can also automatically process `optional<T>.`
Support for optional allows us to not introduce new types (with embedded special "undefined" value) or pollute existing pure types (with special "undefined" value). (A lot of examples of those types can be found in AttributedString module.)
Reviewed By: fkgozali
Differential Revision: D7958249
fbshipit-source-id: 21af526a17dd0329e1262020cab8ecb902316654
Summary:
This diff opens a diffstack where we migrate the generation of all prop conversions (convertRawProp) and pretty-printing (debugStringConvertibleItem) functions to C++ templates (instead of using `#define`s).
So, this diff implements base versions of those functions as templated functions.
For now we still need #define-based version, but eventually, we will get rid of it.
Reviewed By: fkgozali
Differential Revision: D7958247
fbshipit-source-id: 24346297c1bd17e8054758f0eb84698eebfa21e2
Summary: This is continue of the work started in D7797561.
Reviewed By: fkgozali
Differential Revision: D7901244
fbshipit-source-id: 2f7a5cd9fa8c0079787e26e19c7c6c4255e54b42
Summary:
This a natiral continue of previous/ongoing work towards modernizing props pipeline.
Less defines, less code, more obvious code.
Reviewed By: fkgozali
Differential Revision: D7901246
fbshipit-source-id: 3387b6d13e21e6ec48a38c9e3708762dfe536105
Summary:
This diff contains several tight to each other changes (which can/should not be split into several diffs):
* The props parsing/conversion process was de-virtualized: we don't use virtual `apply` method to parse props anymore. Instead, we use old-fashioned constructors.
* All fields of Props classes which represent props values were marked as `const` which make impossible to modify them after the objects were created (even if we have non-const value-of/pointer-to the whole Props object). Those fields are also `public` now.
* All custom handwritten getters were removed (because we don't need them anymore).
So, now we don't need all those custom getters which makes code much more compact, performant and codegen-friendly.
Reviewed By: fkgozali
Differential Revision: D7901245
fbshipit-source-id: 9f4b1fd2da64bf963b63215ed3bd74b9d3c58dd5