Commit Graph

289 Commits

Author SHA1 Message Date
Anton Kastritskiy
4e10bb1b43 Back out "remove shortcuts"
Summary:
Original commit changeset: fbb59b416f92

Original Phabricator Diff: D51159922

Reviewed By: lblasa

Differential Revision: D51586735

fbshipit-source-id: 3317b590ec72e0040a67be41e74ddb5a72722598
2023-11-27 15:33:57 -08:00
Lorenzo Blasa
2318bffd07 Built artifact is already universal, no architecture is needed
Summary: ^

Reviewed By: antonk52

Differential Revision: D51568857

fbshipit-source-id: 124d77e4dd175a13f491f8242b3a28a898ff5670
2023-11-27 06:23:06 -08:00
Lorenzo Blasa
5e26d863f1 Packaging changes
Summary:
This change has a few changes in the way our MacOS app was built and packaged.

- Instead of placing the Node binary inside the MacOS folder, place it inside the Resources folder. This is more in compliance with how an app is bundled. Also, with the added benefit of making it a resource which makes it eligible for code signing.
- Both, Node binary and server bundle are placed in the right location before building the MacOS app. By doing this, we ensure the app is not modified after the built process which messes up with code signing, if in place.

Reviewed By: antonk52

Differential Revision: D51568778

fbshipit-source-id: 0b1b0ad9947550ddf0f6d4b04e5aff41f7edcdee
2023-11-27 04:55:05 -08:00
Lorenzo Blasa
d22d362c31 Codesign capabilities
Summary:
Add codesign capabilities to Flipper Server Cocoa app.

Also, push the version to the build step instead of overriding once built. Otherwise, the Info.plist will be marked as 'being tampered with'.

Note: we are still not using the signing, but the capability is there.

Reviewed By: antonk52

Differential Revision: D51547008

fbshipit-source-id: 33abcd2fce33a7daf2ae8941b54989dba82fc0e3
2023-11-27 04:55:05 -08:00
Lorenzo Blasa
ec9bc8a29f Avoid template copy
Summary:
As mentioned on the previous diff, we no longer use a pre-built template when creating a release build.

This change moves the built binary directly into place instead of updating the existing template after which it was moved to its final destination.

Reviewed By: antonk52

Differential Revision: D51424944

fbshipit-source-id: 284fb53bb5f00f92b3ca9db3b28cfd1e4dacfa19
2023-11-17 05:51:47 -08:00
Lorenzo Blasa
e3038a3393 MacOS app to be built on each release build
Summary:
So far we have used a 'template' approach, in which the release build script will copy and use to create the final deliverable.

The template itself was updated locally by running:
    cd ~/fbsource/xplat/sonar/facebook/flipper-server
    yarn start

This would:
- Build the MacOS app for all supported architectures: x64 and arm64
- Update the template found on the static directory

After the update, we would just commit the changes to the repo.

## About this change
Instead, build the MacOS app when the release script is used. This is leaves way less margin for error as we have removed all the manual steps that had to be done as listed above.

Reviewed By: antonk52

Differential Revision: D51397661

fbshipit-source-id: 2234c9996fa98f32db244764acf3e35dc9a388c9
2023-11-17 05:51:47 -08:00
Lorenzo Blasa
6b54bd3173 Remove no longer needed index.web.dev.html
Summary: This is a duplicate, is not needed, causes confusion.

Reviewed By: aigoncharov

Differential Revision: D51307091

fbshipit-source-id: 4d55d727ea5f20100ecd15ad6e23aa0c01722524
2023-11-14 10:53:09 -08:00
Anton Kastritskiy
d023bcc42e remove shortcuts
Reviewed By: aigoncharov

Differential Revision: D51159922

fbshipit-source-id: fbb59b416f92b9156c74a12247da8d0df07f1a4e
2023-11-10 04:33:02 -08:00
Lorenzo Blasa
92d1454140 Open flag when starting server in debug mode
Summary:
It was hard-coded to always open the first time.

This allows to run the server on debug mode without opening UI.

Reviewed By: antonk52

Differential Revision: D51115746

