Commit Graph

4867 Commits

Author SHA1 Message Date
Pascal Hartig
9b44305f1c Remove logger dependency
Summary:
Found that one of the parameters wasn't used for anything making
it harder to make sense of the construct and test it.

Reviewed By: nikoant

Differential Revision: D27117591

fbshipit-source-id: f4c796dd37b0bd75497710fb9f88c923181f90e1
2021-03-18 05:45:28 -07:00
Pascal Hartig
414dd4d5ff Demote errors in crash reporter
Summary:
Not fatal errors and actually very, very high-firing. Something about
the serialisation here is wrong so I can't tell the exactly number right now.

Reviewed By: priteshrnandgaonkar

Differential Revision: D27117067

fbshipit-source-id: d9ce8c736ca2228acedeadeb2e7ee6744d766265
2021-03-18 05:45:28 -07:00
Pascal Hartig
f04c8e8e2c Small optimisations
Summary: We're passing around PathBufs where Paths are enough and more efficient.

Reviewed By: fabiomassimo

Differential Revision: D27155300

fbshipit-source-id: cdf8d67e28a669130482d333c960d100bdaf0992
2021-03-18 05:12:43 -07:00
Pascal Hartig
844c3e3a1c Update packlist for Linux
Summary:
Electron 12 renamed one .so and broke the build.
Time to implement T83339637.

Reviewed By: fabiomassimo

Differential Revision: D27155174

fbshipit-source-id: a034f79cacb5c27b62cc6b51c9899a3d3a227954
2021-03-18 05:12:43 -07:00
Pascal Hartig
62c1c10056 Upgrade deps
Summary: Just bumping everything before making changes as ever.

Reviewed By: fabiomassimo

Differential Revision: D27155175

fbshipit-source-id: b6bce17e55e62b901be710099a43b1185e893ed8
2021-03-18 05:12:43 -07:00
Pascal Hartig
81252edf33 Upgrade to Electron 12.0.1
Summary: Changelog: Upgraded to Electron 12.0.1

Reviewed By: fabiomassimo

Differential Revision: D27084184

fbshipit-source-id: 5d45c632f7fec78635287f1919ef1cf0b2b458ad
2021-03-17 16:32:39 -07:00
Anton Nikolaev
f468f0e07d Produce tsc typings for "flipper" package
Summary: This diffs refactors tsc projects structure and structure of our custom typings to allow producing typescript typings for "flipper" package. In next diffs I'm going to use the produced typings to check compatibility of plugins with certain versions of Flipper, e.g. to check whether plugin is compatible with current "stable" and "insiders" version.

Reviewed By: passy

Differential Revision: D26997158

fbshipit-source-id: a0416c7139bf08ec9d175730da4c4c2a8768eeb7
2021-03-17 14:03:38 -07:00
generatedunixname89002005306973
779e89db1d Flipper Snapshot Bump: v0.81.1-SNAPSHOT
Summary: Releasing snapshot version 0.81.1-SNAPSHOT

Reviewed By: priteshrnandgaonkar

Differential Revision: D27114448

fbshipit-source-id: badb996da2603a1b1ecaaa87598b8a997e000aa3
2021-03-17 04:48:28 -07:00
generatedunixname89002005306973
0293a2a5fb Flipper Release: v0.81.0
Summary: Releasing version 0.81.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D27114449

fbshipit-source-id: bcf89ccb61aedc7413d4031da42b10971e3808fa
2021-03-17 04:48:28 -07:00
Michel Weststrate
4f70219a47 Dispose iOS logs if logs plugin is not connected
Summary: See D27047041 (d293b2b0e5) for more details. This diff makes sure the log listener is disposed if the Logs plugin is disabled / the logging is paused, rather than keeping the connection open all time.

Reviewed By: nikoant

Differential Revision: D27083966

fbshipit-source-id: 6f157c237519a0fde9591f1c2033621858863de0
2021-03-16 20:11:12 -07:00
Michel Weststrate
9d3c48fd84 Logs2 -> Logs
Summary:
Use Logs2 plugin now as the default logs plugin (by overwriting it).

See the rest of this stack

Changelog: The device logs plugin has been fully rewritten. It is faster and more reponsive, formats urls and json, and supports line wrapping and text selection. Beyond that it is now possible to sort and filter on all columns and pause and resume the log stream.

Reviewed By: nikoant

Differential Revision: D27048528

