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

40 Коммитов

Автор SHA1 Сообщение Дата
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Daniel Sainati 974f0a3281 pre-suppress this typing errors ahead of 154
Summary:
This pre-suppresses the 154 error diff ahead of its release, since it is large.

Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D29065246

fbshipit-source-id: f418041305a46df410dcbe3d9a4db81a61ac7014
2021-06-11 14:31:41 -07:00
Daniel Sainati 74d5d03dbd pre-suppress Flow errors in xplat ahead of 153 release
Summary:
This pre-suppresses the 153 error diff ahead of its release, since it is large.

Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D28754374

fbshipit-source-id: 1806f53bc7d804644d434583a2dcd6da63d00328
2021-06-01 09:01:26 -07:00
Rubén Norte 8abe737068 Centralize public access to LogBox in LogBox module
Summary:
Some components are using `LogBoxData` directly, forcing logs to be shown on the screen even when LogBox is uninstalled. This changes all accesses to `LogBoxData` to go through `LogBox` so `uninstall` is used correctly.

It also changes when LogBox is installed, moving it from `AppContainer` to `InitializeCore` (which happens earlier) so we can capture more logs in LogBox.

Changelog: [General][Changed] Initialized LogBox earlier and centralized access in LogBox module

Reviewed By: rickhanlonii

Differential Revision: D27999361

fbshipit-source-id: 1115ef6b71e08cc33743d205da0064fbe9a74a0e
2021-05-04 10:58:24 -07:00
Rick Hanlon cf20bb8921 Delete YellowBox
Summary:
This diff removes YellowBox (RIP).

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19949737

fbshipit-source-id: 0b653b128d8fc78255778d424a1c014bf5ddbcd0
2020-02-21 10:34:40 -08:00
Rick Hanlon d66169b4fc Deprecate YellowBox and unstable_enableLogBox
Summary:
This diff replaces YellowBox with YellowBoxDeprecated, adding warnings for using the module directly instead of YellowBox. Also adds a no-op message for unstable_enableLogBox.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19949700

fbshipit-source-id: 269c341a2cedcdb2f7a80947d3239db078238201
2020-02-19 18:01:43 -08:00
Rick Hanlon af710ab177 Switch from YellowBox.ignoreWarnings to LogBox.ignoreLogs
Summary:
Migrates internal calls from ignoreWarnings to ignoreLogs so we can remove YellowBox.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D19813781

fbshipit-source-id: 16c7b3f2cd38cba1901eccb4d5b9a2396a37ba1b
2020-02-18 06:19:46 -08:00
Rick Hanlon a62062f3c0 LogBox fixes for OSS
Summary:
This diff fixes two issues with LogBox in OSS.

Changelog: [Internal]

Reviewed By: mmmulani

Differential Revision: D19165696

fbshipit-source-id: 4dd9c480ea3d2b205f8e65cb32203949b1e32e8a
2019-12-18 19:28:56 -08:00
Rick Hanlon e295f4a394 Add WarningFilter handling for YellowBox
Summary:
This diff backports warning filter handling to yellow box. I also backported the skipped warning handling so that ignored patterns do not log to the console, same as LogBox.

Changelog: [Internal]

Reviewed By: gaearon

Differential Revision: D18573288

fbshipit-source-id: 5bf8e86f754adc808313d7ed02f98daaf65de98c
2019-12-11 16:14:17 -08:00
Rick Hanlon c0eddad17b Disable LogBox if native module is not available
Summary: Changelog: [Internal]

Reviewed By: mmmulani

Differential Revision: D18920345

fbshipit-source-id: e5213dc9c3a1aa775138e71a8040a3472e9bbd67
2019-12-10 16:23:33 -08:00
Rick Hanlon dd8e5f468a Add unstable_enableLogBox
Summary:
This diff adds a new `unstable_enableLogBox` function to opt-into the new LogBox experience. If LogBox is not enabled early enough, we show an error with instructions.

With this, LogBox can be enabled with:

```
require('react-native').unstable_enableLogBox();
```

Changelog: [General] [Adds] unstable_enableLogBox

Reviewed By: zackargyle, rubennorte

Differential Revision: D18808940

fbshipit-source-id: 4b0234ddc4d1646515bf63110d5b02133780512e
2019-12-10 02:31:38 -08:00
Eli White e362470305 Convert easy files to flow strict-local
Summary:
This diff was generated by this script used by WWW
https://our.intern.facebook.com/intern/diffusion/WWW/browse/master/scripts/flow/upgrade_to_flow_strict_local.sh?lines=0

