Commit Graph

35 Commits

Author SHA1 Message Date
Pascal Hartig
48f9b350fe Upgrade Metro to 0.48
Summary:
Just to stay up-to-date. No breaking changes affecting us:
https://github.com/facebook/metro/releases/tag/v0.48.0

Also bumping babel-generator to be in line with the others.

Reviewed By: danielbuechele

Differential Revision: D10446300

fbshipit-source-id: b373bc6b1e6e53f2f760730679d1667928002e5f
2018-10-18 14:52:48 -07:00
Daniel Büchele
6d18701d6a disable ASAR
Summary:
Metro's new version using `jest-haste-map` wants to access files inside our ASAR bundle, not using electron's require function. This fails, because it can not read from inside the ASAR bundle. For this reason we are disabeling ASAR for now.

Additionally, we are disabling reloads when a hidden file changes. This is because watchman creates a `.watchman-cookie` which shoudln't triggers a reload. But in general I think it's safe to not reload when hidden files are changed, as they are unlikely to have actual code in them.

Reviewed By: passy

Differential Revision: D10426715

fbshipit-source-id: 6ad9dcf88c62d5b65a9736eff28aadaf89c6af7a
2018-10-18 02:56:17 -07:00
Pritesh Nandgaonkar
ce996ba8af Add listener in the renderer process for deeplink
Summary:
- Set userPrefferedPlugin for external deeplink
- Listen for deeplink in renderer process and navigate accordingly

Reviewed By: passy

Differential Revision: D10339035

fbshipit-source-id: 4de6249a0672f9ce02b0dfb78a4563302c308578
2018-10-17 06:21:01 -07:00
Pritesh Nandgaonkar
4f914a655e Register flipper: scheme for deeplink
Summary: This diff adds a basic setup of deeplink, with this diff whenever the link is entered in the browser the flipper app is opened and the corresponding.

Reviewed By: passy

Differential Revision: D10149797

fbshipit-source-id: ddff3d794aec66f9e878abcf4c81e87dfadca070
2018-10-17 06:21:01 -07:00
Daniel Büchele
8d7774c409 don't minify plugins
Summary: The minifier removed `debugger` statements from the plugins. We don't need to minify the plugins, because we don't care about bundle size, so we can just disable minification for plugins.

Reviewed By: alangenfeld

Differential Revision: D10334694

fbshipit-source-id: 0b3e23db107f960a3dbeb6a79aa24bacca41c230
2018-10-15 03:05:16 -07:00
Daniel Büchele
e86a756e3c remove PortForwarder
Summary: Removing PortForwarderMacApp as it is not used anymore. Before it was used to allow us to debug physical iOS device. However, the support for physical iOS device was removed a while ago for security reasons. The PortForwarder was not in use anymore so it is safe to remove it.

Reviewed By: passy

Differential Revision: D10337888

fbshipit-source-id: 93f508ec524a0fc055141176c06d7e7169d83f16
2018-10-15 03:03:35 -07:00
John Knox
4889f5dc6a Allow plugins to require from /static/
Summary:
Disallowing plugins from requiring anything but flipper or their own package broke lots of plugins at yarn start.
The ones that broke, require from the static directory.
Allowing them for now to unblock people.

Reviewed By: passy

Differential Revision: D10358733

fbshipit-source-id: 37077c806e022a6eb7ecf9bc95a455bf6f9a34d8
2018-10-12 05:48:24 -07:00
Daniel Büchele
992ad68517 error plugin import from outside
Summary:
Plugins can not require files outside their folder, to make sure they don't pull in any dependencies from Flipper which are not exported by the main app.

However, those imports simply resolve to `undefined`. This diff adds a check in the babel-transform for plugins and throws an error if something from outside the plugin is required.

Reviewed By: passy

Differential Revision: D10297980

fbshipit-source-id: 1606f3211103281f9f4aa7bb2f3ca4d085d0ea1b
2018-10-11 07:11:18 -07:00
Alex Langenfeld
630982190b remove OculusDevice
Summary: Pretty sure this was meant to get removed before open sourcing, it isn't referenced anywhere.

Reviewed By: danielbuechele

Differential Revision: D10202081

fbshipit-source-id: 23d213b3a041acad85eb723d32b65f7da276003d
2018-10-06 11:18:18 -07:00
Charles Dick
44fea6b9bc update metro to 0.47.1 to fix sourcemaps in plugins
Summary: Inline sourcemaps were broken in Metro until 0.47.1, so now we can debug flipper plugins again!

Reviewed By: passy

Differential Revision: D10200221