fbshipit-source-id: e18386fec6846ac3568f33a3578f4742213ecaca
2021-03-16 15:03:49 -07:00
Michel Weststrate
d293b2b0e5 Dispose adb logcat connection if there are no listeners
Summary:
Flipper used to always subscribe to the adb logs. This change makes the log subscription lazy, which means if there are no plugins listening to the logs, we don't subscribe to the adb logs at all. As you can see in the recording (prod build) this lowers CPU usage significantly: without logs plugin disabled it is now ~5-8 %, with the plugin enabled ~12-18%. Before this change we would never stop listening to the log output, even when the plugins were disabled, causing a constant background noise which people complain regularly about.

The pause / resume button in the new log plugin will now cleanup the connection as well, so that a simple 'pause' click will already boost performance, without needing to disable the logs plugin (if crash reporter is not enabled)

In this diff we also will clear the logs when reconnected. Previously we didn't reset the logs after connecting, we means Flipper would try to gets up with all past logs first, which could be a few 100 K entries.

Further future optimizations could involve using logcat smarter; by actually passing filters on app or loglevel to the command (not sure if that is actually faster, or just a convenience api that does the same filtering as we do)

Changelog: Flipper will now use less CPU if logs & crash reporter plugins are disabled by no longer tailing adb logcat.

Reviewed By: nikoant

Differential Revision: D27047041

fbshipit-source-id: 251a04dcc6f488f220cb56fe50a26788d795e38c
2021-03-16 15:03:48 -07:00
Michel Weststrate
de92495f04 Table optimizations
Summary:
Performance fine tuning.

Did some performance fine-tuning primarily by creating a production build, and verifying the responsiveness of searching, tailing etc in the logs plugin while generating a lot of load, and finetuned based on that. For example stopped using requestAnimationFrame which is too sensitive of starving Flipper under high load, as it doesn't leave room for other events to be processed. Also made scrolling smoother by making an append 'high prio' update while taililng.

Also debounced changing the (search) filters, as that is an expensive operation we don't want to trigger on every key press

Reviewed By: passy

Differential Revision: D27046726

fbshipit-source-id: c3efe59eb26e2d9e518325d85531a0e4a6b245ca
2021-03-16 15:03:48 -07:00
Michel Weststrate
6a30899803 Kill onRegisterDevice
Summary: `onRegisterDevice` device abstraction was only used by the CrashReporterPlugin, and since with Sandy plugin lifecycles every plugin can do 'on-load' logic, we don't need it anymore.

Reviewed By: priteshrnandgaonkar

Differential Revision: D27046711

fbshipit-source-id: 16c567c60ed29a50017d525a2b707ee696a99e62
2021-03-16 15:03:48 -07:00
Michel Weststrate
87c5fab607 Convert crash reporter plugin to Sandy (non UI only)
Summary:
This diff converts the CrashReporter plugin to Sandy. The main driver is that it allows us to fix the connection management of logs in a next diff.

