Summary:
[eslint-typescript/naming-convension rule docs](https://typescript-eslint.io/rules/naming-convention/)
Initially looked into it to enforce UPPER_CASE for top most constants like `const DELAY = 10` which is a standard in js ecosystem, which turned to be more difficuilt(we will still get there).
Turns out we had casing checks disabled for everything but typeLike names. What I did in this diff
- use default setting for eslint rule
`✖ 9890 problems`
- with any propery names
`✖ 8229 problems`
- without checking properies at all
`✖ 3683 problems`
- without checking enum members
`✖ 3231 problems`
- without checking object properties/methods
`✖ 2978 problems`
- allowing PascalCase for variables
`✖ 1657 problems
- allowing PascalCase for functions
`✖ 975 problems
- not checking typeMethod and parameters
`✖ 916 problems`
- allow double underscore before after variable
`✖ 461 problems`
- allow snake_case variables
`✖ 49 problems`
Fix remaining problems.
Future plans. Ban usage of PascalCase for variables that are not components
Reviewed By: LukeDefeo
Differential Revision: D50970193
fbshipit-source-id: d9f3abe6b02c9f7822598c8fa5382f58d067f70e
Summary:
Currently we download a bunch of FB icons and we normally use the smallest one available.
In this diff I change the download logic so we try to download from the largest to the smallest icon and use the first one available. One the client we no longer provide the icon of the same size that is requested, instead we provide the only one we have which will typically be larger than needed. This is a good thing because
1. flipper is a local application and we do not need to worry about icons take up broadband and downloading
2. People have high density displayed
I also stopped using density(rest of related code removed in the next diff) for icons as it the icons themselves did not support it.
Reviewed By: lblasa
Differential Revision: D50495194
fbshipit-source-id: f569c2f3b8ee424a67c6d21136e7e113868b8f6a
Summary:
Should be available now with
```
getFlipperLib().settings().isDarkMode
```
Differential Revision: D46685851
fbshipit-source-id: 0777437b7ca06051cc3fd4dc1b794242f453f2b5
Summary: Requested by antonk52 and MSYS team
Reviewed By: passy
Differential Revision: D44662243
fbshipit-source-id: 2bace476c4e79b6a05bfb89ddc3e6acb437c6c3b
Summary: Combining a bunch of individual tasks for dep upgrades into one diff.
Reviewed By: ivanmisuno
Differential Revision: D42706074
fbshipit-source-id: 054b2545ad1295699f47f4c6eb5065b7b9a1d6a0
Summary:
Flipper plugins fail when importing css from third-party dependencies. This diff tries to fix that.
Effectively, the plugin can import the css and export it when is bundled.
When we load the plugin, we check if there's a css file for it. If there's one, we return it and try to use it.
Reviewed By: aigoncharov
Differential Revision: D40758178
fbshipit-source-id: e53afffcc481504905d5eeb1aea1f9114ee2a86b
Summary:
In D39311893 (094c5bdfdd) we started monkey-patching `require` to resolve global dependencies in the plugins. Apparently, patching `globalThis.require` did not work in the electron env. On my local machine it kept working because I had the experimental `flipper-server` feature enabled which embeds flipper-server into the electron build. In flipper-server we properly patch `require` via `Module.prototype.require` which affected the global require in electron.
With this fix we now properly patch require in electron via Module.prototype.require all the time
Changelog: Fix plugin loading with experimental flipper-server disabled
Reviewed By: nikoant
Differential Revision: D39633821
fbshipit-source-id: 9554f643c625620d116075ae87f573d8447850f6
Summary: Move flipper local deps to prod deps, so yarn installs them later when we build a bundle
Reviewed By: lblasa
Differential Revision: D39475545
fbshipit-source-id: 5b61d15b45ee315c3b35d8e6836c114b90503b1a
Summary: esbuild references external modules via `require`. We wrap `require` to point the references to built-in modules to global variables
Reviewed By: lblasa
Differential Revision: D39311893
fbshipit-source-id: a99480161c082f4095d78c22271f114532f32c16
Summary: As we stopped bundling plugins in D39276249, we no longer need the entry points for the bundled plugins (these entry points are always going to be empty)
Reviewed By: lblasa
Differential Revision: D39307565
fbshipit-source-id: 43751fe31c8bd962677c226b27cfe52093d3f2d4
Summary: Stop bundling plugins into Flipper Server bundles. In later diffs, we will start building all plugins even in dev mode which removes the need to bundle them.
Reviewed By: lblasa
Differential Revision: D39276249
fbshipit-source-id: 091405cfcf58aa7e1bd2b382da40f8d9841ae6b1
Summary: Flipper server itself requires no babel transforms. We applied extra transforms only for the bundled plugins. However, we pack and ship all plugins in the /static folder. They are always available on the FS. Therefore we could stop bundling any plugins into flipper-server's source code.
Reviewed By: lblasa
Differential Revision: D38910251
fbshipit-source-id: b3e9fe5ae2ab69ce5579b01b6793ebf7e88baf66
Summary:
flipper-server-companion depends on flipper-plugin. flipper-plugin includes dependencies that run only in a browser. Splitting flipper-plugin into core and browser packages helps to avoid including browser-only dependencies into flipper-server bundle.
As a result, bundle size could be cut in half. Subsequently, RSS usage drops as there is twice as less code to process for V8.
Note: it currently breaks external flipper-data-source package. It will be restored in subsequent diffs
Reviewed By: lblasa
Differential Revision: D38658285
fbshipit-source-id: 751b11fa9f3a2d938ce166687b8310ba8b059dee
Summary:
If there's a device client disconnect during request execution, no response is ever given back to the client (flipperd).
This change effectively subscribes to client disconnect events and notifies flipperd of any disconnection during request processing.
Reviewed By: passy
Differential Revision: D37787986
fbshipit-source-id: 31737a50b83b0cbe4141ce814064aebef7e09bfc
Summary: For the Flipper Server Companion, if a plugin is being requested which is not yet installed, try to install it first from the marketplace.
Reviewed By: passy
Differential Revision: D37716962
fbshipit-source-id: d618fbc597f82b540dbb02e8ffc296dcee9e1eb9
Summary: Allow subscribing to state updates from the plugin in headless mode
Reviewed By: passy
Differential Revision: D36516754
fbshipit-source-id: 14db51243e1d91332a7327c1792412149339f907
Summary:
We want Flipper plugins to share imports with Flipper:
- They must share the same React otherwise different Reacts could conflict with each other
- Other common modules are shared to decrease the bundle size for each plugin.
`setGlobalObject` provides shared modules to Flipper Plugins by adding them to the global context (window or process or global this).
In the headless context, we do not have React and other DOM-related libraries, so we provide stubs instead.
Reviewed By: passy
Differential Revision: D36130161
fbshipit-source-id: d30c59a6c3ae02e7f9244bc0bb5790079b771107
Summary: Add Flipper Server Companion implementation. It extends the list of commands handled by Flipper Server by adding commands to interact with device or app Flipper plugins.
Reviewed By: mweststrate
Differential Revision: D36130159
fbshipit-source-id: 2eb6ba0fbae0fa850eadb7d417aa476240994bd5
Summary: Flipper Server Companion starts headless plugins and exposes them over the wire
Reviewed By: passy
Differential Revision: D36098170
fbshipit-source-id: 3b1b077d1fa4adca5c340ad4475b80b229586e1b