fbshipit-source-id: 919c1bc4f7aee720f25f2375ffbd8a786ebd0017
2018-10-04 12:13:46 -07:00
Daniel Büchele
a455520ecb adding jest test setup
Summary:
Adds a test runner for jest test and adds three simple test cases:
- render the app
- start a server
- client connecting to the app

Test can be run using `yarn test`.

To make the test runner work, some changes needed to be made:
- remove the export of `init()` from `'flipper'`, because it was a cyclic dependency
- updating Button.js to the new ref-API

Reviewed By: jknoxville

Differential Revision: D10027078

fbshipit-source-id: 49107b0dd4dec666b92ecd841422fe7e6b3a7756
2018-09-28 06:42:08 -07:00
Daniel Büchele
36d00bce4c add source map support
Summary: Use inline source maps for plugins and main bundle, both in production and development.

Reviewed By: passy

Differential Revision: D9967235

fbshipit-source-id: 245e65c6fea94b93dc34a65ae572b7fc98ad56e1
2018-09-25 04:02:28 -07:00
Daniel Büchele
7825d9247c optional chaining
Summary: Adds support for optional chaining to the codebase, enables flow and eslint support for it.

Reviewed By: passy

Differential Revision: D9940732

fbshipit-source-id: 730aa76653bd22a8fa17a73e72b3a7329de0226c
2018-09-20 04:27:48 -07:00
Daniel Büchele
5a492951f5 babel upgrade
Summary: upgrading to babel 7 and upgrading all presets and plugins as well

Reviewed By: passy

Differential Revision: D9940733

fbshipit-source-id: 24f45c78a9452899e6fb140a56028dd9fa0b5ea3
2018-09-20 04:27:48 -07:00
Daniel Büchele
2b4193a013 metro upgrade
Summary: Upgrading to metro@0.45.3 and adapting to API changes made by metro.

Reviewed By: passy

Differential Revision: D9940734

fbshipit-source-id: 34b07cc70c9654d9e07755816aba703a826dcae9
2018-09-20 04:27:48 -07:00
Daniel Büchele
bc4e6705b7 rename global
Summary:
global variable was renamed from `Sonar` to `Flipper`.

Fixes #267.

Reviewed By: passy

Differential Revision: D9934362

fbshipit-source-id: 0c03f3e12d9db26c5c7e9430fc98ba7fffd0bf54
2018-09-19 03:57:31 -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
3bea3c88e6 flipper-plugin-*
Summary: rename plugin packages from `sonar-plugin-*` to `flipper-plugin-*`.

Reviewed By: passy

Differential Revision: D9851211

fbshipit-source-id: bdac568ede0a4a9308138a6c3d60728bb6195a72
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
Pascal Hartig
175ba7f331 Remove import-sideffect call to init()
Summary:
Back out "Back out "[flipper] Export init function""
Original commit changeset: 93b916d472b7

The import side effect seems to cause some issues with shadowing,
so let's pull this all the way to the top and call this from HTML
as Sonar.init().

Reviewed By: danielbuechele

Differential Revision: D9849869

fbshipit-source-id: b62772ecddc59eab00251ebf19816f470d76ba82
2018-09-17 08:59:34 -07:00
Daniel Büchele
3b6526eb07 create .flipper folder
Summary: When no config folder exists, a folder named `.sonar` was created. Instead `.flipper` should be created.

Reviewed By: hning

Differential Revision: D9754717

