Commit Graph

9 Commits

Author SHA1 Message Date
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