Summary: This diff removes the `convertNewToOld` config method, which was only used by the unit tests (since there's no need to convert a new config object into an old one). As part of this, the config tests have been tweaked and simplified a bit, while keeping similar assertions and adding some more checks.
Reviewed By: mjesun
Differential Revision: D10015079
fbshipit-source-id: ba4fbd09cd4f97168bc1a2dbcec2699a00243637
Summary:
Don't ask.
Really, all those descriptions from official docs like below are useless:
* `__bridge_transfer` Moves a Core Foundation pointer to Objective-C with transfer of the ownership to ARC.
* `__bridge` Transfers a pointer between Objective-C and Core Foundation with no transfer of ownership
All that is totally confusing and useless. At the end of the day, we only have to think about which additional `CFRetain` and `CFRelease` ARC will add or will not add for our pointers.
So, following official docs recommendation, we would like to add `__bridge_transfer` because of course, we do want to ARC managing the variable after we introduced it to ARC here. But we also want to have shared ownership of this. That's the key. If we use `__bridge_transfer` ARC will assume that this variable already retained once (because it exists) and will call CFRelease at the end of the scope. Right before that when we pass this variable down to call stack ARC will retain and then manage the variable according to the rest of the code. But still, from this point, we will have zero-balanced reference counter; the owning by `shared_ptr` bump is already compensated with `CFRelease` at the end of the scope. As soon as the rest of the code release the object, it will be incorrectly deallocated.
So, instead of using `__bridge_transfer` we have to use `__bridge`. That will indicate that *in this block* ARC does not manage the reference counter of the variable (which is kinda true because having `shared_ptr` inside the block already retains that) and will not add `CFRelease` at the end of the block.
Reviewed By: mdvacca
Differential Revision: D10054241
fbshipit-source-id: 6e82c5270fe5d53f1ed68e167b94f70dc4367a9f
Summary:
Fixes#18223
This is a fairly simple solution to what seems to be a recurring issue where certain requests that result in an empty body where JSON is expected throw an error rather than being handled gracefully. Client side error handling is not being hit as this is being thrown at a lower level.
Make a http request that results in an empty blob: ""
[INTERNAL] [BUGFIX] [XMLHttpRequest.js] - Line 262
Pull Request resolved: https://github.com/facebook/react-native/pull/19567
Differential Revision: D8314416
Pulled By: hramos
fbshipit-source-id: a17c49f3620f0abbb936f3a1c2b01aa1b64820fd
Summary: Apparently, after updating CALayer props we have to request redrowing on top of it manually.
Reviewed By: mdvacca
Differential Revision: D10053340
fbshipit-source-id: f87311399bab809c9e13a3076f526bbe3f7f3fb4
Summary: We have to uninstall UIManager synchronously to avoid a race condition when JS is capable to call already deallocated UIManager.
Reviewed By: mdvacca
Differential Revision: D10033406
fbshipit-source-id: 194d1ae2dd5ab09b036b1c165de289ada8e66014
Summary:
Instead of wrapping all public methods into The controller you requested could not be found. blocks/mutexes, RCTSurfacePresenter utilizes a different thread-safety pattern where all instance variable are granularly thread-safe.
The names of all internal methods were prefixed by '_'.
Reviewed By: mdvacca
Differential Revision: D10033407
fbshipit-source-id: 97fd2879c879dd9ef8d9ece24e25af00f749a871
Summary:
There is no need to make JS calls to start or stop React Native apps; Scheduler does it automatically. Yay!
With this change (because we have to change Scheduler API) we are starting slow process migrating away from using term `reactRootTag` when we refer to running a ReactNative app (aka Surface). We will use `surfaceId` instead. We plan to slowly and gracefully retire `reactTag` term entity replacing it with several appropriate entities specific for particular usage, e.g. `viewId` (some id which makes sense for mounting), `surfaceId`, `nodeId` (unique id representing nodes which were cloned from the original one), or `eventTarget`.
Reviewed By: mdvacca
Differential Revision: D9999336
fbshipit-source-id: bbc7303c195b070b8c235c9ca35546d1dc693e98
Summary: This is the last step before making JSIUIManagerInstaller a direct dependency of UIManager (and making UIManager installation process completely seamless/platform-agnostic).
Reviewed By: mdvacca
Differential Revision: D9995781
fbshipit-source-id: 6f8c7177495b01ebaac1dbe330f49dce2e2a552c
Summary:
EventBeatBasedExecutor is an executor derived from EventBeat and using EventBeat to ensure proper threading.
Why do we need yet another executor? Because otherwise, we have to make it platform specific-dependency that each platform-specific implementation has to implement and provide. We already have all that we need in already provided EventBeat, so we can just convert that into simple executor in a platform-agnostic way.
Reviewed By: mdvacca
Differential Revision: D9995783
fbshipit-source-id: f8aa72a9744e50ebecbea9ad0e2546f41f5358f2
Summary: Besides that it's more simple and straight-forward now, we need that to always instantiate Scheduler with a context full of fresh valid objects derived from the new instance of the bridge.
Reviewed By: mdvacca
Differential Revision: D9995780
fbshipit-source-id: 534a314152d93562b08dd7857962f174b0d06886
Summary:
The original design of RCTSurface implied that the Surface starts on initialization and stops on deallocation. Recently I realized that this not sufficient API in some cases when the application uses ARC with autorelease pools (that can postpone object deallocations, which is highly undesirable).
And that's simply handy to have those methods sometimes.
Reviewed By: mdvacca
Differential Revision: D9982356
fbshipit-source-id: baa3bd24804d3708606ebd00b8795f2d5c9d4de9
Summary: We call this method in a constructor before the actual object is beeing constructed, so it's incorrect; it should be class method.
Reviewed By: mdvacca
Differential Revision: D9931315
fbshipit-source-id: 304ba8e2354f3f408cfa2bf1729266525a08f951
Summary: All integration with Bridge was removed from RCTFabricSurface, now it's Surface's responsibility to start and stop JS app and register the ShadowTree in the Scheduler.
Reviewed By: mdvacca
Differential Revision: D9931317
fbshipit-source-id: 55a682f0afb1c542a904e1a8570029e4690967cc
Summary: UIManager now can install and uninstall itself calling a functions that are provided as constructor arguments.
Reviewed By: mdvacca
Differential Revision: D9931329
fbshipit-source-id: b8d2d9925b0e2db0fed44bdf2e185d198fabd5ee
Summary: Now we have a way to enumerate surfaces stored in RCTSurfaceRegistry.
Reviewed By: mdvacca
Differential Revision: D9931316
fbshipit-source-id: 6b886c4b52cebddf15fef0239190fb2730d682cc
Summary:
Follow up to 8932a9caa8
Babel helpers and regenerator runtime will be imported automatically from `babel/runtime`. We still need to add the global regeneratorRuntime for jest tests since we disable babel-runtime currently.
Pull Request resolved: https://github.com/facebook/react-native/pull/21283
Reviewed By: mjesun
Differential Revision: D10010963
Pulled By: rafeca
fbshipit-source-id: da5e23dd901f8f8940d46816b4fc9290d0e28c76
Summary:
This also fixes an issue with tagged commit Circle CI jobs, and avoids running the `publish_npm_package` on every commit. The new config ignores commits on *all branches*, but should still catch git tags.
Pull Request resolved: https://github.com/facebook/react-native/pull/21324
Differential Revision: D10041629
Pulled By: hramos
fbshipit-source-id: 9b3295b5fcd614c67a8838ffd49c6a5d6ae7fd86
Summary:
This PR is the result of running `yarn prettify` on the codebase - which caught a few files that were not prettified. This will make instructing people to run prettify a bit less complicated, since unrelated files will not show up in diffs.
Pull Request resolved: https://github.com/facebook/react-native/pull/21327
Differential Revision: D10046057
Pulled By: TheSavior
fbshipit-source-id: 2c771a3c758c72816c707e32ee2f4587e466f277
Summary:
Changes all possible native JNI methods to critical methods.
For now, this only changes Android up and including v7. In order to be prepared for the `CriticalNative` annotation in Android v8, the following restrictions apply:
- Qualifying methods must be static (this is also enforced for Dalvik / Android v4)
- Method implementations can only consume primitive JNI types (`boolean`, jchar`, etc.)
Reviewed By: priteshrnandgaonkar
Differential Revision: D9943868
fbshipit-source-id: 728817eb37822b717fd3daf94cd9f02b42c17db6
Summary:
Moves binding of native methods into a separate native method that can be parameterized.
This will be used to experiment with JNI-related technology.
Reviewed By: priteshrnandgaonkar
Differential Revision: D9943870
fbshipit-source-id: 661f15537d5bbf7a3eef7717e3d99fed2de23904
Summary:
Support for `overflow: visible` was recently added to Android ScrollView.
However, it didn't account for `overflow: scroll` and changed the behavior, causing content to render
when before it would be clipped.
Reviewed By: achen1
Differential Revision: D10036807
fbshipit-source-id: e44a79b18eecbc7d64621f7cf5d800a00a121b13
Summary: There hasn't been any reports of overflow issues since the last issue was fixed in v183 (July 30th). Let's remove this flag
Reviewed By: yungsters
Differential Revision: D10020006
fbshipit-source-id: 593c7d2c2bef5f0bd60d5de1941cd58f7fd6ccc7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/21306
This diff moves fabric dependencies out of OSS instrumentation tests (js/react-native-github/ReactAndroid/src/androidTest/java/com/facebook/react/testing/BUCK), this will un-break build of OSS project in CI.
Reviewed By: rsnara
Differential Revision: D10020517
fbshipit-source-id: e2cf23afeeecf4cfb41345742f59c16af6b108d0
Summary:
Exporting ImageURISource because we needed to use it in a custom Image component. This should be a case for other people too since handling of `number` ImageSources and `ImageURISource` ImageSources are way different.
Release Notes:
--------------
[GENERAL] [ENHANCEMENT] [Image] - Export "ImageURISource" Flow type
Pull Request resolved: https://github.com/facebook/react-native/pull/21305
Differential Revision: D10024160
Pulled By: rsnara
fbshipit-source-id: f074148345285217014b6ba6735cfdf3508563b5
Summary:
This PR converts the Prop Types in `Modal` to Flow Types, and fills out the callback types a bit more.
Context Types are left in for now.
Pull Request resolved: https://github.com/facebook/react-native/pull/21279
Reviewed By: yungsters
Differential Revision: D10006795
Pulled By: TheSavior
fbshipit-source-id: ac885f2e5f068b0991009a9b1cbb3886e34941af
Summary:
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
_Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!_
Pull Request resolved: https://github.com/facebook/react-native/pull/21296
Differential Revision: D10016120
Pulled By: hramos
fbshipit-source-id: 45c92241c5e09f8a8ba1c9cfff4c24f291845117
Summary: As it mentioned in the comment, we have to commit an empty tree as part of cleaning up Surface.
Reviewed By: mdvacca
Differential Revision: D9931320
fbshipit-source-id: 04e780bafdb917adeb89f2edef2dc0348b2a4d4a
Summary:
Several reasons:
* We are fulfilling a promise that RCTScheduler is just a very thin interop proxy between C++ and Objective-C;
* We have to pass all parameters down to Scheduler anyway, so instead of creating all of them separately and then passing one-by-one, we consolidate them into Context created where we have all those values.
In the future, we probably will move it to some dedicated place.
Reviewed By: mdvacca
Differential Revision: D9884892
fbshipit-source-id: f1d5744e4044bc4bdfe53ec9a97ee61dcf0c60c2
Summary: Just a small diff to remove some unused parameters in some methods of the ReactInstnaceManager class
Reviewed By: achen1
Differential Revision: D10011168
fbshipit-source-id: 2247ecd01bfc63c27837c6abad4bff1b4e590ac0
Summary:
The snapToOffsets changes improved the flinging algorithm for snapToInterval/snapToOffsets but actually broke it for pagingEnabled because it's meant to only scroll one page at a time.
First, I just brough back the old algorithm, but noticed that it has a bunch of issues (e.g. #20155). So, I tried to improve the algorithm to make sure it uses the proper target offset prediction using the same physics model that Android uses for it's normal scrolling but still be limited to one page scrolls.
This resolves#21116.
Reviewed By: shergin
Differential Revision: D9945017
fbshipit-source-id: be7d4dfd1140f4c4d32bad93a03812dc80286069
Summary:
Since the options that are passed to the `babelTransformer` are not exactly the same ones as the `transformer` receives, we need to have a specific object for them.
This allows us to make the transformer options object strict (since unfortunately the `babeltransformer` options object comes from many places and needs a bit of work to be able to be strict...
Reviewed By: mjesun
Differential Revision: D9309173
fbshipit-source-id: 0a92381968f17e5eb6c4740c1ca89580fa7ee4d3
Summary:
Up until now, transformers in Metro received the absolute path of a file, the relative path of a file and the projectRoot.
This diff gets rid of the absolute path sent to the worker, since by having the projectRoot and the relative path, the absolute path can be easily calculated.
This has been done to avoid having absolute paths as transform options, since we need to have custom logic to filter them out from the cache key generation, which is dangerous.
Reviewed By: mjesun
Differential Revision: D9195147
fbshipit-source-id: e95c5c29272eec7f1a48af7cede4c6d6b4a8ffb7
Summary:
ScrollView always clipping children on Android even when `overflow: visible` was specified.
This change just omits the clipping during draw if `overflow: visible` is passed in.
The default is not changed (from hidden to visible) in case there is a performance impact.
Android now matches iOS in behavior. This helps with issue #21116 and resolves#14416.
Reviewed By: shergin
Differential Revision: D9952096
fbshipit-source-id: 367afe33ee7ff0fdc5aa1074d239883aa289888a
Summary:
@public
Otherwise tests using `path` but not `fs` have an empty mock, as it happens on https://github.com/facebook/metro/issues/235#issuecomment-423722747
Reviewed By: mjesun
Differential Revision: D10008513
fbshipit-source-id: 673e2ca79c8105a68818985dc08fe7ccd5d13881
Summary:
<!--
Required: Write your motivation here.
If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->
Fixes inconsistency in custom font rendering in android. See explanation below.
<!--
Required: Write your test plan here. If you changed any code, please provide us with
clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->
I tested the following on my physical device (Sony Z5C) and on Android emulator on Mac.
The test app contains various fonts in the AvenirNext family, which are added to the app as `.ttf` format.
Note that the character "thickness" is inconsistent. Some characters looks thicker than other. See the screenshots below as an example:
- Looks thicker: right half of the `g` and `&` as in "Region & Language" (list-view screen)
- Looks thicker: `w` as in `Change Password` (list-view screen)
- Looks vertically compressed: `a` and `e` as in "Message" in the bottom bar (list-view screen)
- Looks thicker: `A`, `N`, `V`, `v` (paragraph screen)
- Looks thinner: `i` (paragraph screen), it leaves extra space on its right hand side
![screenshot_20180427-151129](https://user-images.githubusercontent.com/1103788/39350754-ae9fafe2-4a31-11e8-8835-97280783bb95.png)
![screenshot_20180427-151419](https://user-images.githubusercontent.com/1103788/39350755-aecc9bba-4a31-11e8-8128-2d230f003dfa.png)
Every characters has consistent "weight" and looks nice:
![screenshot_20180427-150835](https://user-images.githubusercontent.com/1103788/39350753-ae698728-4a31-11e8-8a55-4e161c559b95.png)
![screenshot_20180427-151639](https://user-images.githubusercontent.com/1103788/39350756-aef95d44-4a31-11e8-820b-1a7dee77fabe.png)
<!--
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.
-->
None
<!--
Required.
Help reviewers and the release process by writing your own release notes. See below for an example.
-->
[ANDROID] [ENHANCEMENT] [CustomStyleSpan] - Enable subpixel text rendering
<!--
**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
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/19043
Differential Revision: D10008155
Pulled By: hramos
fbshipit-source-id: 7fe9bb0f9be80380947ff80eac522e3cfd6b22cf
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->
Fixes#20924
DPad arrow events were missing from `KEY_EVENTS_ACTIONS` which meant that they were not broadcasted by `TVEventHandler`.
Pull Request resolved: https://github.com/facebook/react-native/pull/21143
Differential Revision: D10007851
Pulled By: mdvacca
fbshipit-source-id: 9a03cad249a4a1917975d1de10b6112e69d32a72