Commit Graph

12 Commits

Author SHA1 Message Date
Pascal Hartig
51ae6f7cfc Run yarn fix (#4962)
Summary:
[js] Run yarn fix

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

Reviewed By: mweststrate

Differential Revision: D47717348

Pulled By: passy

fbshipit-source-id: 15de379990509d83edf218fe9073107c9b520956
2023-07-25 02:05:37 -07:00
Lukas Kurucz
362cea3126 Fix: WS should not reconnect on 1001 (#4506)
Summary:
Due to bug in ReactNative `WebSocket` implementation, the `ws.close(1000)` method will not carry the provided `onclose` event number. It would close connection with `1001` instead.

Technically, the `1001` also seems as normal status code to close WS connection, so likely we don't wanna use reconnect anyway.

This only impacts older RN versions (iOS), as it was later fixed: https://github.com/facebook/react-native/pull/24950/files

## Changelog

- Do not reconnect when WS close code is `1001` - GoingAway

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

Test Plan: Run `flipperClient.stop()`, then the connection should not be reconnected (only reproducible on RN env.)

Reviewed By: lblasa

Differential Revision: D43277366

Pulled By: passy

fbshipit-source-id: bb39ec7debe53f15e75c850158188d56bf70375d
2023-02-15 03:06:22 -08:00
dependabot[bot]
609d1f75b3 Bump typescript from 4.7.4 to 4.8.4 in /js/js-flipper (#4147)
Summary:
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.7.4 to 4.8.4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/Microsoft/TypeScript/releases">typescript's releases</a>.</em></p>
<blockquote>
<h2>TypeScript 4.8.4</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/">release announcement</a>.</p>
<p>For the complete list of fixed issues, check out the</p>
<ul>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.0%22+">fixed issues query for Typescript 4.8.0 (Beta)</a>.</li>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.1%22+">fixed issues query for Typescript 4.8.1 (RC)</a>.</li>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.2%22+">fixed issues query for Typescript 4.8.2 (Stable)</a>.</li>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.3%22+">fixed issues query for Typescript 4.8.3 (Stable)</a>.</li>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.4%22+">fixed issues query for Typescript 4.8.4 (Stable)</a>.</li>
</ul>
<p>Downloads are available on:</p>
<ul>
<li><a href="https://www.npmjs.com/package/typescript">npm</a></li>
<li><a href="https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-484">Visual Studio 2022/2019</a> (<a href="https://github.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017">Select new version in project options</a>)</li>
<li><a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild">NuGet package</a></li>
</ul>
<h2>TypeScript 4.8.3</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/">release announcement</a>.</p>
<p>For the complete list of fixed issues, check out the</p>
<ul>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.0%22+">fixed issues query for Typescript 4.8.0 (Beta)</a>.</li>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.1%22+">fixed issues query for Typescript 4.8.1 (RC)</a>.</li>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.2%22+">fixed issues query for Typescript 4.8.2 (Stable)</a>.</li>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.3%22+">fixed issues query for Typescript 4.8.3 (Stable)</a>.</li>
</ul>
<p>Downloads are available on:</p>
<ul>
<li><a href="https://www.npmjs.com/package/typescript">npm</a></li>
<li><a href="https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-483">Visual Studio 2022/2019</a> (<a href="https://github.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017">Select new version in project options</a>)</li>
<li><a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild">NuGet package</a></li>
</ul>
<h2>TypeScript 4.8</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/">release announcement</a>.</p>
<p>For the complete list of fixed issues, check out the</p>
<ul>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.0%22+">fixed issues query for Typescript 4.8.0 (Beta)</a>.</li>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.1%22+">fixed issues query for Typescript 4.8.1 (RC)</a>.</li>
<li><a href="https://github.com/microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.8.2%22+">fixed issues query for Typescript 4.8.1 (Stable)</a>.</li>
</ul>
<p>Downloads are available on:</p>
<ul>
<li><a href="https://www.npmjs.com/package/typescript">npm</a></li>
<li><a href="https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-48">Visual Studio 2022/2019</a> (<a href="https://github.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017">Select new version in project options</a>)</li>
<li><a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild">NuGet package</a></li>
</ul>
<h2>TypeScript 4.8 RC</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-8-rc/">release announcement</a>.</p>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="a614119c19"><code>a614119</code></a> Bump version to 4.8.4 and LKG</li>
<li><a href="369b4d8299"><code>369b4d8</code></a> Cherry pick <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50537">#50537</a> and <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50779">#50779</a> to release-4.8 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50907">#50907</a>)</li>
<li><a href="41e1ade33a"><code>41e1ade</code></a> Cherry-pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50704">#50704</a> into release-4.8 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50741">#50741</a>)</li>
<li><a href="2acf3a3652"><code>2acf3a3</code></a> Cherry-pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50691">#50691</a> into release-4.8 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50743">#50743</a>)</li>
<li><a href="39576e6f5c"><code>39576e6</code></a> Cherry-pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50673">#50673</a> into release-4.8 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50742">#50742</a>)</li>
<li><a href="57737235d6"><code>5773723</code></a> Cherry-pick <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50724">#50724</a> to release-4.8 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50760">#50760</a>)</li>
<li><a href="a3b3555086"><code>a3b3555</code></a> Cherry-pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50797">#50797</a> into release-4.8 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50798">#50798</a>)</li>
<li><a href="bb8cf903b5"><code>bb8cf90</code></a> Handle more places where package direcroy is converted to canonical file path...</li>
<li><a href="ea348f67aa"><code>ea348f6</code></a> Bump version to 4.8.3 and LKG</li>
<li><a href="6bb16f105c"><code>6bb16f1</code></a> Cherry-pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50620">#50620</a> into release-4.8 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50676">#50676</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/Microsoft/TypeScript/compare/v4.7.4...v4.8.4">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=typescript&package-manager=npm_and_yarn&previous-version=4.7.4&new-version=4.8.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

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

Reviewed By: aigoncharov

Differential Revision: D40022430

Pulled By: aigoncharov

fbshipit-source-id: 5e30af94a98109503798167a81fa1ce830150be5
2022-10-05 01:32:31 -07:00
Andrey Goncharov
055b14c6dd Persist device ID
Summary: Linked to https://github.com/facebook/flipper/issues/3319

Reviewed By: passy

Differential Revision: D36786952

fbshipit-source-id: f3214f35039845a8e35fa14e63f509a6fbdddb1f
2022-06-01 02:49:25 -07:00
Anton Nikolaev
9abce2f48e Upgrade dependencies in js-flipper
Summary: Upgraded npm deps to calm down dependabot

Reviewed By: passy

Differential Revision: D36513979

fbshipit-source-id: d5b25b7f95ddc04d54113bd6292920423a4f77ad
2022-05-20 11:36:13 -07:00
Lukas Kurucz
d93ce00736 fix: clear reconnect timeout on stop() (#3646)
Summary:
When using `flipperClient.stop()`, after `flipperClient.start()`, it's impossible to `start` new connection, since the previous instance would keep active `reconnect`, so would override the previous connection.

## Changelog

- clean reconnect timer when calling `flipperClient.stop()`

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

Test Plan:
1. `flipperClient.start('Demo app', { urlBase: 'null:8333' });` - this will fail connection, but keep retrying
2. `flipperClient.stop()` - should disconnect from WS and clear all reconnect timers
3. `flipperClient.start('Demo app', { urlBase: 'localhost:8333' });` - should connect succefully

Reviewed By: antonk52

Differential Revision: D35810547

Pulled By: lblasa

fbshipit-source-id: 6f0b04df890c1519abb72895157785b01d35b5f2
2022-04-25 04:53:16 -07:00
Lukas Kurucz
8416372c8f fix: encode ws url (#3498)
Summary:
Some clients require encoded ws url. For example on Android (running in Rect Native), plain URL like this:
`ws://10.0.2.2:8333?device_id=ReactNative1646120067758.0.2246373385349361&device=ReactNative&app=React Native App Google - Android SDK&os=ReactNative`
will throw error during connection.

To not require param encoding when starting the `flipperClient.start()`, it is easier to encode entire `url` before starting the ws server.

## Changelog

- encode url for `js-flipper` ws server

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

Reviewed By: aigoncharov

Differential Revision: D34638857

Pulled By: lblasa

fbshipit-source-id: 9eb0e268c7bacb5febc19bbb45fe6814fb7a60de
2022-03-04 03:46:06 -08:00
Andrey Goncharov
1f240d72c3 Fix js-flipper tests (#3297)
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/3297

Reviewed By: passy

Differential Revision: D33619287

fbshipit-source-id: 7e9dc595c999e9c8b61329f96adba6e45a1dfa50
2022-01-17 07:55:41 -08:00
Andres Suarez
79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00
Andrey Goncharov
9b16d0c29a Add documentation
Summary: Document Flipper integration with JavaScript clients.

Reviewed By: passy

Differential Revision: D31827187

fbshipit-source-id: c40d8820241c0f85bd2366a0c087d4270d316c71
2021-10-22 06:30:15 -07:00
Andrey Goncharov
02115722b3 Implement React example of WS integration with Flipper
Summary: Create an example of how one can use `js-flipper` in a browser to connect to Flipper over WS.

Reviewed By: mweststrate

Differential Revision: D31688114

fbshipit-source-id: 135f826daeddeda8dca5b3df6504cc2bdc04dd1b
2021-10-21 09:13:18 -07:00
Andrey Goncharov
9a47f41056 Implement JS flipper client
Summary:
Standardize WS implementation for JS environments.

Why do we need a separate server implementation for browsers?
Browser targets cannot authenticate via the default certificate exchange flow. We need a dedicated client for them that works over an insecure channel (without the cert exchange).

Major changes:
1. Renamed `flipper-js-client-sdk` to `js-flipper` for consistency with `react-native-flipper`
2. Updated `js-flipper` implementation to match our other existing clients

Documentation will be updated in a separate subsequent PR.

https://fb.quip.com/2mboA0xbgoxl

Reviewed By: mweststrate

Differential Revision: D31688105

fbshipit-source-id: 418aa80e0fd86361c089cf54b0d44a8b4f748efa
2021-10-21 04:28:21 -07:00