Changelog:
[Internal] Upgrade flow to flow strict-local

Reviewed By: zackargyle, rickhanlonii

Differential Revision: D18833630

fbshipit-source-id: e64d4e9a49a0db5e6bf70a0c489567862b578d7f
2019-12-05 16:06:46 -08:00
George Zahariev 8553e1acc4 Exact-by-default codemod for react-native-github
Summary:
We are rolling out exact-by-default syntax to xplat/js.

I had to manually move around some comments to preserve proper placement.

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D18633611

fbshipit-source-id: 48f7468dcc55b1d00985419d035a61c6820b3abe
2019-11-21 09:42:57 -08:00
Christoph Nakazawa fa4f23e4e8 Add codeFrame to each warning and error in LogBox
Summary:
This diff changes the LogBox to show the code frame for the first non-collapsed stack frame. Let me know what you think about this change!

Changelog: [Internal] LogBox changes

Reviewed By: rickhanlonii

Differential Revision: D18372456

fbshipit-source-id: ddf6d6c53ab28d11d8355f4cb1cb071a00a7366e
2019-11-08 08:31:01 -08:00
Rick Hanlon cc056907cf Clean up API for LogBoxLogParser
Summary:
This diff cleans up two functions from:

```
LogBoxLogData.add({args: ['A']});
LogBoxLogParser({args: ['A']});
```

to:

```
LogBoxLogData.add(['A']);
LogBoxLogParser.parseLog(['A']);
```

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18056462

fbshipit-source-id: be6108069fc24b1f25d1382ad31c314183c793f8
2019-10-22 14:13:20 -07:00
Rick Hanlon fa1949dd64 Add global.__reactExperimentalLogBox
Summary:
Adds a global setting to enable LogBox `global.__reactExperimentalLogBox`

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D17966004

fbshipit-source-id: 4d373b2ed12a1eed4e119ba9ebed1d090f8f3121
2019-10-21 21:08:03 -07:00
Moti Zilberman cf4d45ec2b Remove framesToPop from YellowBox
Summary: Removes the use of `framesToPop` to manage frame skipping in YellowBox and replaces it with support for the `collapse` field populated by Metro's [`customizeFrame`](https://github.com/facebook/metro/pull/435) config option. `framesToPop` is a deprecated mechanism which will be removed in the future.

Reviewed By: bvaughn

Differential Revision: D17857057

fbshipit-source-id: 120383ba4aad877b7ca79c7cf9d5b7579a490577
2019-10-10 11:59:52 -07:00
Brian Vaughn 92a3c9da0a React DevTools v4 integration
Summary:
This Diff is being posted for discussion purposes. It will not be ready to land until React DevTools v4 has been published to NPM.