There are few changes to highlight:
* A bunch of the old unit tests are removed, as they primarily verified that persistedState abstraction works, a concept that doesn't exist anymore with Sandy (as a result all the logic in error handling and crash reporter plugin has become a lot more trivial as well)
* Added additional unit tests to verify that the integration with notifications from Sandy, and the integration of crashes in combination with CrashReporter plugin works (this wasn't the case before)
* Plugin errors were always suppressed in production builds of Flipper. However, that makes error reporting pretty pointless in the first place, so enabled it by default, but made it a setting in case this results in too many errors suddenly.
* The integration with clicking OS crash notification -> bringing the user to a sensible place _doesn't_ work, but it didn't work before this diff either, so will address that later
* This doesn't upgrade the Crash reporter UI to sandy yet, will do that later in a separate diff

Changelog: Crash reporter will now report errors triggered from the device / client plugins by default. This can be disabled in settings.

Reviewed By: priteshrnandgaonkar

Differential Revision: D27044507

fbshipit-source-id: 8233798f5cce668d61460c948c24bdf92ed7c834
2021-03-16 15:03:48 -07:00
Michel Weststrate
7093a932f8 expose client.writeTextToClipboard
Summary: per title

Reviewed By: priteshrnandgaonkar

Differential Revision: D27044508

fbshipit-source-id: 8af99f66ec8203b76ccb3d880e1a184193a389c7
2021-03-16 15:03:48 -07:00
Michel Weststrate
4e2383cdb0 Introduce showNotification API
Summary: Introduced `showNotifcation` to the Sandy API.

Reviewed By: jknoxville

Differential Revision: D27012001

fbshipit-source-id: d3f237910a478400b0f925f0362af485c96072bb
2021-03-16 15:03:47 -07:00
Michel Weststrate
2ca52f81d2 Introduce pluginKey
Summary: Exposed the `pluginKey` to sandy plugins (which we will use later for storing table preferences per plugin). And a little moving code around because circular deps problem roared its ugly head again.

Reviewed By: nikoant

Differential Revision: D27009721

fbshipit-source-id: 7ad29e72ff8028c9daae270c4749b657bd8ff049
2021-03-16 15:03:47 -07:00
Michel Weststrate
be25df6490 Documented createDataSource, DataSource & DataSourceView
Summary: Per title

Reviewed By: nikoant

Differential Revision: D26978363

fbshipit-source-id: b3cfeda0fb0f6556e1ba9041325ae080cba69a7b
2021-03-16 15:03:47 -07:00
Michel Weststrate
602152665b Split DataSource & DataSourceView
Summary:
This diff is primarily cosmetic, just pushing code around to make the API more intuitive. Most importantly, DataSource was split into DataSource and DataSourceView classes, the latter being accessible through `datasource.view`.

The benefit of this is two fold:
1. Conceptually it is much clearer now which operations operate on the _source_ records, and which ones on the derived _view_.
2. This will make it easier in the future to support multiple views to be based on a single data source.

This refactoring also nicely found 2 cases where datasource logic and view logic were mixed.

The only semantic change in this diff is that both DataSource and DataSourceView are now iterable, so that one can do a `for (const record of ds)` / `for (const record of ds.view)`

Reviewed By: nikoant

Differential Revision: D26976838

fbshipit-source-id: 3726e92b3c6ee3417dc66cbbe6e288797eecf70e
2021-03-16 15:03:47 -07:00
Michel Weststrate
d73f6578a7 Support linkify-ing urls
Summary:
Changelog: The new logs plugin will linkify urls and pretty print json-like messages

This implements one of our top papercuts (see linked task), and the WP request over here: https://fb.workplace.com/groups/flipperfyi/permalink/902949260471370/. Partially addresses

https://github.com/facebook/flipper/issues/1162
https://github.com/facebook/flipper/issues/1010
https://github.com/facebook/flipper/issues/2029

Reviewed By: nikoant

Differential Revision: D26947007

fbshipit-source-id: be0fdb476765905ae6b63bd8799c9c6093014de3
2021-03-16 15:03:47 -07:00
Michel Weststrate
66774c90c6 Added support for serialization
Summary: Make sure that DataSources can be serialized directly with a single setting, just like plain state atoms

Reviewed By: nikoant

Differential Revision: D26944954

fbshipit-source-id: 2b0d625d7d67f27a7c2e33dd7c4b534dfa4d3e82
2021-03-16 15:03:46 -07:00
Michel Weststrate
dd4cf9cb4a Optimize shift & process some todo's
Summary:
Noticed in the previous diff that shift is relatively slow for sorted datasources, the reason is that it needs to do a lot of binary searches, and binary search / sorting a full data set is roughly ~20 times slower than resorting a full set, and we're dropping 10% of the data in our test. So if we are shifting too many items in a sorted set, we instead fall back to a rebuild (for non-sorted, shift is super fast because we only drop a bunch of items from the start).

Also solved some more perf related todo's, or made notes about them.

Reviewed By: nikoant

Differential Revision: D26913144

fbshipit-source-id: ee1c04fda1730653affdede0ad22da795e19c2af
2021-03-16 15:03:46 -07:00
Michel Weststrate
bb20c7fd00 Implemented perf tests
Summary:
Added some performance tests for DataSource. Currently simply using jest to run them in a single run, so that is not the most isolated setup (we do GC between tests), but helps to find some global trends at least.

For every scenario two datasets are used, one of 100.000 items, and one of 200.000 items, to verify that all important functions scale roughly linearly or better.

The `append` and `update` test cases perform 1000 insertions / updates. All other tests are singular.

The keyed vs unkeyed variation verifies that we don't drop performance if we maintain a by-key lookup table.

The sorted variations start with an initially already sorted and filtered setup. This nicely show that the datasource really starts to shine with its insertion sort versus full reallocating and sorting

The reference fake implementation does what we do in most cases in Flipper: shallow clone and allocate an entirely new array to append / update data to preserve immutability. Its comparison is pretty terribly, especially considering that in the perf tests we 'render' only once, skewing the stats in favor of the fake implementation: only at the end of the entire batch of updates we sort & filter once (so after inserting a thousand items for example).

In contrast the datasource tests will keep its data sorted at all times, so 'rendering' is already included in the measurements. For the fake datasource, resorting the full 200K rows after each insert would pretty much put bitcoin caused global warming to shame. Also note that the increased GC pressure isn't incorporated in the fake implementation, as we GC outside the measurements.

Reviewed By: nikoant

Differential Revision: D26913145

fbshipit-source-id: 955f1923dce40997cd2e81ea9e80832c6e71c99c
2021-03-16 15:03:46 -07:00
Michel Weststrate
2a3458aff8 Implemented shift operation and limit option
Summary: This diff implements the shift operation, which removes (efficiently) the first (oldest) N records from the datasource. Also implemented a `limit` option to truncate automatically and limit memory usage

Reviewed By: nikoant

Differential Revision: D26883673

fbshipit-source-id: c5ebaf2a327d56cbbe38280c6376c833bcf68b8c
2021-03-16 15:03:46 -07:00
Michel Weststrate
564d440b4a Implemented remove operation
Summary: Implemented `remove`, which, for a typical data source should not be needed. But that would be famous last words and wanted to prevent painting ourselves in a corner, so implemented it. Also because part of the logic is need for the `shift` operation (see next diff), which is much more important.

Reviewed By: priteshrnandgaonkar

Differential Revision: D26883672

fbshipit-source-id: 0dbfcdd3d5a16c4a2d53b0272000d183c67d0034
2021-03-16 15:03:45 -07:00
Michel Weststrate
a610c821d3 Store preferences and scrolling, refactor to useReducer
Reviewed By: priteshrnandgaonkar

Differential Revision: D26848266

fbshipit-source-id: 738d52556b9fb65ec5b5de7c727467227167b9b9
2021-03-16 15:03:45 -07:00
Michel Weststrate
55981b5259 Introduce pause button
Summary: ..and some earlier reviews comments has been processed + some fine tuning on the ui

Reviewed By: priteshrnandgaonkar

Differential Revision: D26816559

fbshipit-source-id: adf2586763be185ee8e7cc22b2827ecefe4e4cab
2021-03-16 15:03:45 -07:00
Michel Weststrate
525e079284 Implement deeplink, creating pastes, log deduplication
Summary:
This diff implements the remaining features in the logs plugin:

- deeplinking
- merging duplicate rows

The logs plugin source code has now been reduced from originally `935` to `285` LoC. All optimisation code has been removed from the plugin:

* debouncing data processing
* pre-rendering (and storing!) all rows

Finally applied some further styling tweaks and applied some renames to DataTable / DataSource + types finetuning. Some more will follow.
Fixed a emotion warning in unit tests which was pretty annoying.

Reviewed By: passy

Differential Revision: D26666190

fbshipit-source-id: e45e289b4422ebeb46cad927cfc0cfcc9566834f
2021-03-16 15:03:45 -07:00
Michel Weststrate
dec8e88aeb Add row styling
Summary:
Added styling / coloring to the new logs plugin, to bring it closer to feature completeness. Made the colum headers slightly more compact

Also made the API more foolproof by introducing the `useAssertStableRef` hook, that will protect against accidentally passing in props that would invalidate rendering every time.

Reviewed By: passy

Differential Revision: D26635063

fbshipit-source-id: 60b2af8db3cc3c12d8d25d922cf1735aed91dd2c
2021-03-16 15:03:45 -07:00
Michel Weststrate
a3b3df639b Show feedback if there are no records visible
Summary:
Per title. Give the user some feedback on why he doesn't see any records (filtering to aggressive vs there are simply no records).

Fixes the old Flipper behavior where tables are merely empty, which always looks kinda broken to me. (Didn't it work, or is there nothing?)

Reviewed By: nikoant

Differential Revision: D26611173

fbshipit-source-id: 7ac798bd7d5c31f6d9fbacf30c6727d2e0e94570
2021-03-16 15:03:44 -07:00
Michel Weststrate
59e6c98669 User experience improvements
Summary:
This diff has some jak-shaving UX improvements after playing with the DataTable a bit more:

Selection
* deselecting a row from a larger set will make the last selected item the default selection
* re-selecting an item in a single selection will unselect it

Column Filtering
* Introduced button to toggle between filtering on all, nothing, and the values present in the current selection

Column sorting
* The up / down arrows are now inidividually clickable, rather than action as a general toggle
* Title still works as a general toggle between asc / desc / not sorted

Context menu
* I found the context menu for column selection and on the selected rows itself a bit finicky to find and click and not super intuitive for noob users. Merged both menus instead into a single hamburger menu adjacent to the search bar

Reviewed By: passy

Differential Revision: D26580038

fbshipit-source-id: 220f501a1d996acbd51088c08ea866caed768572
2021-03-16 15:03:44 -07:00
Michel Weststrate
59a1327261 Introduce multi selection
Summary:
Make sure DataTable supports multiselection, which works largely the same as before, with a few changes

* shift + click and ctrl + click work as expected
* shift + keyboard navigation works as expected
* drag selection works as expected
* drag selection when dragging accross screens, or Shift icmw with HOME / END / PageUp / PageDown works as expect
* text selection stil works as expected

The context menu items have been updated as well
* filter will filter on all the distinct values in the selection
* copying cells will copy all cells of the given column in the selection, separated by newline
* copying rows / creating a past will create a json array of the selection

Not done yet

- Shifting the selection after inserting rows hasn't been implemented yet
- I'm not entirely happy with the context menu trigger, maybe a hamburger button in the toolbar will be better

Reviewed By: nikoant

Differential Revision: D26548228

fbshipit-source-id: 5d1cddd6aad02ce9649d7980ab3a223e222da893
2021-03-16 15:03:44 -07:00
Michel Weststrate
5c3a8742ef Introduce context menu
Summary:
Introduced a context menu for DataTable with some default options. Opted to put it under a visible hovered dropdown instead of on right-click, since this better alings with Ant's design guides (we don't have context clicks anywhere else I think), but if it isn't convincing we can still change it.

Included some default actions, to set up quick filters, and to copy values. For copying rows, implemented it to by default take the JSON from a row, rather than space separated values like in ManagedTable, as many existing plugins customize the onCopy handler to just do that, so it seemed like a better default since it is a richer format. If there are good use cases for the previous behavior, we'll probably find out after the old release :)

Introduced utility to copy text to clipboard in FlipperLib, but decoupled it from Electron.

Didn't include multi select yet, that will be done in a next diff.

Reviewed By: nikoant

Differential Revision: D26513161

fbshipit-source-id: b2b1b20b0a6f4ada9de2566bf6b02171f722c4aa
2021-03-16 15:03:44 -07:00
Michel Weststrate
11eb19da4c Introduce column filters
Summary:
Beyond a search across all columns, it is now possible to specific columns for specific values:

* for a row to be visible, all active column filters need to be matched (e.g. both a filter on time and app has to be satisfied)
* if multiple values within a column are filtered for, these are -or-ed.
* if no value at all within a column is checked, even when they are defined, the column won't take part in filtering
* if there is a general search and column filters, a row has to satisfy both

Filters can be preconfigured, pre-configured filters cannot be removed.

Reseting will reset the filters back to their original

Move `useMemoize` to flipper-plugin

Merged the `ui/utils` and `utils` folder inside `flipper-plugin`

Reviewed By: nikoant

Differential Revision: D26450260

fbshipit-source-id: 11693d5d140cea03cad91c1e0f3438d7b129cf29
2021-03-16 15:03:44 -07:00
Michel Weststrate
8aabce477b Introduce range finder
Summary: Show a hint during scrolling of the relative offset the user is looking at. This is based on the current virtualisation window, so not 100% accurate, but probably still provides the right signal to the user. See the bottom right of the recording

Reviewed By: nikoant

Differential Revision: D26450261

fbshipit-source-id: 206a860024e346c6b872edc3fc7919019046a6d7
2021-03-16 15:03:44 -07:00
Michel Weststrate
1ce665ceaf Added selection / keyboard navigation
Summary: per title

Reviewed By: nikoant

Differential Revision: D26368673

fbshipit-source-id: 7a458e28af1229ee8193dfe2a6d156afd9282acd
2021-03-16 15:03:43 -07:00
Michel Weststrate
fb7c09c972 Add support for search and custom actions
Summary: Introduced search bar and support for custom buttons therein.

Reviewed By: nikoant

Differential Revision: D26338666

fbshipit-source-id: e53cd3c4381e11f5f90c05c92e39a6c8ac2eca65
2021-03-16 15:03:43 -07:00
Michel Weststrate
44bb5b1beb Introduced sorting, column visibility and column resizing
Summary:
Add support for resizable columns, column sorting, and hiding / showing columns

Moved some utilities from Flipper to flipper-plugin, such as Interactive and LowPassFilter

Split DataTable into two components; DataSourceRenderer which takes care of purely rendering the virtualization, and DataTable that has the Chrome around that, such as column headers, search bar, etc.

Reviewed By: nikoant

Differential Revision: D26321105

fbshipit-source-id: 32b8fc03b4fb97b3af52b23e273c3e5b8cbc4498
2021-03-16 15:03:43 -07:00
Michel Weststrate
86ad413669 Initial logs with datasource / datatable setup
Summary:
First rudementary setup of DataTable component that follows a data source. Initially used react-virtuose library, but it performed really badly by doing expensive layout shifts and having troublesome scroll handling. Switched to react-virtual library, which is a bit more level, but much more efficient, and the source code is actually understandable :)

