Commit Graph

17 Commits

Author SHA1 Message Date
Zoltán Gilián
aff51b881d Fix uneccesary compilation when fs.watch rapid-fires
Summary:
On Windows fs.watch fires multiple times after a single edit causing multiple instances of plugin compilation threads to start bogging down system resources.
This diff delays compilation by 1 second, soaking additional watch events fired for that plugin in that time window.

Reviewed By: danielbuechele

Differential Revision: D16109076

fbshipit-source-id: bc4f89d83f04487a3d32ee5cc2105fe0a8b7366c
2019-07-08 03:05:08 -07:00
Daniel Büchele
6ada04bc38 ignore flipper-public/dist folder in build
Summary:
Builds in flipper-public are failing, because duplicate imports: https://our.intern.facebook.com/intern/sandcastle/job/22517998213713260

That's most likely because the `flipper-public` is not blacklisted in metro, so let's add it!

Reviewed By: passy

Differential Revision: D14134423

fbshipit-source-id: 52f87196957c8578b8ac7f578efa74e3c13fe1bb
2019-02-20 06:58:54 -08:00
Daniel Büchele
c6752110cf watch recursive
Summary: Plugin files in subfolders were not watched. Adding recursive flag to reload plugins, even when there are changes in any of the plugin's subdirectories.

Reviewed By: jknoxville

Differential Revision: D14100394

fbshipit-source-id: 2a0b5e35df4bbbfe6cf8a0fafd5271222d99a46c
2019-02-15 06:31:31 -08:00
Daniel Büchele
e78bd57514 build headless
Summary:
- create a zip-file when building the headless version of Flipper
- restore pkg cache in Sandcastle from pantri
- run build script in sandcastle.

Changes need to go together with D13942919

Reviewed By: passy

Differential Revision: D13942701

fbshipit-source-id: caac7d6cda99fec2a6836c652957ff609a0bf8bb
2019-02-05 11:35:52 -08:00
Pascal Hartig
dc412ce0bc Replace ad-hoc home dir expansion with package
Summary:
Instead of replacing the tilde with home-dirs on an incomplete, ad-hoc
basis, let's use a package for this. It also supports `~USER` resolution
which someone might reasonbly expect to work if `~/DIR` is working.

Reviewed By: jknoxville

Differential Revision: D13940956

fbshipit-source-id: 5bfa9b8b2540fed8c05c856ff736e48e925f985d
2019-02-04 04:42:18 -08:00
George Zahariev
c6e0517640 Enable Flow Strict Local for 13 files in xplat/sonar
Summary:
First add a Flow Strict config, then enable Flow Strict Local for 13 files in xplat/sonar.

each change can land seperately:
drop-conflicts

Reviewed By: passy

Differential Revision: D13368791

fbshipit-source-id: 5bc1f9d3a179f4b9a554cc8cc629db0fda468a36
2018-12-11 13:49:14 -08:00
Pascal Hartig
ac6575850e Fail build when plugins don't compile
Summary:
This adds an option to the compilePlugin function that
allows specifying whether or not to throw an exception
if compiling a plugin fails.

While this seems like a sensible default while development,
it seems like a pretty bad idea when building releases.

Reviewed By: jknoxville

Differential Revision: D12904570

fbshipit-source-id: aee365074af129296a9d493804b959cb9513f9cc
2018-11-04 04:36:09 -08: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
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
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
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
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
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
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
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