fbshipit-source-id: 9467f0fbff45987247a2bb3bf5eb1aa578de1913
2023-11-08 09:20:13 -08:00
Lorenzo Blasa
9164e04e29 Better appId and productName
Summary:
As to not conflict with non-electron installations, this will ensure the product name and app id matches the installation.

By doing this, both Flipper installations can co-exist, which I think is desirable.

Reviewed By: antonk52

Differential Revision: D51078955

fbshipit-source-id: fabaa6eb2a45ac542297b0456a09e938a2ec2e0b
2023-11-08 02:51:34 -08:00
Lorenzo Blasa
6dd1fcd569 Set x64 default architecture and .pkg target for RN-only builds
Summary: These are local changes required to make an installer for the last RN-only Electron distribution of Flipper. Instead of just throwing this away, let's keep it in the history of the repository, just in case.

Reviewed By: passy

Differential Revision: D50838207

fbshipit-source-id: 4966e046161e24a616c04d5cf57fee2512f06525
2023-11-01 04:44:48 -07:00
Lorenzo Blasa
bf49924f0c RN-only app icon
Summary: ^

Reviewed By: aigoncharov

Differential Revision: D50557331

fbshipit-source-id: bc6f9ed7b379b65b9f09b1471d9ec7cbb820086b
2023-10-24 07:18:43 -07:00
Lorenzo Blasa
94120d61aa RN-only build flag
Summary: Previously I had created a RN build, locally, with a few minor differences. That had to be reverted. Instead of reverting and re-applying changes, I'm introducing a flag that can be used in the interim to produce the RN-only builds.

Reviewed By: LukeDefeo

Differential Revision: D50555055

fbshipit-source-id: edface9a1587fb51e54eebe73724032baf985c83
2023-10-24 04:18:51 -07:00
Anton Kastritskiy
663380e721 mark unused vars as errors
Reviewed By: lblasa

Differential Revision: D50500690

fbshipit-source-id: 6f739fe25c232ecfe842337af4399681e85f6a13
2023-10-20 12:44:58 -07:00
Lorenzo Blasa
4834fda6fa Build local architecture CLI arg
Summary:
The current '--mac' arg builds all supported architectures. This is great when generating release builds but not so much when testing a release for the current architecture.

Not modifying the existing '--mac' arg as to not update our current CI.

Reviewed By: antonk52

Differential Revision: D50497211

fbshipit-source-id: 3e4d9728adc822c48788556e2ea47f4dd1c21b05
2023-10-20 07:25:52 -07:00
Anton Kastritskiy
a978c96987 large fb icons only, no density
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
2023-10-20 07:23:34 -07:00
Anton Kastritskiy
64d97998fd fix prod icons
Summary:
Previously we had requested non existing icons. This fixes missing icons on pixel dense screens (macbook pro, 4k screens).

I could add x4, x5 icons as well. Though they are no better than x3. Even x3 is pretty raterized. Ideally we should be serving icons with higher resolution and scaling them down instead of doing this. Even better use SVG icons which we do not have.

Reviewed By: LukeDefeo

Differential Revision: D50454271

fbshipit-source-id: cda90972abb56069e160ddefdc6de460c49d06c0
2023-10-19 07:25:40 -07:00
Lorenzo Blasa
8a11043f37 Release build integration
Summary: This is the immediate follow-up from the previous diff which aims to integrate the MacOS app into our release build script, meta only.

Reviewed By: antonk52, aigoncharov

Differential Revision: D50301369

fbshipit-source-id: 23a4842666c3a7aa9616c6237e16b71bae87ba36
2023-10-16 08:35:48 -07:00
Pascal Hartig
d40ccc8786 Update flipper-runtime icon in server app bundle
Summary: Changelog: When requesting Keychain Access, you will now see "flipper-runtime" instead of a generic "node" process.

Reviewed By: lblasa

Differential Revision: D50261830

fbshipit-source-id: ef6fd7d5099c4ff7370f0401a5de3fde1659f1f3
2023-10-13 09:01:21 -07:00
Pascal Hartig
c80be9960a Use fetch() to download node
Summary: This is more reliable and follows redirect which we need for GitHub downloads.

Reviewed By: antonk52

Differential Revision: D50263976

