Commit Graph

22 Commits

Author SHA1 Message Date
Sanjaiyan Parthipan
7cef8286f9 Concurrent Function Upgrade for Enhanced Performance (#4918)
Summary:
Republishing sanjaiyan-dev's PR https://github.com/facebook/flipper/pull/4889 running `git rebase` because of a conflict.

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

Reviewed By: lblasa

Differential Revision: D47294545

Pulled By: passy

fbshipit-source-id: 74904ec6179ed5a3bab6f9b701c3cd769ecad3bf
2023-07-17 04:43:14 -07:00
Niccolò Belli
6452816de7 fix(build-utils): await stripSourceMapComment (#4586)
Summary:
I've just packaged Flipper for Gentoo Linux and I wanted to use the system electron instead of bundling its own copy into the flipper executable. To do so I use my custom `electron-builder` and `app-builder` versions, which also allows me to support otherwise unsupported architectures like ppc64. That means skipping the downloading/unzipping/bundling steps for electron, which greatly shortens the overall build process.
Being that fast resulted in countless hours of debugging, because the resulting `app.asar` wouldn't work. At some point I noticed that electron-builder cli was working flawlessly while processing the same exact config through the Javascript API resulted in failure, so I started digging into your scripts and I've noticed that you didn't await `stripSourceMapComment` into `desktop/scripts/build-utils.ts`.
In particular the `compile` function was returning before `stripSourceMapComment` had finished doing its stuff, which ended up messing with electron-builder later.
You didn't notice because you download electron, unzip it, etc which takes enough time to let `stripSourceMapComment` finish its stuff before the actual build starts, but since I skip these steps in order to use system electron I've been able to notice it.

## Changelog

I simply await `stripSourceMapComment` promises in `build-utils`.

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

Test Plan:
`cd desktop && yarn && yarn build` is enough to test this.

## Additional Suggestions

I also suggest to enable the [no-floating-promises](https://typescript-eslint.io/rules/no-floating-promises/) eslint rule in order to ensure similar mistakes won't happen in the future.

Reviewed By: ivanmisuno, mweststrate

Differential Revision: D43974442

Pulled By: passy

fbshipit-source-id: 5acfa3d1479828e9373070c40fe3dd865a862561
2023-03-10 06:34:10 -08:00
Andrey Goncharov
dd7ba2d6fc Fix fb-stubs replacement for plugin bundling
Reviewed By: nikoant

Differential Revision: D39765543

fbshipit-source-id: 14cbf8a9bdf35031e636bbbde3dbc955faedb66b
2022-09-23 05:50:28 -07:00
Andrey Goncharov
fd811db12b Rebuild all plugins if a shared lib changed
Summary: Some plugins import from shared directories. These directories are not plugins themselves, therefore the current plugin root searching mechanism does nto work for them. To support plugin reloading for this scenario, we start re-building all plugins if we fail to find a plugin root.

Reviewed By: lblasa

Differential Revision: D39693820

fbshipit-source-id: 33dd7de4121bd5665a39b0ea96adce4603dc7df0
2022-09-22 04:17:24 -07:00
Andrey Goncharov
d81dac18b5 Work around empty file restirction
Reviewed By: nikoant

Differential Revision: D39578561

fbshipit-source-id: 3a471e7dd06a1e8cee2c7823b1d7f764110ecf80
2022-09-16 09:00:21 -07:00
Andrey Goncharov
2aa3dc9bd8 Remove reference to flipper-server bundle map
Summary: flipper-server is currently shipped unbundled and unminified

Reviewed By: nikoant

Differential Revision: D39577062

fbshipit-source-id: cd78aded878358e9f90792c695b6d1b27863f05a
2022-09-16 08:09:31 -07:00
Andrey Goncharov
8dc5f4d3ea Remove stale build options
Summary: Now that we build all plugins at all times and it is super-fast, these options are redundant

Reviewed By: lblasa

Differential Revision: D39542723

fbshipit-source-id: 1b30ba384267ec4fd0c35b4dc14f0223ffe414c9
2022-09-15 10:02:19 -07:00
Andrey Goncharov
c69d102ca1 Track plugin changes and notify frontend
Summary: Watch source plugin folders and notify frontend that any of them changed. In subsequent diffs, we will start reloading plugins that changed.

Reviewed By: lblasa

Differential Revision: D39539443

fbshipit-source-id: 726916c0bce336a2c0179558526bcb1b74e35b93
2022-09-15 10:02:19 -07:00
Andrey Goncharov
3639feef61 Watch and rebuild plugins
Summary: Now, once we build all plugins before we start Flipper, we need to rebuild some of them when they change. Previously, it was handled by Metro when we included plugins int he bundle, but we no longer include them in the bundle.

Reviewed By: lblasa

Differential Revision: D39510213

fbshipit-source-id: a352d78946f844a25d9127ac09c26e43e6739ca9
2022-09-15 10:02:19 -07:00
Andrey Goncharov
9dda947371 Fix flipper server prod build
Summary: Make flipper-server link local flipper-* deps for intern prod build. Update flipper-* deps versions for public builds so `npx` pulls them from npm

Reviewed By: lblasa

Differential Revision: D39497944

fbshipit-source-id: ca2674a4ac8f5b6c3efa9546b631f2526bf48f8e
2022-09-15 10:02:19 -07:00
Andrey Goncharov
f835e07c46 Build all plugins before start
Summary: prepareDefaultPlugins builds all plugins now. We no longer need extra helpers

Reviewed By: lblasa

Differential Revision: D39308098

fbshipit-source-id: 4f12a0bdbc2afd2b306565fff3494daa630e1a20
2022-09-15 10:02:19 -07:00
Andrey Goncharov
642a3ebf81 Remove default plugin entrypoints for hot-reloading
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
2022-09-15 10:02:19 -07:00
Andrey Goncharov
a888e6affa Simplify bundled plugin setup
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
2022-09-15 10:02:19 -07:00
Andrey Goncharov
a67a4e5d0f Remove babel transforms for flipper-server
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
2022-09-15 10:02:19 -07:00
Lorenzo Blasa
646b9d5a5d UDS/TCP options
Summary:
Provide an option to enable/disable TCP connections on flipper-server.

The only change at this stage is that Flipper Desktop will use UDS to connect to flipper-server.

Reviewed By: passy

Differential Revision: D37519656

fbshipit-source-id: 3d02084666fde532ec76134edf8cf6a231060a48
2022-06-29 15:01:05 -07:00
Pascal Hartig
02adfa79e9 Add sourcemap support to server build
Summary:
Provide the same build parameters as for the main build and move
the two bundles to a folder where we can pick them up.

For consistency, I'm keeping the naming scheme with the main build.

Reviewed By: antonk52

Differential Revision: D36521046

fbshipit-source-id: 9ea992d6e5dc299d88083d751ca8e84eadb1430b
2022-05-20 04:04:06 -07:00
Andrey Goncharov
a6d7f98cfd Bundle headless plugins
Summary: Current temporary limitations: all headless plugins are bundled with Flipper.

Reviewed By: antonk52

Differential Revision: D36098168

fbshipit-source-id: c58abe41776157258a5c39a80a5c1a33cf3f42c5
2022-05-10 05:13:24 -07:00
Pascal Hartig
045e0cc9fe App bundle for server
Summary:
This bundles up the Flipper Server in a Mac App Bundle which is identically in shape to a regular Desktop bundle. That means we can swap them out transparently without having to keep the layout in sync with Flipper Launcher.

It bundles nodeJS binary which we can later also provide for aarch64.

Reviewed By: aigoncharov

Differential Revision: D36140809

fbshipit-source-id: fb3410626ab172ce0da48f1a4a1489da68450369
2022-05-09 04:19:55 -07:00
Andrey Goncharov
8ee788239b Update version number for default plugins
Summary: Prior to this fix, plugins were copied with verion 0.0.0 which forced them to be updated with "newer" versions from marketplace

Reviewed By: nikoant

Differential Revision: D34457087

fbshipit-source-id: a3242578c570447f8ecf9c62bcaa69e5d9688c42
2022-02-28 03:50:34 -08:00
Andrey Goncharov
2ce037d96b Load bundled server add-ons
Reviewed By: antonk52

Differential Revision: D34238883

fbshipit-source-id: 01b4b1c1c0a63cbfb639e903f6a77307ae370330
2022-02-28 03:50:34 -08:00
Andrey Goncharov
5cdb7c952e Update build scripts to support bundling server add-ons
Summary: Summary

Reviewed By: nikoant

Differential Revision: D34170565

fbshipit-source-id: be9904809bf33e85536a4c6ead0e753ef05209ff
2022-02-28 03:50:34 -08:00
Anton Kastritskiy
071bcaff96 Rename second batch for '.ts' files to '.tsx' in scripts dir
Summary: Rename first batch for '.ts' files to '.tsx'

Reviewed By: passy

Differential Revision: D33843246

fbshipit-source-id: eb8080db8cc3ef07820339bf8deafa208432de7c
2022-01-31 02:57:54 -08:00