Summary: Re-enables the disabled codegens on android by renaming the test fixtures to something shorter
Reviewed By: TheSavior
Differential Revision: D14258414
fbshipit-source-id: 912c12df039930ec492b5bafc69bc298f913bdcc
Summary: It was weird that the default values for enums did not match the casing for the enum options
Reviewed By: TheSavior
Differential Revision: D14258101
fbshipit-source-id: f601e50390a6c67f20e7a18aa94b377597a831cc
Summary:
We are now generating the native cpp files for ActivityIndicatorView via Buck.
Deleting the hand written files and switching over.
Reviewed By: TheSavior
Differential Revision: D14247446
fbshipit-source-id: 63a6df3254e4184de6c8abb9ea2c89654ad54398
Summary:
This diff updates the flow types for the ActivityIndicator size prop.
The android component [here](diffusion/FBS/browse/master/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.java$31-30) does not use a size prop
The iOS component [here](diffusion/FBS/browse/master/xplat/js/react-native-github/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm;e82762cefe5cddad4a7e8144c42c76eb4d907e56$14-15,23) uses the size prop, but only for small/large, not for the number type
Reviewed By: TheSavior
Differential Revision: D14247432
fbshipit-source-id: 43b74574548eaf97f96d68c18ed627465fd5e133
Summary:
@public
Allows to limit the number of measure cache entries used. This is purely for experimentation.
The measure cache uses about half of every `YGNode`. Reducing its size would allow us to reduce resident memory used by Yoga.
Reviewed By: SidharthGuglani
Differential Revision: D14279027
fbshipit-source-id: e0d22138230bee7fb129c193eb6e4085de02a36e
Summary:
Props now have a special value that represents generation number of `Props` object, which
increases when the object was constructed with some source `Props` object.
Reviewed By: mdvacca
Differential Revision: D14293939
fbshipit-source-id: 4782bf33ccf37623d4079c09cc4d0268bb6c2690
Summary:
[General][Fixed] Fixed Flow typing of onError prop on Image component to include `error` field
reason: tried grabbing the error off nativeEvent in D14285176 but flow complained. Docs say it should be there & when actually running the code, it does exist, so I //think// this is ok?
Reviewed By: TheSavior
Differential Revision: D14285688
fbshipit-source-id: 19deb35ba8ab419de209a8deaf12df0b395e5b82
Summary: TurboModule needs sync calls from JS to native, and that's not supported with the current Chrome debugger. Until we have proper solution, disable it to avoid confusion.
Reviewed By: PeteTheHeat
Differential Revision: D14286383
fbshipit-source-id: e93903bf8fdfc714960d0d58e3f3eb0442c811bd
Summary:
When TurboModules are created, we need to broadcast this event using `NSNotificationCenter`. This is important because a number of TurboModules/ObjC classes listen to this notification and perform side effects.
I found these using https://fburl.com/codesearch/j0a9p3dr.
- FBReactKitServerSnapshotTests: After the RCTExceptionsManager is initialized, it assigns itself as the delegate to the RCTExceptionsManager instance.
- FBProfilePictureUploadFlowController: After FBProfileFrameNativeModule is initialized, it calls `[module setFlowController: self]`
- RCTFBSession: After every NativeModule is initialized, if that NativeModule conforms to the RCTFBSessionModule protocol, assign the session to it.
- TwilightLocalMedia: Hack to figure out when the bridge is initialized.
- FBMarketplaceMenuItemHandler: After FBMarketplaceNativeModule is initialized, attach a data source obtained from the session to the module. Then, attach module to data source.
- RCTModuleInitTests: Set local state based on if certain modules are initialized (https://fburl.com/e34kezb5).
- IGReactModule: When the RCTImageLoader is initialized, set it's image cache to `[IGReactImageCache new]`.
- RCTIGUserSession: Like RCTFBSession
- FBReactModuleTracker: This keeps a list of all dispatched notifications (for some reason).
- RCTModuleInitNotificationRaceTests: Sets self.didDetectViewManagerInit to true if RCTTestViewManager is initialized.
Reviewed By: fkgozali
Differential Revision: D14281557
fbshipit-source-id: 9fcf1bb5f5650fcc3a3e50c6d93405b0b618e271
Summary: [IOS] [FIXED] - This may cause weird race condition if JSI is accessed via multiple threads within the same method invocation. Since only the objc class methods need to be executed on the right queue, we can keep the conversion to jsi::Value in the originating JS thread.
Reviewed By: RSNara
Differential Revision: D14277167
fbshipit-source-id: c506aebb71e190e2afcbf19dce05088ce2b97833
Summary: `YGConfigContext` was using `global_ref` instances for the config, leading to the config object never being freed. Since we no longer need it after getting rid of cloning, we can make the context a pointer to a `global_ref` to the logger.
Reviewed By: SidharthGuglani
Differential Revision: D14258571
fbshipit-source-id: cce632499839a680eef00a3854f61ab74ae2a87a
Summary:
@public
Having assignment operators for `YGNode` means that existing children on the node assigned to would have to be handled somehow.
Deallocating might be incorrect. Ignoring might leak.
Here, we `delete` copy assignment, and make move assignment private (it is used in `YGNode::reset()`).
Copy and move constructors *can* be implemented. The move constructor has to take ownership of the children, while the copy constructor leaves ownership untouched. Since children are copied lazily during layout, this does not expose true value semantics. We should consider removing the copy constructor, too.
Reviewed By: SidharthGuglani
Differential Revision: D14241663
fbshipit-source-id: 39ffdb07f1028bfcf2710c0674a06cdebf3bd650
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
Summary:
Basing on discussion from this issue - https://github.com/react-native-community/discussions-and-proposals/issues/65 we moved ESLint/Prettier config to its own package inside packages directory.
At this moment we had to left all `eslint` dependencies in root `package.json` since `eslint-config-react-native` is not published yet.
[General] [Changed] - Move eslint/prettier config to packages/eslint-config-react-native
Pull Request resolved: https://github.com/facebook/react-native/pull/23688
Differential Revision: D14277068
Pulled By: cpojer
fbshipit-source-id: ef2d0b33210418318cc8324f15fedd84df0ef64d
Summary:
We use indent width with 2 spaces, but `RCTImageLoader` use 4 spaces, it's hard to code, code one line, adjust indent, or change Xcode's preference temporary. So let's prettier it.
[iOS] [Fixed] - Prettier Image loader code
Pull Request resolved: https://github.com/facebook/react-native/pull/23701
Differential Revision: D14278082
Pulled By: cpojer
fbshipit-source-id: 6e7db50741b0981f45622c19981cb5fd9bbc0a97
Summary:
The reason I change GIF image url is `tumblr` blocked in some countries, like China , Kazakhstan, Pakistan, Indonesia. (PS. I can only confirm China blocked it 😂 ), so can we change this to local image?
[iOS] [Fixed] - Make RNTester GIF example locate local file system image
Pull Request resolved: https://github.com/facebook/react-native/pull/23689
Differential Revision: D14275149
Pulled By: cpojer
fbshipit-source-id: c4141cdda40792e5d8bfa805ccc74279e2eef55a
Summary: Flesh out how surface will be used with a flag in ReactRootView
Reviewed By: mdvacca
Differential Revision: D14112897
fbshipit-source-id: adf6078048dbf83452d3523f0530a4d6dca7b3e8
Summary:
We set flags to true when setting margin, padding, border, position individually
Doing the same for batching API
Reviewed By: davidaurelio
Differential Revision: D14207550
fbshipit-source-id: ddfdcd5056bea0dd76bd6762f47e90370e26c9e1
Summary:
Added a new API `YGNodeSetLayoutStyleInputs` to pass layout style inputs from java to native code.
All the style inputs are passed in a float array in [key1, key2, value2, key3, value3a, value3b .....] format over JNI layer.
There are three types of style inputs
- do not need any value to be passed along with them like WidthAuto, HeightAuto
- need one value to be passed like Width, Height
- need two values to be passed like Margin, Padding (edge value and actual margin, padding value)
Reviewed By: davidaurelio
Differential Revision: D14166948
fbshipit-source-id: 4bea64d6a429959c3962c87e337914dcd99199fd
Summary:
We have now create a yoga node context which consists of weak reference to java yoga node object and flag which tells us whether margin, padding , border are set or not.
This flag was initially in java layer and we have moved this to native layer as it will help us with enabling the bacthing API for setting style inputs.
Reviewed By: davidaurelio
Differential Revision: D14243378
fbshipit-source-id: fed935ef18c1abf2b07e5d69d9ca79ced51699f2
Summary: We are now not setting flags when we set style inputs margin, padding, border and position on yoga node.
Reviewed By: davidaurelio
Differential Revision: D14224000
fbshipit-source-id: deef4c1ab1a60fbc4909183bc2aa59fa23939d43
Summary:
`Platform.isTesting` returns false when running SSTs. This diff changes that to true.
See https://our.intern.facebook.com/intern/qa/9690/how-to-detect-when-running-as-sst for inspiration.
I fixed this for iOS in D13981728.
Reviewed By: cpojer
Differential Revision: D14244606
fbshipit-source-id: ed95b772cc4206cf7c835aed7415aa5fc5fbdf7d
Summary:
@public
Previously open-sourced as `react-native-symbolicate`, this package is more closely coupled with Metro and should therefore be part of the latter.
Reviewed By: cpojer
Differential Revision: D14208031
fbshipit-source-id: 8bae2100149142394e12d499dc4b8a256f07647e
Summary: This new version uses paths relative to the `rootDir` option to compute cache keys, so it is compatible with remote caching.
Reviewed By: rickhanlonii
Differential Revision: D14241858
fbshipit-source-id: fbf244bbf389bf873fb8a42f35c9b023fb06182f
Summary:
@public
Moving logic from free C functions to the C++ layer.
This will allow us to get rid of the dangerous copy / move assignment operators of `YGNode`.
Reviewed By: SidharthGuglani
Differential Revision: D14241564
fbshipit-source-id: aae9f2a7ffd23bb839f1747e4a0694578bae86ae
Summary: Add assorted missing includes in `xplat` that would be exposed by future changes.
Reviewed By: ispeters, nlutsenko
Differential Revision: D14213660
fbshipit-source-id: 329f133784015fe20ee99feaec8ef05e117fe3a6
Summary:
This is a back-out of D14214844, we noticed that this regressed TTI for Marketplace You screen running in Fabric
Original commit changeset: b81005f2bf49
Reviewed By: JoshuaGross
Differential Revision: D14247897
fbshipit-source-id: de0cea92b437b2fbcd075f0d6a0066156800e3f0
Summary:
We have the wrong calculation of placeholder size currently, leads `contentSize` or some things inaccuracy.
[iOS] [Fixed] - Fixed wrong placeholder size calculation in multiline text input mode
Pull Request resolved: https://github.com/facebook/react-native/pull/23682
Differential Revision: D14255932
Pulled By: cpojer
fbshipit-source-id: a1f40e90fc2c848579694965da8316fae9e5c4c5
Summary:
Currently, we pick the max size of text view's contentSize and placeholder's size, actually, if placeholder is be hidden, we should only return text view's contentSize.
[iOS] [Fixed] - Fixed wrong contentSize calculation when placeholder is hidden in multiline text input
Pull Request resolved: https://github.com/facebook/react-native/pull/23683
Differential Revision: D14255915
Pulled By: cpojer
fbshipit-source-id: 198faa7e1c5657371eb920973345194aedf72e41
Summary:
If you try linking to a system URL scheme that isn't http or https such a tel, the linking promise will be rejected. I'm fixing this by relying on the output of `BOOL canOpen = [RCTSharedApplication() canOpenURL:URL];` to resolve the promise, but still falling back on the better error message if the given URL cannot be opened.
Changelog:
[iOS][fixed] - Allow linking to system URL schemes other than http or https
Reviewed By: cpojer
Differential Revision: D14250507
fbshipit-source-id: d74b2bd615eb6e320a39a956424e0ee34d476dab
Summary:
This is an effort to clean up the root of the repository. Everything related to Docker is being moved to the `.circleci` directory, as these images are used as part of the Circle CI 2.0 tests on Android.
[GENERAL] [Changed] - Moved Dockerfiles into .circleci directory
Pull Request resolved: https://github.com/facebook/react-native/pull/23677
Differential Revision: D14253735
Pulled By: cpojer
fbshipit-source-id: 4d482d531a71b8259b09c001b310d82ce5349b87
Summary:
Trivial PR. Cleaning up the CODEOWNERS file a bit.
[GENERAL] [Changed] - Clean up and annotate CODEOWNERS on GitHub
Pull Request resolved: https://github.com/facebook/react-native/pull/23678
Differential Revision: D14253726
Pulled By: cpojer
fbshipit-source-id: ffb47c18b7078b7489dadb352cdaa5ffea0d0aea
Summary:
1. Feature parity with Android, that already have this extensibility point on `build.gradle`:
7c9805ce16/react.gradle (L12)
2. Helps with using react-native on a monorepo project (yarn workspaces) without having to use the no-hoist feature (e.g. in my case the `ENTRY_FILE` is on `root/packages/mobile/index.js` instead of `root/index.ios.js`)
[iOS] [Added] - Allow overriding ENTRY_FILE on react-native-xcode.sh script
Pull Request resolved: https://github.com/facebook/react-native/pull/23667
Differential Revision: D14247236
Pulled By: hramos
fbshipit-source-id: 2f678c65eb898fc04549ab738b62e5864d753afd
Summary: Small perf wins for both iOS and Android.
Reviewed By: PeteTheHeat
Differential Revision: D14237532
fbshipit-source-id: 2be114d36adfa6e8540cb8cbca5412782791d8ce
Summary:
@public
The cloning features of YogaNode don’t seem to be used. Let’s remove them.
Reviewed By: SidharthGuglani
Differential Revision: D14165624
fbshipit-source-id: 5b710964a4abf1b35f3bcc25b143ffc719a03cec
Summary: The changes allows to get the State object on mounting layer and initiate the updates.
Reviewed By: mdvacca
Differential Revision: D14217185
fbshipit-source-id: 370644e06e350932e93c39adbe46544b071c28b3
Summary:
In React Native there are several use cases where React State is not the only input that affects the component tree. E.g., in case of a <Modal> component, the screen size directly affects the layout of components inside modal; in the case of uncontrolled <TextInput> component, the text inside the input affects the layout of the surrounding components. `State` is a special (legit!) workaround for all those similar cases. Native part of React Native maintains a special shared object between all nodes of the same family and use that during cloning and commits.
See coming commits to know how to use that.
In the near future State will fully replace LocalData concept but for simplicity they both exist for now.
Reviewed By: mdvacca
Differential Revision: D14217184
fbshipit-source-id: 6e018c5b68208d662462013bce0f4e2733d2f673
Summary:
A couple of small changes:
1. `onEnqueue` was decoupled from `enqueueEvent` for easier and unified overiding in subclasses (other methods will call `onEnqueue` soon);
2. `flushEvents` was decoupled from `onBeat` (we will put more stuff into `onBeat` soon).
Reviewed By: mdvacca
Differential Revision: D14205769
fbshipit-source-id: 574c2b2caaa6432bc7782b2f3bc147fa1fb82bd3
Summary: `LayoutConstraints::clamp` clamps the provided `Size` between the `minimumSize` and `maximumSize` bounds of this `LayoutConstraints`.
Reviewed By: mdvacca
Differential Revision: D14205770
fbshipit-source-id: 4799608cead393451d334e47dd6906255699a1e8