fbshipit-source-id: d001b6eb460510b0b673ea66651e7c39cac3092f
2023-10-13 07:18:10 -07:00
Pascal Hartig
0cb5331c31 Fix spurious server build error on MacOS
Summary:
Copying files will randomly fail with something akin to

```
Error: Cannot copy '../acirb/bin/acorn' to a subdirectory of itself, '../acorn/bin/acorn'.
```

See https://github.com/jprichardson/node-fs-extra/issues/708

Reviewed By: antonk52

Differential Revision: D50263977

fbshipit-source-id: 39091ef57b79c692ec89e7a250595509839e2af8
2023-10-13 07:18:10 -07:00
Pascal Hartig
0134b66f37 Save node binary with name flipper-runtime
Summary:
As discussed with lblasa. This solves a few issues:

- Confusing names in `ps` and Activity Monitor related to Flipper.
- Permission requests for the Keychain from "node" lead users to deny it.
- Seeing "node" as allowed apps for an entry in Keychain is confusing.

Reviewed By: lblasa

Differential Revision: D50232337

fbshipit-source-id: 3bc92aae0ca31d1a80582fb8a794bbc64fc2f2e5
2023-10-13 03:31:11 -07:00
Lorenzo Blasa
4b078a4472 Revert RN-only
Summary: ^

Reviewed By: aigoncharov

Differential Revision: D49953166

fbshipit-source-id: b08a09b89e3b857f633e62bbc5b63064c3657aa4
2023-10-05 07:14:03 -07:00
Pascal Hartig
4905446697 Update deps
Summary: Update a few selected patch-level deps.

Reviewed By: antonk52

Differential Revision: D49779877

fbshipit-source-id: 5f8da30a3802f4ca516ad20ac223cafce5120ba0
2023-10-03 10:58:10 -07:00
Lorenzo Blasa
026d28944c Set RN-only icon for Electron build
Summary:
^

Use this icon for release builds.

Reviewed By: antonk52

Differential Revision: D49823791

fbshipit-source-id: 49bd64e2a630a9ae8bd4c9bf35809526863df202
2023-10-02 05:06:03 -07:00
Lorenzo Blasa
cb86f0f90b Log download/unpack errors
Summary: ^

Reviewed By: ivanmisuno

Differential Revision: D49637030

fbshipit-source-id: 0e9925bd435e7843a57d6a8917f8da4e5e35640c
2023-09-27 03:34:01 -07:00
Lorenzo Blasa
9e98391151 Publish server dmg to release artifacts
Summary: ^

Reviewed By: passy

Differential Revision: D49544230

fbshipit-source-id: 908a5d7c759bcbcef34c262ab588500fc87cb463
2023-09-25 03:59:38 -07:00
Lorenzo Blasa
db07297e2d Create DMG
Summary: Add an option to archive the server build inside a DMG.

Reviewed By: antonk52

Differential Revision: D49504225

fbshipit-source-id: 3c34e6f0e4c9a685d36771199a6e20394f68baef
2023-09-22 07:14:52 -07:00
Anton Kastritskiy
412b05ad8d fix lint CI check on windows
Reviewed By: lblasa

Differential Revision: D49503462

fbshipit-source-id: c047e72edda644d42cf4454a3a8b2023eca8d2ea
2023-09-21 10:36:50 -07:00
Pascal Hartig
cd74f47f4f Back out "Kill start-dev-server"
Summary:
Original commit changeset: dfdb73c8bce3

Original Phabricator Diff: D49183502

Reviewed By: antonk52

Differential Revision: D49365997

fbshipit-source-id: 919c96f88a7dd4adf4943308c5f7836b9c54060a
2023-09-18 03:19:44 -07:00
Anton Kastritskiy
cb4446d76c speed up verifying types deps by parallizing
Summary: read pacakge.json files asyncronosly to speed up script execution

Reviewed By: LukeDefeo, passy

Differential Revision: D49188676

fbshipit-source-id: 55c1eeb8f62c6b3760f2a037592807c7b00af01d
2023-09-12 08:26:22 -07:00
Pascal Hartig
423e06e83b Kill start-dev-server
Summary:
No idea why we have two but this seems unused.

