Commit Graph

5 Commits

Author SHA1 Message Date
Michel Weststrate
8b111e48e6 Bump dependencies in flipper-js-client-sdk
Summary: Dependabot bumping deps one by one create a shitload of PRs, so creating a bunch of diffs that bumps all deps per subproject, using `yarn upgrade-interactive`

Reviewed By: passy

Differential Revision: D24137398

fbshipit-source-id: 2a653a5a92742f8a063e529007949c26899f35e5
2020-10-08 01:39:16 -07:00
Timur Valiev
1d55b35dfd v0.0.3 - bug fixes
Summary:
couple of bug fixes:
1) we don't want to init plugins on connect - let's wait for init command from flipper
2) on disonnect - "this" didn;t work well with .map() so i switched to old school loop

Reviewed By: jknoxville

Differential Revision: D23623946

fbshipit-source-id: cb3f579a8ee14fedfbe19895f31f77f9e08775d2
2020-09-10 08:18:14 -07:00
Rakha Kanz Kautsar
23afff9e2b flipper-js-client-sdk: fix undefined this on connectPlugin and disconnectPlugin (#1506)
Summary:
`this` is not defined for `connectPlugin` and `disconnectPlugin` because `Array.prototype.map` [replace `this` to `undefined` if not specified](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map):

> If a thisArg parameter is provided, it will be used as callback's this value. Otherwise, the value undefined will be used as its this value. The this value ultimately observable by callback is determined according to the usual rules for determining the this seen by a function.

![image](https://user-images.githubusercontent.com/1536976/91691584-72b24c80-eb9a-11ea-88f1-984f2be8ab4a.png)

## Changelog

flipper-js-client-sdk: Fix undefined this due to array map

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

Test Plan: Tried creating custom client and connecting to websocket server

Reviewed By: mweststrate

Differential Revision: D23473033

Pulled By: nikoant

fbshipit-source-id: bbfd9117da8aa8c7b491e219f98d17ccea48c0fd
2020-09-02 07:21:26 -07:00
Timur Valiev
7dbcfc89b0 js api improvements: responnders, communication protocol
Summary:
A few improvements to JS API:
1) non-dummy responders - now we can reply to flipper
2) respecting flipper communication protocol: getPlugins, getBackgroundplugins, init, deinit, execute

adding linters

Reviewed By: jknoxville

Differential Revision: D22307525

fbshipit-source-id: 2f629210f398d118cc0cb99097c9d473bb466e57
2020-07-17 04:54:44 -07:00
Timur Valiev
896a90aa26 update js-client api (migrate to TS)
Summary:
JS/TS api:
- migrate to TS
- some refactoring (get rid of bridge, make client abstract)

Implementation isn't full yet, things to be implemented:
- let plugins connect on init command from Flipper
- implement Responder

Further plans:
- make fully compatible with react-native api without breaking changes

Reviewed By: mweststrate

Differential Revision: D21839377

fbshipit-source-id: 9e9fe4ad01632f958b59eb255c703c6cbc5fafe2
2020-06-11 08:45:35 -07:00