Features:
- hook up to window events of datasource
- high and low prio rendering, based on where the change is happening (should be optimized further)
- sticky scrolling support
- initial column configuration (custom rendering, styling, columns etc will follow in next diffs)

Reviewed By: nikoant

Differential Revision: D26175665

fbshipit-source-id: 224be13b1b32d35e7e01c1dc4198811e2af31102
2021-03-16 15:03:43 -07:00
Michel Weststrate
5b76a0c717 Introduce subscribing to output changes
Summary: This diff introduces the possibility to subscribe to the `output` set of the datasource. It emits three possible event: `reset`, `update`, `shift`.

Reviewed By: jknoxville

Differential Revision: D26100104

fbshipit-source-id: b5fac2289206fab9fb8a437b96ab84034a8b5832
2021-03-16 15:03:43 -07:00
Michel Weststrate
50a8bc91ff Introduce filter
Summary:
Context: https://fb.workplace.com/notes/470523670998369

Per title, also restructured internal logic so that only on intermediate data structure is needed: `output`. This is because we don't need store filter information because we can run that plainly, on the incoming events without storing anything. Sorting is performed directly on `output`. Reverse isn't performed at all, but rather applied lazily when requesting a specific item (so it isn't reflected in output)

Reviewed By: nikoant

Differential Revision: D25976469

fbshipit-source-id: 777f8fdeba09729e19c97c176525b702066b6c2e
2021-03-16 15:03:42 -07:00
Michel Weststrate
6e4fcbdae3 Introduce clear() & reset()
Summary:
clear will drop all current records but keep any view preferences. This typically relates to the "clear" button in Flipper.

reset on the other hand will keep the current records, but just reset the view preferences to the default, dropping any filters and sorting criteria

Reviewed By: nikoant

Differential Revision: D25975612

fbshipit-source-id: 5b419f259bffc049daf125090c6754aa6528919b
2021-03-16 15:03:42 -07:00
Michel Weststrate
66864b8f54 Implement reversing the data source
Summary:
For context see https://fb.workplace.com/notes/470523670998369

This diff adds support for reversing the data collection (in a table this would be used to toggle between ascending and descending sorting). The actual implementation is cleaned up in next diffs and the intermediate collection introduced here is dropped, so this diff is basically only about the unit tests, the implementation is not interesting at this point.

Reviewed By: nikoant

Differential Revision: D25975353

fbshipit-source-id: 2da6da2ed940c2e49e1986696d9b93a7b984db9b
2021-03-16 15:03:42 -07:00
Michel Weststrate
dfda71c350 Implemented sorting
Summary:
For context see https://fb.workplace.com/notes/470523670998369

This diff adds the capability to apply a sorting, and inserts item in a sorted way using binary search in a temporarily intermediate collection. (That collection is optimized away in later diffs, so it is mostly the idea and the tests that are interesting)

Reviewed By: nikoant

Differential Revision: D25953336

fbshipit-source-id: a51b05e25242f0835280ada99798676311511ef0
2021-03-16 15:03:42 -07:00
Michel Weststrate
0dc1abdac4 Initial DataSource setup
Summary:
For context see https://fb.workplace.com/notes/470523670998369

This diff introduces the DataSource abstraction, that can store records. If a key is set a key -> record mapping is stored, to make it easy to update existing records using `upsert`, without knowing their exact index.

Internal storage will be slightly altered in upcoming diffs, so don't pay to much attention to that part.

Reviewed By: nikoant

Differential Revision: D25953337

fbshipit-source-id: 1c3b53a2fcf61abaf061946be4af21d2aecc6c6d
2021-03-16 15:03:42 -07:00
dependabot[bot]
b2c542b84c Bump react-native-flipper from 0.79.1 to 0.80.0 in /react-native/ReactNativeFlipperExample (#2063)
Summary:
Bumps [react-native-flipper](https://github.com/facebook/flipper) from 0.79.1 to 0.80.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/facebook/flipper/releases">react-native-flipper's releases</a>.</em></p>
<blockquote>
<h2>v0.80.0</h2>
<p>See <a href="https://github.com/facebook/flipper/blob/master/desktop/static/CHANGELOG.md">https://github.com/facebook/flipper/blob/master/desktop/static/CHANGELOG.md</a>
for full notes.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="59204328c3"><code>5920432</code></a> Flipper Release: v0.80.0</li>
<li><a href="c4cf46207b"><code>c4cf462</code></a> Upgrade docusaurus tools</li>
<li><a href="f508a35ff9"><code>f508a35</code></a> Fix patch release versioning for open-source version</li>
<li><a href="11f7af3e72"><code>11f7af3</code></a> Bump robolectric from 4.4 to 4.5.1 (<a href="https://github.com/facebook/flipper/issues/2038">https://github.com/facebook/flipper/issues/2038</a>)</li>
<li><a href="f61b5a1a86"><code>f61b5a1</code></a> Network plugin - support mocks in imported devices (<a href="https://github.com/facebook/flipper/issues/2040">https://github.com/facebook/flipper/issues/2040</a>)</li>
<li><a href="07defebb22"><code>07defeb</code></a> Bump hamcrest-library from 1.3 to 2.2 (<a href="https://github.com/facebook/flipper/issues/2041">https://github.com/facebook/flipper/issues/2041</a>)</li>
<li><a href="2af4c4e141"><code>2af4c4e</code></a> Bump guava from 20.0 to 23.0 (<a href="https://github.com/facebook/flipper/issues/2034">https://github.com/facebook/flipper/issues/2034</a>)</li>
<li><a href="58b2daea02"><code>58b2dae</code></a> Bundle all plugins script</li>
<li><a href="c065760d15"><code>c065760</code></a> Stable babel transformation cache key</li>
<li><a href="baeb8ba5be"><code>baeb8ba</code></a> Performance improvements for &quot;build-plugin&quot; task</li>
<li>Additional commits viewable in <a href="https://github.com/facebook/flipper/compare/v0.79.1...v0.80.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=react-native-flipper&package-manager=npm_and_yarn&previous-version=0.79.1&new-version=0.80.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: https://github.com/facebook/flipper/pull/2063

Reviewed By: mweststrate

Differential Revision: D27046230

Pulled By: passy

fbshipit-source-id: 856f5b1c3312216a4f8f939417e858c0156c78cc
2021-03-15 14:16:30 -07:00
dependabot[bot]
964131ee48 Bump core from 1.1.0 to 1.3.0 (#2003)
Summary:
Bumps core from 1.1.0 to 1.3.0.

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=androidx.test:core&package-manager=gradle&previous-version=1.1.0&new-version=1.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: https://github.com/facebook/flipper/pull/2003

Reviewed By: mweststrate

Differential Revision: D26980729

Pulled By: passy

fbshipit-source-id: b4da7e300d582ba38e173f6f2b060fb312e9e610
2021-03-15 06:04:22 -07:00
John Knox
80b94e79ee Upgrade docusaurus
Summary: Upgrading docusaurus to fix react-dev-utils vulnerability which is a transitive dependency.

Reviewed By: mweststrate

Differential Revision: D27010446

fbshipit-source-id: 3caf73029de57067c6060c34874539079721eb59
2021-03-15 04:35:57 -07:00
Anton Nikolaev
b2776f1c36 Fix for tests after call to "build-plugins"
Summary: After calling "bundle-all-plugins" locally, "yarn test" is failing with obscure message, because some tests are trying to import built bundles instead of "index.tsx". This diff fixes that.

Reviewed By: passy

Differential Revision: D26986246

fbshipit-source-id: cffe988dc642e2c5d2b2028581cd162350186e0c
2021-03-11 17:07:12 -08:00