Commit Graph

11 Commits

Author SHA1 Message Date
Daniel Büchele
771be72b3f remove window dependency
Summary:
Fixes required to be able to run Flipper in node.js:
* Adds checks if the `window`-object exists before using it, to allow running in node.
* Imports from within Flipper should directly reference the file they are requiring instead of `import from 'flipper'`. This was done in most of the places. Fixed a few occurrences where this wasn't the case. This is to prevent cyclic dependencies in node.
* shared packages (React, ReactDOM and Flipper) were exposed on the `window` before, changed this to `global` as this works in browser and node.
* Adds some missing methods to our electron stubs (used for testing and headless Flipper)

Reviewed By: passy

Differential Revision: D13786577

fbshipit-source-id: 145d560f1446e7d0bdec2acd8dd54dae983d7b36
2019-01-25 12:19:07 -08:00
Daniel Büchele
1fc73ad2fb update plugin's package.json
Summary:
For all plugins:
- move static fields `title`, `id` and `icon` to `package.json`
- adds "bugs" field for all plugins containing links to support groups/oncalls.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13417286

fbshipit-source-id: 7b341176915f3ed7b473b95c1d879f21d7d634ef
2018-12-18 10:36:35 -08:00
Daniel Büchele
6ffc027051 read infos from package.json
Summary:
Adding the properties from a plugin's `package.json` as static properties to the class.
The name from `package.json` is used as it's `id`.

This allows us in the future to add meta information about a plugin to it's package.json and still use the data inside the app.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13417288

fbshipit-source-id: 3d0a62d4cb0115153cce1aaee677b9680fefebf4
2018-12-18 08:37:28 -08:00
Daniel Büchele
db42e8e970 createTablePlugin using persistedState (fixes #310)
Summary:
Implementing persistedState for createTablePlugin, so it doesn't lose its data when switching back and forth between plugins. When `runInBackground` is set to true on the native side, createTablePlugins are now also capable of receiving new data in the background.

Adds a test suite for createTablePlugin, to make sure it:
- returns a FlipperPlugin
- ID, title and icon are set correctly
- the resetMethod clears the data
- the persistedStateReducer correctly adds new data

Reviewed By: passy

Differential Revision: D12939848

fbshipit-source-id: 30048f3ce2bb98c83b0c165e48df72c8e28eadcd
2018-11-07 02:44:35 -08:00
Daniel Büchele
086ab0188b rename fill attribute
Summary:
We were using `fill={true}` as an attribute to make flexbox containers fill the entire available space.

However, `fill` is an HTML attribute (see: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill) This caused warnings printed to the console.

This diff renames the attribute to `grow` with is also more in line with the Flexbox terminology.

Reviewed By: priteshrnandgaonkar

Differential Revision: D10488389

fbshipit-source-id: ed8553c6203cdf6df94d26c731164ecec4c9fbd2
2018-10-22 09:54:59 -07:00
Daniel Büchele
e9490ca3b4 comments and variable names
Summary:
renaming across the app:
- comments
- variable names
- constants

Reviewed By: passy

Differential Revision: D9861792

fbshipit-source-id: 72dea05d1427b1dc0f54a7865cc0ecffd69bdb27
2018-09-18 07:01:17 -07:00
Daniel Büchele
df0a0da744 DetailSidebar
Summary:
- rename `SonarSidebar` to `DetailSidebar`
- rename portal id from `#sonarSidebar` to `#detailSidebar`

Reviewed By: passy

Differential Revision: D9851703

fbshipit-source-id: 2d904d17b0c6255a2ec3a79f0ada9bf621693c2e
2018-09-18 07:01:16 -07:00
Daniel Büchele
66e77075be Rename package to 'flipper'
Summary:
- rename package `'sonar'` > `'flipper'`
- rename package `'sonar-static'` > `'flipper-static'`
- rename package export from `window.Sonar` to `window.Flipper`

Reviewed By: passy

Differential Revision: D9851181

fbshipit-source-id: 34d4447c3b287496b3d20ddb54471ce777ec74e1
2018-09-18 07:01:16 -07:00
Daniel Büchele
2e2924c979 SonarPlugin > FlipperPlugin
Summary:
Renaming:
- `SonarPlugin` > `FlipperPlugin`
- `SonarBasePlugin` > `FlipperBasePlugin`
- `SonarDevicePlugin` > `FlipperDevicePlugin`

Reviewed By: passy

Differential Revision: D9851075

fbshipit-source-id: d59df6952a42eb493c86c38895216c9985f1e14b
2018-09-18 07:01:16 -07:00
Daniel Büchele
cbab597236 show only one device in sidbar
Summary:
Refactors the plugin architecture of Sonar:
- Before plugin rendering had it's own implementation of the react lifecycle. This means the `render`-function was not called by react, but rather by the application it self. In this diff, the render method is now called from react, which enables better debugging and allows react to do optimizations.
- Business logic for querying emulators is moved away from the view components into its own dispatcher
- All plugin handling is moved from `App.js` to `PluginContainer`.
- The sidebar only shows one selected device. This allows us to add the screenshot feature as part of the Sonar main app and not a plugin.
- This also fixes the inconsistency between the devices button and the sidebar

Reviewed By: jknoxville

Differential Revision: D8186933

fbshipit-source-id: 46404443025bcf18d6eeba0679e098d5440822d5
2018-06-25 10:04:00 -07:00
Daniel Büchele
fbbf8cf16b Initial commit 🎉
fbshipit-source-id: b6fc29740c6875d2e78953b8a7123890a67930f2
Co-authored-by: Sebastian McKenzie <sebmck@fb.com>
Co-authored-by: John Knox <jknox@fb.com>
Co-authored-by: Emil Sjölander <emilsj@fb.com>
Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com>
2018-06-01 11:03:58 +01:00