Update React Native to be compatible with the [new version 4 React DevTools extension](https://github.com/bvaughn/react-devtools-experimental).

**Note that this is a breaking change**, as the version 3 and version 4 backends are **not compatible**. Once this update ships (in React Native) users will be required to update their version of the [`react-devtools` NPM package](https://www.npmjs.com/package/react-devtools). The same will be true for IDEs like Nuclide as well as other developer tools like Flipper and [React Native Debugger](https://github.com/jhen0409/react-native-debugger).

Related changes also included in this diff are:
* Pass an explicit whitelist of style props for the React Native style editor (to improve developer experience when adding new styles).
* Update `YellowBox` console patching to coordinate with DevTools own console patching.
  * Also improved formatting slightly by not calling `stringifySafe` for strings (since this adds visible quotation marks).

Regarding the console patching- component stacks will be appended by default when there's no DevTools frontend open. The frontend will provide an option to turn this behavior off though:

{F168852162}

React DevTools will detect if the new version is used with an older version of React Native, and offer inline upgrade instructions:

{F169306863}

**Note that the change to the `RCTEnableTurboModule` will not be included in this Diff**. I've just turned those off temporarily so I can use v8+Chrome for debugging.

Reviewed By: rickhanlonii

Differential Revision: D15973709

fbshipit-source-id: bb9d83fc829af4693e7a10a622acc95a411a48e4
2019-08-26 23:56:59 -07:00
Logan Daniels 92073d4a71 Clean-up $TEMPORARY$object in xplat/js/react-native-github
Reviewed By: panagosg7

Differential Revision: D16931667

fbshipit-source-id: d87e5ed02bf7f95005cf0f36c3cd127026189058
2019-08-21 09:58:24 -07:00
Logan Daniels 91f139b941 xplat/js/react-native-github
Reviewed By: panagosg7

Differential Revision: D16657770

fbshipit-source-id: 4e260842c838a35317515044c54ccf55a083da33
2019-08-09 10:11:15 -07:00
Logan Daniels 9127fb51fc Manual fixes for xplat/js/react-native-github
Summary:
Need to add explicit type annotations in these areas to unblock types-first architecture for Flow. These are locations the codemod could not automatically handle.

I'll call out areas I need a close eye on in the comments.

Reviewed By: panagosg7

Differential Revision: D16659053

fbshipit-source-id: 167dd2abe093019b128676426374c1c62cf71e7f
2019-08-09 10:11:15 -07:00
Moti Zilberman 6764385c80 Type StackFrame fields as nullable
Summary: `parseErrorStack` (which uses the `stacktrace-parser` package) can return null file names, line numbers and column numbers. This diff updates the associated types and adds explicit null checks in some call sites.

Reviewed By: rickhanlonii

Differential Revision: D16542176

fbshipit-source-id: b72c73c05b95df0bbcb5b5baa7bc2d42cff1e074
2019-07-31 09:08:06 -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
Vojtech Novak 5b7edb59a5 fix shouldComponentUpdate in YellowBox (#25097)
Summary:
The previous comparison does not make sense (accessing props by index) - and always returns true. I'm going to assume there was a reason for implementing `shouldComponentUpdate` - although personally I'd just go for PureComponent (even if it may not be 100% accurate). Let me know if PureComponent sounds better.

## Changelog

not needed
Pull Request resolved: https://github.com/facebook/react-native/pull/25097

Differential Revision: D15575079

Pulled By: cpojer

fbshipit-source-id: 49aeb9d2997d3c613fe7a1af4534dff1607d53b4
2019-05-31 00:50:54 -07:00
Michał Pierzchała 8ea749ad3e Add spec for ExceptionsManager (#24900)
Summary:
Part of #24875, adds a spec for ExceptionsManager

## Changelog

[General] [Added] - TM Add spec for ExceptionsManager
Pull Request resolved: https://github.com/facebook/react-native/pull/24900

Reviewed By: fkgozali

Differential Revision: D15434006

Pulled By: RSNara

fbshipit-source-id: 1a505744a84c0c4ac3a9fac6c91a391fbd8a9f46
2019-05-22 13:10:24 -07:00
James Ide 0ee5f68929 Migrate "Libraries" from Haste to standard path-based requires (sans vendor & renderers) (#24749)
Summary:
This is the next step in moving RN towards standard path-based requires. All the requires in `Libraries` have been rewritten to use relative requires with a few exceptions, namely, `vendor` and `Renderer/oss` since those need to be changed upstream. This commit uses relative requires instead of `react-native/...` so that if Facebook were to stop syncing out certain folders and therefore remove code from the react-native package, internal code at Facebook would not need to change.

See the umbrella issue at https://github.com/facebook/react-native/issues/24316 for more detail.

[General] [Changed] - Migrate "Libraries" from Haste to standard path-based requires
Pull Request resolved: https://github.com/facebook/react-native/pull/24749

Differential Revision: D15258017

Pulled By: cpojer

fbshipit-source-id: a1f480ea36c05c659b6f37c8f02f6f9216d5a323
2019-05-08 08:48:59 -07:00
Peter van der Zee dcd4e90d9a Bump Prettier to 1.16.4
Summary:
@public
This bumps Prettier to v1.16.4
Only format source files were updated.

Reviewed By: mjesun

Differential Revision: D14454893

fbshipit-source-id: 72f9872fe764a79dbf0d9fab9bebb1456b039f2f
2019-03-14 07:00:27 -07:00
Amir Sharif d4300cb59b Update typing for YellowBox patterns
Summary: To satisfy Flow, we want to account for RegExp as a valid ignore pattern.

Reviewed By: TheSavior

Differential Revision: D14303072

fbshipit-source-id: 4988fff5c6c6a12da99027e47216cedcf5a4db5a
2019-03-04 12:18:38 -08:00
Amir Sharif 50fc666aad Add support for regex in YellowBox warnings
Summary: We want to use a Regex for potentially more complicated string warnings. This will allow ignoring dynamic rules that include ID fields for example.

Differential Revision: D14079118

fbshipit-source-id: aff01c6b6eedc77cd91638988700c093dcda0488
2019-02-14 16:39:34 -08:00
Rajiv Shah 7a914fcef4 Fix View/Text displayName (#21950)
Summary:
Adds the displayName prop to `View` and `Text` components. Because these now use `React.forwardRef`, they were showing as `Component` instead of their actual names.

Thanks to ljharb for helping to pinpoint the source of the issue!

Fixes #21937
Pull Request resolved: https://github.com/facebook/react-native/pull/21950

Differential Revision: D12827060

Pulled By: TheSavior

fbshipit-source-id: d812cae14d53ad821ab5873e737db63ad1a989e3
2018-10-29 12:42:10 -07:00
Tim Yung d6b9ec1c1f YellowBox: Allow Retrying Symbolication
Summary: When symbolication fails, allow retrying without having to reload the current JS VM.

Reviewed By: ejanzer

Differential Revision: D9760666

fbshipit-source-id: 63837c81fe77a9b0b897a858e3d64bc7dcf2c3bd
2018-09-11 20:47:03 -07:00
Tim Yung 5e6e5e92ca YellowBox: Use Feather Icons for Navigation
Summary: Changes YellowBox to use feather icons for the left and right navigation so that we are not dependent on the system's (sometimes funky) unicode icons.

Reviewed By: ejanzer

Differential Revision: D9759134

fbshipit-source-id: b957c24afdccc04bfe78ae4750777c387c2acef4
2018-09-11 20:47:03 -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
Wayne Cheng f536a0c268 Adding flow strict local to remaining possible files in xplat/JS
Summary:
ag -L --ignore __snapshots__ 'flow strict|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
  cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict-local/'
  until flow check; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done

allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9004573

fbshipit-source-id: 936bd5741706b781be06bf08b6ad805a69407dfd
2018-08-09 08:54:44 -07:00
Tim Yung 537a99539b YellowBox: Fix Off-By-1 Content Rendering Bug
Summary:
Fixes an off-by-one bug that was causing trailing single characters to be truncated from YellowBox.

This snuck in during the revamp of YellowBox. Whoops!

@public

Reviewed By: TheSavior

Differential Revision: D8607388

fbshipit-source-id: d0efac4dec361456ef58347a60eb1486a888624a
2018-06-26 13:33:42 -07:00
Eli White eea4842972 Flow strictify possible files in RN core
Summary:
This was done by running the command on: https://our.intern.facebook.com/intern/wiki/Flow_Strict/

```
ag -L --ignore __snapshots__ 'flow strict$|noflow|generated|partially-generated' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i 's/flow$/flow strict/'
cat ~/temp | xargs ag -L 'flow strict$' | xargs sed -i 's/flow strict-local$/flow strict/'
until flow; do flow --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done
```

Reviewed By: sahrens

Differential Revision: D8530207

fbshipit-source-id: c28c7ac5ed3e9b80f3d126d5f30463be8a8a744d
2018-06-20 00:47:21 -07:00
Tim Yung e8087eccdb YellowBox: Restore ES5 Compatibility
Reviewed By: sahrens

Differential Revision: D8421561

fbshipit-source-id: c2b8d430f4d0c9ce0d5177f0af5eb5f404916024
2018-06-14 09:02:18 -07:00
Tim Yung f6da9e1a9a YellowBox: Define in __DEV__ Only
Summary: This makes it so that `YellowBox` and its dependencies are completely stripped from production bundles.

Reviewed By: sahrens

Differential Revision: D8402545

fbshipit-source-id: 6993521280a02dfe5eab8863d12c46781f35444f
2018-06-13 18:08:25 -07:00
Tim Yung 4f0b9e2554 YellowBox: Apply SafeAreaView in Header
Summary: Uses `SafeAreaView` in the YellowBox inspector header so that it does not collide with the status bar.

Reviewed By: sahrens

Differential Revision: D8374861

fbshipit-source-id: e67358ac9268db8291cacf79df402f3bd5a2173d
2018-06-12 17:48:20 -07:00
Tim Yung d0219a0301 RN: A wild YellowBox has appeared!
Summary:
Replaces the existing `YellowBox` with a modern one.

Here are the notable changes:

- Sort warnings by recency (with most recent on top).
- Group warnings by format string if present.
- Present stack traces similar to RedBox.
- Show status of loading source maps.
- Support inspecting each occurrence of a warning.
- Fixed a bunch of edge cases and race conditions.

Reviewed By: TheSavior

Differential Revision: D8345180

fbshipit-source-id: b9e10d526b262c3985bbea639ba2ea0e7cad5081
2018-06-11 18:31:18 -07:00