Граф коммитов

82 Коммитов

Автор SHA1 Сообщение Дата
Valentin Shergin d0871d0a9a Clang format for all React Native files
Summary:
Buckle up, this enables clang-format prettifier for all files in React Native opensource repo.

Changelog: [Internal] Clang-format codemod.

Reviewed By: mdvacca

Differential Revision: D20331210

fbshipit-source-id: 8da0f94700be0c35bfd399e0c48f1706de04f5b1
2020-03-08 23:01:17 -07:00
Ramanpreet Nara 6a9a76e420 Make RCTDevLoadingView TurboModule-compatible
Summary:
This is a redo of D16969764, with a few extensions.

## Changes
1. Move `RCTDevLoadingView.{h,m}` to `CoreModuels/RCTDevLoadingView.{h,mm}`
2. Extract ObjC API of `RCTDevLodingView` into `RCTDevLoadingViewProtocol` in `ReactInternal`.
3. Create API `RCTDevLoadingViewSetEnabled.h` in `ReactInternal` to enable/disable `RCTDevLoadingView`

Changelog:
[iOS][Added] - Make RCTDevLoadingView TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18642554

fbshipit-source-id: 6b62e27e128d98254b7a6d018399ec1c06e274fc
2020-02-27 17:06:13 -08:00
Tommy Nguyen 74b667dbc2 iOS: Fix RCTDevLoadingView not showing up with UIScene (#27916)
Summary:
Attaches the loading view to a `UIScene` in apps using the new Scenes API (iOS 13+).

## Changelog

[iOS] [Fixed] - Fix RCTDevLoadingView not showing up with UIScene
Pull Request resolved: https://github.com/facebook/react-native/pull/27916

Test Plan:
Create a new app based on UIScene and integrate React Native.

| Before | After  |
|:------:|:------:|
 | <img width="453" alt="image" src="https://user-images.githubusercontent.com/4123478/73485717-eccfe800-43a3-11ea-96fd-f7077a348345.png"> | <img width="453" alt="image" src="https://user-images.githubusercontent.com/4123478/73485749-f9ecd700-43a3-11ea-8a18-2e2185e62e78.png"> |

Reviewed By: PeteTheHeat

Differential Revision: D20104655

Pulled By: hramos

fbshipit-source-id: 86c1902c00f791fd23f75ea7562b44c92e719c5e
2020-02-26 19:06:02 -08:00
Varun Patel 8c10147ed5 Revert D20008608: iOS: Fix RCTDevLoadingView not showing up with UIScene
Differential Revision:
D20008608

Original commit changeset: ce59fd0b000d

fbshipit-source-id: aff385a9586de92c4033f994839617ba675ff365
2020-02-21 19:04:14 -08:00
Tommy Nguyen 8ce27df08a iOS: Fix RCTDevLoadingView not showing up with UIScene (#27916)
Summary:
Attaches the loading view to a `UIScene` in apps using the new Scenes API (iOS 13+).

## Changelog

[iOS] [Fixed] - Fix RCTDevLoadingView not showing up with UIScene
Pull Request resolved: https://github.com/facebook/react-native/pull/27916

Test Plan:
Create a new app based on UIScene and integrate React Native.

| Before | After  |
|:------:|:------:|
 | <img width="453" alt="image" src="https://user-images.githubusercontent.com/4123478/73485717-eccfe800-43a3-11ea-96fd-f7077a348345.png"> | <img width="453" alt="image" src="https://user-images.githubusercontent.com/4123478/73485749-f9ecd700-43a3-11ea-8a18-2e2185e62e78.png"> |

Reviewed By: cpojer

Differential Revision: D20008608

Pulled By: hramos

fbshipit-source-id: ce59fd0b000d7dee51985a5533d9b5791687f592
2020-02-20 15:38:16 -08:00
Andy Matuschak f21fa4ecb7 Enabling RCTWebSocket on UIKitForMac (macOS Catalyst) (#27469)
Summary:
In https://github.com/facebook/react-native/issues/25427, radex added initial support for running React Native projects on macOS via Catalyst. However, `RCTWebSocket` was disabled for that target because of some compilation issues. This meant that running projects via a connection to the packager wasn't possible: no live reload, and projects must be run in "Release" mode. It also meant making manual changes to Xcode projects deploying to macOS and scattering a number of conditional checks throughout the codebase.

In this change, I've implemented support for `RCTWebSocket` on the macOS target and re-enabled the affected features. Live reload and the inspector now work for macOS targets. Manual modifications of Xcode build settings are no longer necessary for react-native projects running on macOS.

![Screen Shot 2019-12-10 at 8 36 38 AM](https://user-images.githubusercontent.com/2771/70549905-ce7b0800-1b29-11ea-85c6-07bf09811ae2.png)

### Limitations

There's no binding which displays the developer menu (since there's no shake event on macOS). We'll probably want to add one, perhaps to the menu bar.

I've chosen not to commit the modifications to RNTester which enable macOS support, since that would imply more "official" support for this target than I suspect you all would like to convey. I'm happy to add those chunks if it would be helpful.

## Changelog

[iOS] [Added] - Added web socket support for macOS (Catalyst), enabling debug builds and live reload
Pull Request resolved: https://github.com/facebook/react-native/pull/27469

Test Plan:
* Open RNTester/RNTester.xcodeproj with Xcode 11.2.1, run it like a normal iOS app -- make sure it compiles and runs correctly (no regression)
* Select "My Mac" as device target, and run. You may need to configure a valid development team to make signing work.
* RNTester should run fine with no additional configuration. Modify a file in RNTester, note that live reload is now working.
* Test the developer inspector. To display the developer menu, you'll need to manually show it; here's an example diff which does that:
```
 diff --git a/RNTester/js/RNTesterApp.ios.js b/RNTester/js/RNTesterApp.ios.js
index 8245a68d12..a447ad3b1b 100644
 --- a/RNTester/js/RNTesterApp.ios.js
+++ b/RNTester/js/RNTesterApp.ios.js
@@ -19,6 +19,8 @@ const React = require('react');
 const SnapshotViewIOS = require('./examples/Snapshot/SnapshotViewIOS.ios');
 const URIActionMap = require('./utils/URIActionMap');

+import NativeDevMenu from '../../Libraries/NativeModules/specs/NativeDevMenu';
+
 const {
   AppRegistry,
   AsyncStorage,
@@ -143,6 +145,7 @@ class RNTesterApp extends React.Component<Props, RNTesterNavigationState> {

   UNSAFE_componentWillMount() {
     BackHandler.addEventListener('hardwareBackPress', this._handleBack);
+    NativeDevMenu.show();
   }

   componentDidMount() {
```

Reviewed By: sammy-SC

Differential Revision: D18945861

Pulled By: hramos

fbshipit-source-id: edcf02c5803742c89a845a3e5d72bc7dacae839f
2019-12-17 16:52:29 -08:00
Rick Hanlon 13992f90e4 Reconnect to debugger after reload
Summary:
This diff allows re-connecting to the debugger websocket after reloading so that if, for example, metro has restarted, we'll reconnect to allow for debugging. Previously you would need to kill the app and re-open it to re-register the debugger websocket.

Changelog: [iOS] [Fixed] Reconnect to debugger websocket after metro is restarted.

Reviewed By: motiz88

Differential Revision: D18820399

fbshipit-source-id: ddbfa4476e70a6313c877a050ef2d77c04d1657e
2019-12-06 04:59:22 -08:00
Ramanpreet Nara 1ad0862363 Revert D16969764: Make RCTDevLoadingView TurboModule-compatible
Differential Revision:
D16969764

Original commit changeset: 47e6682eea3f

fbshipit-source-id: d95b76eb8e57bbaff840b3d85f3745b13d622ce0
2019-11-21 08:43:12 -08:00
Ramanpreet Nara 294e31b7c2 Make RCTDevLoadingView TurboModule-compatible
Summary:
RCTDevLoadingView wasn't hooked up to the codegen. This diff makes RCTDevLoadingView type-safe and also makes it TurboModule-compatible.

Changelog:
[iOS][Added] - Make RCTDevLoadingView TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D16969764

fbshipit-source-id: 47e6682eea3fc49d3f0448c636b5f616d5bce220
2019-11-20 11:20:12 -08:00
Ramanpreet Nara fe3ae9dce8 Make RCTDevMenu and RCTDevSettings TurboModule-compatible
Summary:
Changelog:
[iOS][Added] - Make RCTDevMenu and RCTDevSettings TurboModule-compatible

Reviewed By: shergin

Differential Revision: D18148890

fbshipit-source-id: bd4f0b2797e299cd963e34fa47044a9e1232efe0
2019-11-04 16:07:23 -08:00
Peter Argany dc3b5ad275 Remove unneeded NSNotification center removeObserver
Summary:
A very common pattern I've seen in RN codebase:

     - (instancetype) init {
        [[NSNotificationCenter defaultCenter] addObserver:self ...]
      }

    - (void) dealloc {
       [[NSNotificationCenter defaultCenter] removeObserver:self ...]
     }

From Apple:

https://developer.apple.com/documentation/foundation/nsnotificationcenter/1413994-removeobserver?language=objc

> If your app targets iOS 9.0 and later or macOS 10.11 and later, you don't need to unregister an observer in its dealloc method.

RN targets iOS9+

Changelog: [Internal][Cleanup] Remove unneeded NSNotification center removeObserver

Reviewed By: shergin

Differential Revision: D18264235

fbshipit-source-id: 684e5f5555cec96b055b13cd83daaeb393f4fac9
2019-11-04 10:19:30 -08:00
Peter Argany 2a13f12106 Re-implement reload reason [7/n]
Summary:
This diff adds back RN reload reason, which was removed earlier in the stack. cc/Rick

For callsites which already had a reason, I kept the string exactly the same. For callsites which didn't have a reason, I made up something reasonable.

Changelog: [Internal][Fixed] Re-implemented bridge reload reason text.

Reviewed By: RSNara

Differential Revision: D18074478

fbshipit-source-id: 64a3cd7718674a7ba7228a80e34791ce9f153f9f
2019-10-30 12:23:25 -07:00
Peter Argany d98cd7d3a1 Migrate bridge reload to RCTReloadCommand [2/n]
Summary:
Motivation described in diff 1/N.

This diff replaces calls to `[bridge reload]` with calls to `RCTReloadCommand`. This shouldn't have any change in behaviour since RCTBridge listens to RCTReloadCommand and calls `[bridge reload]` [here](https://fburl.com/diffusion/kemzkrei).

It will allow us to customize who listens and reacts to RN lifecycle.

Changelog: [Internal][Changed] - Migrated [bridge reload] calls to RCTReloadCommand

Reviewed By: shergin

Differential Revision: D17880909

fbshipit-source-id: 80b26c6badd4b216656fed6dd04554e9877f4bb7
2019-10-30 12:23:24 -07:00
Emily Janzer e7f6210d5d Don't attempt to connect to React devtools every 2s
Summary:
When testing out the NetworkOverlay, I noticed that we were creating a lot of WebSocket connections for localhost:8097. Rick found that this is because we're trying to connect to React devtools every 2 seconds: https://github.com/facebook/react/blob/master/packages/react-devtools-core/src/backend.js#L67 and it appears we create a new WebSocket every time.

Dan suggested that we use opening the dev menu as a trigger for attempting to connect to React devtools. This diff uses RCTNativeAppEventEmitter to emit an event from native when the dev menu/dialog is shown, and listening to that event in JS to attempt to connect to devtools.

I'm also making the change of passing in a websocket instead of just passing in the host + port; this way it will only attempt to connect once on each call to `connectToDevTools` (otherwise, we would attempt to reconnect every 2 seconds as soon as the dev menu is opened, and then the next time the menu is opened we'd so start that *again*, and so on - I could have it keep track of whether it's already connecting and avoid doing it again, but this is easier and should be sufficient, I think).

We should probably also update the suggested troubleshooting tips on the devtools page to reflect this change, so that people don't get confused.

Changelog: [General] [Fixed] Fix issue where we attempt to connect to React devtools every 2 seconds

Reviewed By: mmmulani

Differential Revision: D17919808

fbshipit-source-id: 4658d995c274574d22f2f54ea06d7f29ef2f54dc
2019-10-23 10:30:43 -07:00
Andres Suarez aee88b6843 Tidy up license headers [3/n]
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: yungsters

Differential Revision: D17952693

fbshipit-source-id: 8fcb8e58a2e04e7a3169f4d525bffc00835768e6
2019-10-16 10:06:34 -07:00
Andres Suarez 3b31e69e28 Tidy up license headers [2/n]
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: yungsters

Differential Revision: D17952694

fbshipit-source-id: 17c87de7ebb271fa2ac8d00af72a4d1addef8bd0
2019-10-16 10:06:34 -07:00
Andres Suarez 722feeb02b Tidy up license headers [1/n]
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: yungsters

Differential Revision: D17952695

fbshipit-source-id: 81aa607612ba1357ef7814ef20371335151afe7e
2019-10-16 10:06:33 -07:00
Rick Hanlon 2ccc8fbc28 Add and use reloadWithReason to iOS
Summary:
This diff adds a new reloading method reloadWithReason that allows callers to provide a reason for why a reload was requested.

This reason is useful for understanding why users are reloading, and why Fast Refresh is bailing out to a full reload. I also updated the places we reload with the reasons listed below.

**Standard native reasons:**
- Redbox
- Command
- Global hotkey
- Profiling controls
- Dev menu - reload
- Dev menu - reset to default
- Dev menu - apply changes

**From JavaScript (added in a later diff):**
- Fast Refresh - Unrecoverable
- Fast Refresh - No root boundary
- Fast Refresh - Invalidated boundary
- Fast Refresh - Invalidated root boundary

**Misc reasons and fallback for when a reason is unavailable:**
- Unknown from JS
- Uncategorized from JS
- Unknown from bridge
- Unknown from cxx bridge
- Requested from bridge
- Custom executor class reset

Reviewed By: cpojer

Differential Revision: D17499339

fbshipit-source-id: 12a21ffa05708c9b921d93911f190cdffc5c78d5
2019-09-30 07:03:50 -07:00
Christoph Nakazawa 90a8e3012c Remove live reloading option from RN iOS
Summary: See previous diff in this stack

Reviewed By: motiz88

Differential Revision: D17156649

fbshipit-source-id: 12bdba248481258b9c6ca001472a41ca19fb4b6f
2019-09-06 03:48:49 -07:00
Mehdi Mulani d2cb52beee Allow RCTDevMenu to be enabled separately from RCT_DEV flag
Summary:
@public
RCTDevMenu and RCTDevSettings are used to display the dev menu you see when you shake the device.
With this change in build flags, it's possible to build them into a production version of the app without pulling in all the RCT_DEV logic.

Reviewed By: shergin

Differential Revision: D17116992

fbshipit-source-id: 71458c49affe5bb94c52c9d8bb0f793b16d35828
2019-09-03 15:54:11 -07:00
Chet Corcos 81733d9e15 Don't call sharedApplication in App Extension (#26077)
Summary:
Related to this bug: https://github.com/facebook/react-native/pull/25769

Note I also had to add to the bottom of my podfile because RCTLinking had APPLICATION_EXTENSION_API_ONLY='YES' by default somehow.

```
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
    end
  end
end
```
Pull Request resolved: https://github.com/facebook/react-native/pull/26077

Test Plan: Sandcastle should be sufficient.

Reviewed By: shergin

Differential Revision: D16860356

Pulled By: sammy-SC

fbshipit-source-id: 02cb3fd3f977420ccdc2991f0c3666ab0186b7bf
2019-08-19 02:49:59 -07:00
Christoph Nakazawa 88d0ac17e8 Metro Bundler -> Metro
Summary: This bothers me, we renamed the project to drop the "Metro" a while ago.

Reviewed By: rubennorte

Differential Revision: D16831281

fbshipit-source-id: bb6de412eccda61b617580f3660e3e635f2d2815
2019-08-16 10:37:10 -07:00
Rick Hanlon eb92f8181f Update loading pre-bundled message
Summary:
Updated the message from

> Loading from pre-bundled file

to

> Connect to Metro to develop JavaScript

I also added a new RCT_PACKAGER_NAME so other packagers can override "Metro"

Reviewed By: yungsters, cpojer

Differential Revision: D16427501

fbshipit-source-id: 1b7f9e261f7521ba930c6248087fe6f3c3659cb7
2019-08-07 09:34:46 -07:00
James Treanor 8131b7bb7b CocoaPods frameworks compatibility: Step 2 (#25619)
Summary:
This is my proposal for fixing `use_frameworks!` compatibility without breaking all `<React/*>` imports I outlined in https://github.com/facebook/react-native/pull/25393#issuecomment-508457700. If accepted, it will fix https://github.com/facebook/react-native/issues/25349.

It builds on the changes I made in https://github.com/facebook/react-native/pull/25496 by ensuring each podspec has a unique value for `header_dir` so that framework imports do not conflict. Every podspec which should be included in the `<React/*>` namespace now includes it's headers from `React-Core.podspec`.

The following pods can still be imported with `<React/*>` and so should not have breaking changes: `React-ART`,`React-DevSupport`, `React-CoreModules`, `React-RCTActionSheet`, `React-RCTAnimation`, `React-RCTBlob`, `React-RCTImage`, `React-RCTLinking`, `React-RCTNetwork`, `React-RCTPushNotification`, `React-RCTSettings`, `React-RCTText`, `React-RCTSettings`, `React-RCTVibration`, `React-RCTWebSocket` .

There are still a few breaking changes which I hope will be acceptable:

- `React-Core.podspec` has been moved to the root of the project. Any `Podfile` that references it will need to update the path.
- ~~`React-turbomodule-core`'s headers now live under `<turbomodule/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-turbomodulesamples`'s headers now live under `<turbomodulesamples/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-TypeSaferty`'s headers now live under `<TypeSafety/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511040967.
- ~~`React-jscallinvoker`'s headers now live under `<jscallinvoker/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- Each podspec now uses `s.static_framework = true`. This means that a minimum of CocoaPods 1.5 ([released in April 2018](http://blog.cocoapods.org/CocoaPods-1.5.0/)) is now required. This is needed so that the ` __has_include` conditions can still work when frameworks are enabled.

Still to do:

- ~~Including `React-turbomodule-core` with `use_frameworks!` enabled causes the C++ import failures we saw in https://github.com/facebook/react-native/issues/25349. I'm sure it will be possible to fix this but I need to dig deeper (perhaps a custom modulemap would be needed).~~ Addressed by 33573511f0.
- I haven't got Fabric working yet. I wonder if it would be acceptable to move Fabric out of the `<React/*>` namespace since it is new? �

## Changelog

[iOS] [Fixed] - Fixed compatibility with CocoaPods frameworks.
Pull Request resolved: https://github.com/facebook/react-native/pull/25619

Test Plan:
### FB

```
buck build catalyst
```

### Sample Project

Everything should work exactly as before, where `use_frameworks!` is not in `Podfile`s. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which has `use_frameworks!` in its `Podfile` to demonstrate this is fixed.

You can see that it works with these steps:

1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git`
2. `git checkout fix-frameworks-subspecs`
3. `cd ios && pod install`
4. `cd .. && react-native run-ios`

The sample app will build and run successfully. To see that it still works without frameworks, remove `use_frameworks!` from the `Podfile` and do steps 3 and 4 again.

### RNTesterPods

`RNTesterPodsPods` can now work with or without `use_frameworks!`.

1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.

Reviewed By: PeteTheHeat

Differential Revision: D16465247

Pulled By: PeteTheHeat

fbshipit-source-id: cad837e9cced06d30cc5b372af1c65c7780b9e7a
2019-07-24 23:27:09 -07:00
Min ho Kim 84f5ebe4f9 Fix typos (#25770)
Summary:
Fix typos mostly in comments and some string literals.

## Changelog

[General] [Fixed] - Fix typos
Pull Request resolved: https://github.com/facebook/react-native/pull/25770

Differential Revision: D16437857

Pulled By: cpojer

fbshipit-source-id: ffeb4d6b175e341381352091134f7c97d78c679f
2019-07-23 03:23:11 -07:00
Dan Abramov 93aab84699 Remove the escape hatch
Summary: I originally added `forceFullRefresh` as an escape hatch in case Fast Refresh is too unreliable. In practice we haven't seen any major issues with it. Since this option is already very obscure, I'm just removing it.

Reviewed By: shergin

Differential Revision: D16286632

fbshipit-source-id: c3dc44cffd459912e194e273acf868f3380c64cc
2019-07-17 06:29:25 -07:00
Radosław Pietruszewski 3724810d21 Initial UIKitForMac support (#25427)
Summary:
This PR adds initial support for Project Catalyst a.k.a. UIKitForMac. This is not yet meant for production, but this is enough for RNTester to successfully compile and mostly work :)

Some APIs are not supported on the Mac -- e.g. telephony, and deprecated APIs are removed on Mac ���-- those had to be ifdef'd out via platform checks.

The biggest limitation right now is that I couldn't get Web Socket code to successfully compile, and so there are a lot of temporary platform checks  for that , and the RCTWebSocket.xcodeproj is marked as not supporting UIKitForMac. Again -- temporary, until someone with more knowledge knows how to fix this.

https://github.com/react-native-community/discussions-and-proposals/issues/131

## Changelog

[iOS] [Added] - Fixed compilation for macOS (Project Catalyst) -- not meant for production use yet
Pull Request resolved: https://github.com/facebook/react-native/pull/25427

Test Plan:
- Open RNTester/RNTester.xcodeproj with Xcode 10.2, run it like a normal iOS app -- make sure it compiles and runs correctly (no regression)
- Open the same project with Xcode 11 beta 2 (or higher) on macOS Catalina beta, select "My Mac" as device target, and run -- see that it actually compiles and runs. **Note** there are unfortunately some required steps:
   - change build configuration to Release (because packager doesn't work correctly yet)
   - change development team to yours if Xcode tells you to
   - go to RNTester project → Build phases → Link binary with libraries, and change `platforms` for `libRCTWebSocket.a` to `iOS` (without Mac compatibility). I can't commit that change because it breaks compatibility with earlier Xcode versions

The two extra steps for successful compile will disappear once web socket compilation for Catalyst is fixed

Reviewed By: mmmulani

Differential Revision: D16088263

Pulled By: sammy-SC

fbshipit-source-id: 9c0b932b048e50a8e0f336eaa0612851b1909cae
2019-07-04 10:30:33 -07:00
Dan Abramov a52e6d1dbb Unify "Hot Reloading" and "Reload-on-Save" into "Fast Refresh"
Summary:
We have too many options in the Dev Menu, and they're really hard to pick from. They're also somewhat conflicting. This replaces two menu choices that have a similar purpose (faster iteration cycle) with one.

"Fast Refresh" tries to only update the affected modules, but falls back to doing a full reload if the update can't be handled by the React components.

If for some reason you prefer the "Reload-on-Save" behavior, please:

- Reach out to me so I can learn more about your use case.
- As a workaround, you can add `if (__DEV__) require.Refresh.forceFullRefresh = true` to your app's entry point to always do a full refresh.

Also note that I only removed the user-facing part of "Reload-on-Save". So if you have automation depending on it, that's gonna keep working.

I moved it above Systrace since it's a more generic feature.

As a total aside nit, I renamed "Enable Inspector" and "Disable Inspector" to "Show Inspector" and "Hide Inspector" because... that's what those options do, really.

Reviewed By: rickhanlonii

Differential Revision: D15958697

fbshipit-source-id: 20e856d56f661fe4d39b5ab47d8c44754bf70f67
2019-06-24 13:54:39 -07:00
Mehdi Mulani 6042de43c7 Improve changing bundler support
Summary: This makes it so that you don't have to specify the package to the bundle. When you don't specify it, it will use the default bundle that is chosen when the app starts.

Reviewed By: PeteTheHeat

Differential Revision: D15742001

fbshipit-source-id: cd5906a66d04eea308dbc0516bc1fec60caed6bb
2019-06-11 10:20:09 -07:00
Tim Yung 664646055a RN: Restore Debug Bridge Description (iOS)
Summary: Restores the bridge description in the debug menu on iOS.

Reviewed By: fkgozali

Differential Revision: D15680775

fbshipit-source-id: c17ad44f2287e03bb2039b4aa4b1311e7ec9106b
2019-06-05 19:00:32 -07:00
Jim Berlage f5aa52399b Ensure that iOS uses RCT_METRO_PORT instead of hardcoded 8081 when appropriate (#25144)
Summary:
In environments with McAfee EPro software, port 8081 is used and cannot be unbound.  (See [#20466](https://github.com/facebook/react-native/issues/20466) for a recent example issue.)  Most issues can be worked around by passing a `--port` option or setting `RCT_METRO_PORT`, but there are a couple places where 8081 is hardcoded that block adoption.  Right now the workaround I've seen pushed on Stack Overflow and elsewhere is to modify node_modules after a `yarn install`, so I'd like to fix it at the source.

This PR changes the react "Start Packager" build step and some code in the iOS DevSupport library to read from the `RCT_METRO_PORT` variable.

## Changelog

[General] [Changed] - Removed hardcoded references to port 8081 and replaced them by reading from RCT_METRO_PORT (w/ fallback to 8081)
Pull Request resolved: https://github.com/facebook/react-native/pull/25144

Differential Revision: D15630119

Pulled By: cpojer

fbshipit-source-id: aff5d24691e0e9892a035cfbd25330fed6441199
2019-06-04 13:29:49 -07:00
Tim Yung 796e9b0e37 RN: Debug Menu Cleanup (iOS)
Summary:
Addresses a number of pieces of feedback regarding the debug menu.

- Simplify labels for the debugger actions (e.g. no "remote", no emoji).
- Reorder actions so that modal items are generally lower.
- Changed "Toggle Inspector" to "Show/Hide Inspector".
- Renamed "Live Reloading" to "Reload-on-Save".
- Hide disabled debug items when profiling is enabled.
- Changed "Start Systrace" to "Systrace Unavailable" when debugging.
- Renamed "Change packager location" to "Configure Bundler".
- Revised nomenclature in "Configure Bundler" menu to be clearer.
- Removed extraneous debug menu title.
- Consistently refer to HMR as "Hot Reloading".

Changelog:
[iOS] [Changed] - Cleaned up debug menu.

Reviewed By: axe-fb

Differential Revision: D15548628

fbshipit-source-id: 26b2ddca8280d1f6f8ff904439b403600e98a3b3
2019-05-30 22:42:24 -07:00
Nurzhan Bakibayev f00d1b8518 Change default Inspector Proxy port to 8081
Summary: Change default Inspector Proxy port to 8081

Reviewed By: cwdick

Differential Revision: D14745974

fbshipit-source-id: f4b3b158f55c6f5f1b3d9cc2528c5ddb59774a8b
2019-04-03 08:39:08 -07:00
Joshua Gross 1b51cd488a Fix retain cycle in RCTDevMenu
Summary: A retain-cycle regression was added by D14162776 and detected here: T41208740. Fix should be trivial.

Reviewed By: shergin

Differential Revision: D14709784

fbshipit-source-id: bad6ab31a5170e9320c4432cbd20d02ec6164f38
2019-04-01 13:45:09 -07:00
Kevin Gozali 75f2da23c5 TM iOS: disable remote debugging toggle when TurboModule is active
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
2019-03-01 14:30:35 -08:00
Jacob Parker 30f13812ad Make JS loading progress use tabular numbers
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/20076

Differential Revision: D14162853

Pulled By: cpojer

fbshipit-source-id: a07b80319e23f8969887522b8761a560e8a3a98e
2019-02-20 22:14:23 -08:00
Luis Rivera fd96e2cb2c Feature: dev menu option to change packager location during runtime (#21970)
Summary:
Add an option to dev menu to change packager location on the fly on iOS (similar to Dev Settings in Android)
Pull Request resolved: https://github.com/facebook/react-native/pull/21970

Differential Revision: D14162776

Pulled By: cpojer

fbshipit-source-id: 3cca4f4fbd8c599bd5342ba1ae64905a03270d48
2019-02-20 22:07:11 -08:00
Eric Lewis 468ae234a6 Fix xcode warnings (#23565)
Summary:
As part of #22609, this fixes yet more warnings.
- Adding more __unused to params.
- Refactors `isPackagerRunning` to use NSURLSession.
- Turns off suspicious comma warnings

[iOS] [Fixed] - Xcode Warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/23565

Differential Revision: D14161151

Pulled By: cpojer

fbshipit-source-id: 339874711eca718fc6151e84737ccc975225d736
2019-02-20 18:46:23 -08:00
Eric Lewis 19866aee3d Fix 50 xcode warnings (#23553)
Summary:
This PR reduces the number of warnings in React from 68 to 18. Mostly by marking unused variables. RNTester's warnings are more than halved.

[iOS] [Fixed] - Xcode warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/23553

Differential Revision: D14151339

Pulled By: hramos

fbshipit-source-id: 8255330bf910a69a4c03051d91d7b0de3fadf2d1
2019-02-20 10:17:26 -08:00
Joshua Gross 6418e30e90 Small changes to get Profile build working
Summary: Small changes to get Profile build working. Compiler errors or immediate crashes occur without these lines, when running a profile build on device.

Reviewed By: fkgozali

Differential Revision: D13823136

fbshipit-source-id: a1777d5337d8bd78ef3eb11bbeeb7e23c383ab83
2019-01-28 14:36:30 -08:00
Pavlos Vinieratos 61ca119650 Replace deprecated `stringByReplacingPercentEscapesUsingEncoding:` with `stringByAddingPercentEncodingWithAllowedCharacters:` (#19792)
Summary:
Replace some NSString deprecated methods.
motivation for these prs is less warnings reported on xcode everytime we compile a rn app.

N/A

[INTERNAL] [DEPRECATIONS] [NSString] - Replace NSString deprecation methods.
Pull Request resolved: https://github.com/facebook/react-native/pull/19792

Differential Revision: D8515136

Pulled By: cpojer

fbshipit-source-id: 4379ef4e229ef201685b87e54ac859ba3d30a833
2019-01-25 05:25:39 -08:00
Tim Yung a689711f68 RN: Missing Copyright Headers
Summary: Adds copyright headers to all files that are missing them.

Reviewed By: hramos

Differential Revision: D12837494

fbshipit-source-id: 6330a18919676dec9ff2c03b7c9329ed9127d930
2018-10-31 01:37:26 -07:00
Marc Horowitz c49d3653ef iOS changes to switch to JSI
Summary:
change RCTCxxBridge to use JSIExecutorFactory+JSCRuntime
instead of JSCExecutorFactory.  Also remove JSC usage from RN in other
files.  This allows deleting files, too, which is done further down
the stack.

Reviewed By: RSNara

Differential Revision: D9369111

fbshipit-source-id: 67ef3146e3abe5244b6cf3249a0268598f91b277
2018-10-18 01:06:24 -07:00
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Yan Soares Couto edf71005b5 Hiding pre-bundled notification when not on dev mode
Summary: Notification "loading from pre-bundled file" won't show up anymore on non-dev mode.

Reviewed By: adamjernst

Differential Revision: D8874556

fbshipit-source-id: 8bfa63691beb65d16617409533f7a38dc00dc310
2018-07-17 07:17:09 -07:00
Yan Soares Couto fc94f95962 Enable RCTDevLoadingView with another flag
Reviewed By: javache

Differential Revision: D8723591

fbshipit-source-id: 196cecd73ba0e1a1d34ec9a775cf03a25f352401
2018-07-09 03:32:48 -07:00
Héctor Ramos da7873563b Migrate Android sources to MIT license header
Reviewed By: fkgozali

Differential Revision: D8065619

fbshipit-source-id: 719c303b40c96950bab8e5dde9a75f449b2956c6
2018-05-31 15:37:30 -07:00
Federico Trimboli 3d3edfc3da Replace magic numbers with `safeAreaInsets` in `RCTDevLoadingView`
Summary:
This PR replaces magic numbers used for offsetting `RCTDevLoadingView` when running on iPhone X, in favour of `safeAreaInsets`.

Tested on iPhone X and iPhone 8. Here is a screenshot showing how it looks on iPhone X.
![nansi](https://user-images.githubusercontent.com/3900360/39599961-b4239d90-4ef3-11e8-97f4-269d571a6c8d.png)
Closes https://github.com/facebook/react-native/pull/19119

Differential Revision: D7984823

Pulled By: hramos

fbshipit-source-id: 0c7c3ba0fa258a64f6c4a1e0620f87bf0620984c
2018-05-12 23:25:09 -07:00
Eric Czarny bec97dc243 Expose native show message method in header
Reviewed By: mmmulani

Differential Revision: D7201691

fbshipit-source-id: b5f74351a9be7e6e9a7fc7145a09ba9854efc002
2018-03-14 11:17:12 -07:00
Shoaib Meenai ffcd067977 Wrap global variables in extern C
Reviewed By: compnerd

Differential Revision: D7144899

fbshipit-source-id: d40bda0e9225734398e35adc582b8932c0280b24
2018-03-02 19:44:18 -08:00