1) https://www.internalfb.com/code/fbsource/[36aa14748056fd22d453685a0ba85817e0059497]/xplat/sonar/desktop/scripts/start-flipper-server-dev.tsx
2) https://www.internalfb.com/code/fbsource/[36aa14748056fd22d453685a0ba85817e0059497]/xplat/sonar/desktop/scripts/start-dev-server.tsx

Reviewed By: lblasa

Differential Revision: D49183502

fbshipit-source-id: 1d685c402bdd366f9da9facc92c6265eb85e34ad
2023-09-12 03:15:41 -07:00
Lorenzo Blasa
a5a3e0494a Better installation wizard
Summary: A few improvements to the installation wizard.

Reviewed By: antonk52

Differential Revision: D49145069

fbshipit-source-id: 1aadd85e1d187bd61983a0b4201b530cbdbf509a
2023-09-11 07:12:20 -07:00
Anton Kastritskiy
f2ef26cd9a bump fs-extra types
Summary: `recursive` was dropped in when [dropping](https://github.com/jprichardson/node-fs-extra/issues/886) node v10

Reviewed By: aigoncharov

Differential Revision: D48780242

fbshipit-source-id: 29349590a7f14da85fe8df28b20d9b418e7a8b1d
2023-09-05 07:17:06 -07:00
Anton Kastritskiy
4439411d29 bump or ignore types packages
Reviewed By: LukeDefeo

Differential Revision: D48782825

fbshipit-source-id: 00c46fa609847272b48f8f4476291666e9251c95
2023-09-04 14:52:34 -07:00
Anton Kastritskiy
4ec84ca7fb allow ignoring packages for @types/* major version compatability
Reviewed By: LukeDefeo

Differential Revision: D48779653

fbshipit-source-id: ddea9730d1066212bfa7933df7f6a2c178e49766
2023-09-04 03:42:29 -07:00
Anton Kastritskiy
806d684ddc Script to verify @types/* versions
Summary:
We recently raised a concern that for some packages types/* version is different than the package we are using. This can cause runtime errors as typescript can suggest usage that no longer reflects current API of a library. To combat this issue we decided to add a CI check to verify that major versions of types and a libriary match.

This script will be refined if in the next few diffs

Reviewed By: LukeDefeo

Differential Revision: D48779652

fbshipit-source-id: 2a826ba9d00565563553f04cd809ae0638db6282
2023-09-01 09:54:49 -07:00
Lorenzo Blasa
cc9b62ec47 Need to copy loading.html
Summary: Need to copy this resource too from the static directory.

Reviewed By: aigoncharov

Differential Revision: D48864174

fbshipit-source-id: 0f3bfe9608bb9d48ec1cfb7243b3f0701d2fd8cf
2023-08-31 03:59:24 -07:00
Pascal Hartig
554d2f9b83 Bump ES level to 2021
Summary: Updating the remaining tsconfigs to build for an ES2021 target.

Reviewed By: antonk52

Differential Revision: D48687661

fbshipit-source-id: 2761704d251f701594ca5d362a17731f287088ed
2023-08-29 05:06:18 -07:00
Lorenzo Blasa
17cfa0e571 Session Id moved to server config
Summary:
Session Id should be shared between client and server, but it was defined deep in the client (redux store).

The proposed solution presented below is to move the session id to the server configuration. By doing this, it becomes available to both server and client VERY early in the application life-cycle for both Electron and non-Electron builds.

Reviewed By: LukeDefeo

Differential Revision: D48520367

fbshipit-source-id: ca959b27ab18b1a2e4cd2fac1d28545664f1b514
2023-08-22 05:16:20 -07:00
Pascal Hartig
bf6afe329f Fix electron build on arm64
Summary:
Electron-builder puts its results in a different directory, based on the architecture you build on.

While we don't have plans to release an arm64 build internally, we still need to support local builds for testing.

Without this, it fails with a rather confusing error message:

```
Script termnated. Error: spawn zip ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn zip',
  path: 'zip',
  spawnargs: [ '-qyr9', '../Flipper-mac.zip', 'Flipper.app' ]
```

Reviewed By: lblasa

Differential Revision: D48517426

fbshipit-source-id: 21a133f8fce3aee0737ce5cbccc7a692a613b98e
2023-08-21 06:36:37 -07:00
Pascal Hartig
160b05a5bd Bump deps
Summary:
This updates minor and patch level dependencies. Frustratingly, I had to revert a bunch
of changes in that version range that still caused incompatibilities and test failures.

If I find time, I'll dig a bit deeper.

Reviewed By: ivanmisuno

Differential Revision: D48433210

fbshipit-source-id: 9ab12e774c1992d4f22cc1428d34f102ce820b75
2023-08-21 03:03:30 -07:00
Lorenzo Blasa
47b718d104 Remove TCP option as it will be the only option
Summary: UDS will be removed. The first step would be to remove the TCP optionality.

Reviewed By: passy

Differential Revision: D48264741

fbshipit-source-id: ca9e1b68be61e99240e95bcd4f26f2db63a64005
2023-08-11 08:19:51 -07:00
Lorenzo Blasa
dc0fd0a9e7 Windows server packaging
Summary: ^

Reviewed By: passy

Differential Revision: D47833317

fbshipit-source-id: b500f58b4ef0e201d8a711f3a83774fa82a7199b
2023-07-27 07:58:22 -07:00
Lorenzo Blasa
566125af3f spawn to set shell option
Summary: This is needed on Windows, otherwise it just throws an error when using spawn.

Reviewed By: passy

Differential Revision: D47832379

fbshipit-source-id: c1a5094c2e72683a695949cd99b2a1054f01aced
2023-07-27 07:06:58 -07:00
Lorenzo Blasa
5b2d20e0e0 Scaffolding for windows bundle
Summary: Just adds a function stub that will add the necessary run script for windows.

Reviewed By: passy

Differential Revision: D47627532

fbshipit-source-id: 09b6a203c2a5def20e586b5753d95ca58797852a
2023-07-27 07:06:58 -07:00
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
Lorenzo Blasa
a165d37ab3 Grey icon for PWA
Summary:
Right now, both Launcher and PWA share the same icon.

As to make it easier to identify which one is which, PWA will have a greyed icon instead.

Reviewed By: antonk52

Differential Revision: D47436998

fbshipit-source-id: 69d4d273c35e327263fbbf02d4ac7a005013f1d9
2023-07-13 07:41:44 -07:00
Michel Weststrate
50f50fa46c fall back to larger images if requested size is not available
Summary: This diff follows up on the previous one, by trying a larger icon size if the original requested icon size was missing.

Reviewed By: lblasa

Differential Revision: D46556076

fbshipit-source-id: 4a078088aa27390f247e39afeda4b1df261d8b30
2023-06-08 07:31:34 -07:00
Michel Weststrate
a6dac1d8d9 make icon download more robust, and use assets_DO_NOT_HARDCODE urls instead of asset urls.
Summary:
Since ~yesterday all our builds started failing due to being unable to download static assets. Although those assets load correctly in the browser, and by using the browsers's generated `curl` command, which looks like:

```
curl 'https://facebook.com/assets/?name=face-unhappy&variant=outline&size=24&set=facebook_icons&density=1x' \
  -H 'authority: facebook.com' \
  -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
  -H 'accept-language: nl,en-GB;q=0.9,en;q=0.8,nl-NL;q=0.7,en-US;q=0.6' \
  -H 'cache-control: no-cache' \
  -H 'cookie: OMITTED' \
  -H 'pragma: no-cache' \
  -H 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: document' \
  -H 'sec-fetch-mode: navigate' \
  -H 'sec-fetch-site: none' \
  -H 'sec-fetch-user: ?1' \
  -H 'upgrade-insecure-requests: 1' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \
  --compressed
```

Download fails as soon as the cookie header is dropped.

Changes the base url to `https://facebook.com/images/assets_DO_NOT_HARDCODE/facebook_icons/` fixes that problem, unless the resolution doesn't exist (addressed in next diff).

This also seems to remove the flakiness we were experiencing before, so dropped the retry mechanism for now.

Also made failing to download an icon a warning instead of a build failure.

Reviewed By: lblasa

Differential Revision: D46552986

fbshipit-source-id: f1382d6a8fc6669691f0c8da6b77834d24a373c5
2023-06-08 07:31:34 -07:00