fbshipit-source-id: 89a7f5c80a9202f448a6bafcf461c941b656c15e
2018-09-11 07:28:31 -07:00
Ullrich Schäfer
661d5a8f5b Enabling fullscreen mode on macos (#259)
Summary:
I wanted to use Flipper/Sonar in a fullscreen/split screen environment end was surprised the feature was disabled. When I checked the blame it looks like it's been like this from the get go, so there might not even be a real reason to have it disabled. Please correct me if I'm wrong.

The default value for `fullsreenable` is true. Removing setting the
parameter reenables the feature.

- Flipped the switch, saw it go fullscreen
- Also works in split screens
Pull Request resolved: https://github.com/facebook/flipper/pull/259

Reviewed By: danielbuechele

Differential Revision: D9630068

Pulled By: passy

fbshipit-source-id: 650e54895dc596090e2edcf2802bb0020f207ecc
2018-09-03 07:57:16 -07:00
Daniel Büchele
f7606c8d59 rename ~/.sonar to ~/.flipper
Summary: renames config folder from sonar to flipper

Reviewed By: jknoxville

Differential Revision: D9541803

fbshipit-source-id: ef378c46fcbb14e76e99fb0743a99f24c536a434
2018-08-29 02:43:00 -07:00
Pascal Hartig
715d12db8d Use recursive ctime to determine plugin cache expiration
Summary:
Disabling `atime` on Linux is quite common. (I don't have data to back this up,
but with my sample size of n=1, 100% fall into this bucket.) In that case,
the plugins will be cached indefinitely.

Using `ctime` on the directory doesn't really mean anything because it is
only affected by changes *to* the directory, not the files inside.

So, let's do this right and use the most recent change to any of the files
*inside* the directory instead.

Reviewed By: danielbuechele

Differential Revision: D9479491

fbshipit-source-id: 6945d7bf87defa67679cacdaf0a978d8ff1770c3
2018-08-23 04:57:29 -07:00
Daniel Büchele
6f2a7dcb05 clean up console
Summary: The console was pretty spammy. This fixes some issues that were logged and changes many log statements to `console.debug` which are not shown by default.

Reviewed By: passy

Differential Revision: D9303011

fbshipit-source-id: 1102f4f8814152a45f155cb43488a515c2d4eee4
2018-08-14 03:12:54 -07:00
Daniel Büchele
8b8ffaa7a0 missing UI renames
Summary: Rename app title and update notification to "Flipper"

Reviewed By: passy

Differential Revision: D9270088

fbshipit-source-id: 4e49e8d553fdd6b98da599be3ce18b4daf412cb6
2018-08-10 09:57:38 -07:00
Daniel Büchele
a9b8c3d2c9 startup time tracking
Summary: Adds tracking from opening the application to the interface being shown.

Reviewed By: passy

Differential Revision: D9239037

fbshipit-source-id: eba60a9e839f9cc2b7a3c8706c6b9d63acb854b4
2018-08-10 09:13:27 -07:00
Daniel Büchele
aace545ba6 move WelcomeScreen
Summary: The sidebar is now shown, even if no device is connected. This prevents the jumping layout when Flipper launches, but still has not connected to devices.

Reviewed By: passy

Differential Revision: D9263892

fbshipit-source-id: d5b96a8619393ee4002863a83d9024f00c6cb396
2018-08-10 08:57:09 -07:00
Sara Valderrama
c07d8c14a4 Add icon to show which elements in ax tree are talkback-focusable
Summary: Puts an accessibility icon next to any elements in the ax tree that may be focused on when talkback is running to show that they are "accessibility-focusable". When any sidebar values are changed, the icon will show up/disappear accordingly.

Reviewed By: danielbuechele

Differential Revision: D9171781

fbshipit-source-id: f3b42624988aaef22040ac3325d745a12f0622db
2018-08-07 09:42:27 -07:00
Daniel Büchele
9c239c23c9 add spotlight comment with old name
Summary:
To make the transition from the old to the new name as smooth as possible, we want to allow people to launch the app using its old name via Spotlight.
Therefore, we set a comment on the executable with the old name. These comments are indexed by Spotlight and the app can be launched with the old name.

Reviewed By: passy, priteshrnandgaonkar

Differential Revision: D9149323

fbshipit-source-id: b812776350b3fc57dc3a193bcd96c343a13a039f
2018-08-07 06:41:38 -07:00
Pascal Hartig
3a657ed46a Use textContent for showing dev error message (#199)
Summary:
`innerHTML` seems unnecessarily dangerous, rendering unescaped content from the network in an execution context. It can also raise exceptions if the HTML received is invalid, so let's not do this?
Pull Request resolved: https://github.com/facebook/flipper/pull/199

Reviewed By: danielbuechele

Differential Revision: D9179150

Pulled By: passy

fbshipit-source-id: 911b2686150be73c8e9e42b94b2a96da62fd6ae7
2018-08-06 05:42:30 -07:00
Daniel Buchele
5163f8b9a3 fbshipit-source-id: c71048dfea2a03cf83650b55aa9d1e463251920c 2018-07-04 07:19:44 -07:00
Daniel Büchele
0d5c98341a allow tilde in pluginPaths
Summary: `~` is not supported by node's `fs` functions. So we are replacing it manually.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8658889

fbshipit-source-id: 36c9885a00a7e07e54ab416d6fda3b29bbda73b6
2018-07-03 10:05:00 -07:00
Daniel Büchele
5edb8bd770 clean up dynamic plugin loading
Summary:
There are 3 sources where plugins can be loaded from:
* `src/plugins`
* `src/fb/plugins`
* any path specified in `~/.sonar/config.json`

Plugins found in the first two directories are bundled with the app when building.

Reviewed By: jknoxville

Differential Revision: D8636061

fbshipit-source-id: 2064090d43d11695ffd99df195e5b594559fe087
2018-06-26 07:17:39 -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