Files
flipper/js/js-flipper
dependabot[bot] 57ca283f31 Bump typescript from 4.8.4 to 4.9.3 in /js/js-flipper (#4326)
Summary:
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.8.4 to 4.9.3.
<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.9</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/">release announcement</a>.</p>
<p>Downloads are available on:</p>
<ul>
<li><a href="https://www.npmjs.com/package/typescript">npm</a></li>
<li><a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild">NuGet package</a></li>
</ul>
<h2>Changes:</h2>
<ul>
<li>93bd577458d55cd720b2677705feab5c91eb12ce Bump version to 4.9.3 and LKG.</li>
<li>107f832b80df2dc97748021cb00af2b6813db75b Update LKG.</li>
<li>31bee5682df130a14ffdd5742f994dbe7313dd0e Cherry-pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50977">#50977</a> into release-4.9 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51363">#51363</a>) [ <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50872">#50872</a> ]</li>
<li>1e2fa7ae15f8530910fef8b916ec8a4ed0b59c45 Update version to 4.9.2-rc and LKG.</li>
<li>7ab89e5c6e401d161f31f28a6c555a3ba530910e Merge remote-tracking branch 'origin/main' into release-4.9</li>
<li>e5cd686defb1a4cbdb36bd012357ba5bed28f371 Update package-lock.json</li>
<li>8d40dc15d1b9945837e7860320fdccfe27c40cad Update package-lock.json</li>
<li>5cfb3a2fe344a5350734305193e6cc99516285ca Only call return() for an abrupt completion in user code (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51297">#51297</a>)</li>
<li>a7a9d158e817fcb0e94dc1c24e0a401b21be0cc9 Fix for broken baseline in yieldInForInInDownlevelGenerator (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51345">#51345</a>)</li>
<li>7f8426f4df0d0a7dd8b72079dafc3e60164a23b1 fix for-in enumeration containing yield in generator (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51295">#51295</a>)</li>
</ul>

<ul>
<li>3d2b4017eb6b9a2b94bc673291e56ae95e8beddd Fix assertion functions accessed via wildcard imports (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51324">#51324</a>)</li>
<li>64d0d5ae140b7b26a09e75114517b418d6bcaa9f fix(51301): Fixing an unused import at the end of a line removes the newline (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51320">#51320</a>)</li>
<li>754eeb2986bde30d5926e0fa99c87dda9266d01b Update CodeQL workflow and configuration, fix found bugs (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51263">#51263</a>)</li>
<li>d8aad262006ad2d2c91aa7a0e4449b4b83c57f7b Update package-lock.json</li>
<li>d4f26c840b1db76c0b25a405c8e73830a2b45cbc fix(51245): Class with parameter decorator in arrow function causes &quot;convert to default export&quot; refactoring failure (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51256">#51256</a>)</li>
<li>16faf45682173ea437a50330feb4785578923d7f Update package-lock.json</li>
<li>8b1ecdb701e2a2e19e9f8bcdd6b2beac087eabee fix(50654): &quot;Move to a new file&quot; breaks the declaration of referenced variable (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50681">#50681</a>)</li>
<li>170a17fad57eae619c5ef2b7bdb3ac00d6c32c47 Dom update 2022-10-25 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51300">#51300</a>)</li>
<li>9c4e14d75174432f6a4dc5967a09712a6784ab88 Remove &quot;No type information for this code&quot; from baseline (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51311">#51311</a>)</li>
<li>88d25b4f232929df59729156dfda6b65277affec fix(50068): Refactors trigger debug failure when JSX text has a ' and a tag on the same line. (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51299">#51299</a>)</li>
<li>8bee69acf410d4986cb0cc102b949e2d133d5380 Update package-lock.json</li>
<li>702de1eeaaef88a189e4d06e5a2aae287853790a Fix early call to return/throw on generator (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51294">#51294</a>)</li>
<li>2c12b1499908ad7718e65d20e264561207c22375 Add a GH Action to file a new issue if we go a week without seeing a typescript-error-deltas issue (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51271">#51271</a>)</li>
<li>6af270dee09d62516f6dc02ec102a745ffebc037 Update package-lock.json</li>
<li>2cc4c16a26672a7ba6c97ba16309fcf334db7cae Update package-lock.json</li>
<li>60934915d9ccc4ca9c0fb2cd060d7ec81601942b Fix apparent typo in getStringMappingType (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51248">#51248</a>)</li>
<li>61c26096e3373719ece686b84c698423890e9a5f Update package-lock.json</li>
<li>ef69116c41cb6805f89e6592eacb0ccb7f02207d Generate shortest <code>rootDirs</code> module specifier instead of first possible (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51244">#51244</a>)</li>
<li>bbb42f453dc684e03d977c5b70391124d57543a9 Fix typo in canWatchDirectoryOrFile found by CodeQL (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51262">#51262</a>)</li>
<li>a56b254ad3c52b598bc5d44f83f3d0a1cf806068 Include 'this' type parameter in isRelatedTo fast path (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51230">#51230</a>)</li>
<li>3abd351c0eea55758f27ee5558a4a1525b77f45b Fix super property transform in async arrow in method (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51240">#51240</a>)</li>
<li>eed05112180e0d94f78aa02d676d49468f15dc31 Update package-lock.json</li>
<li>2625c1feae25aede35465ca835440fc57bf13d52 Make the init config category order predictable (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51247">#51247</a>)</li>
<li>1ca99b34029dafad2c18af7bdc0711f4abf7e522 fix(50551): Destructuring assignment with var bypasses &quot;variable is used before being assigned&quot; check (2454) (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50560">#50560</a>)</li>
<li>3f28fa12dfecb8dfd66ce4684bf26f64e1f092f1 Update package-lock.json</li>
<li>906ebe49334a3a9c2dbd73cd3c902898bc712b66 Revert structuredTypeRelatedTo change and fix isUnitLikeType (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51076">#51076</a>)</li>
<li>8ac465239f52de1da3ada8cdc4c3f107f4d62e45 change type (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51231">#51231</a>)</li>
<li>245a02cbed7ad50a21289730159abc8d19a66f40 fix(51222): Go-to-definition on return statements should jump to the containing function declaration (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51227">#51227</a>)</li>
<li>2dff34e8c4a91c0005ca9ccfb7e045e225b6f2e4 markAliasReferenced should include ExportValue as well (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51219">#51219</a>)</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="93bd577458"><code>93bd577</code></a> Bump version to 4.9.3 and LKG.</li>
<li><a href="107f832b80"><code>107f832</code></a> Update LKG.</li>
<li><a href="31bee5682d"><code>31bee56</code></a> Cherry-pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/50977">#50977</a> into release-4.9 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51363">#51363</a>)</li>
<li><a href="1e2fa7ae15"><code>1e2fa7a</code></a> Update version to 4.9.2-rc and LKG.</li>
<li><a href="7ab89e5c6e"><code>7ab89e5</code></a> Merge remote-tracking branch 'origin/main' into release-4.9</li>
<li><a href="e5cd686def"><code>e5cd686</code></a> Update package-lock.json</li>
<li><a href="8d40dc15d1"><code>8d40dc1</code></a> Update package-lock.json</li>
<li><a href="5cfb3a2fe3"><code>5cfb3a2</code></a> Only call return() for an abrupt completion in user code (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51297">#51297</a>)</li>
<li><a href="a7a9d158e8"><code>a7a9d15</code></a> Fix for broken baseline in yieldInForInInDownlevelGenerator (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51345">#51345</a>)</li>
<li><a href="7f8426f4df"><code>7f8426f</code></a> fix for-in enumeration containing yield in generator (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/51295">#51295</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/Microsoft/TypeScript/compare/v4.8.4...v4.9.3">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.8.4&new-version=4.9.3)](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/4326

Reviewed By: antonk52

Differential Revision: D41472364

Pulled By: passy

fbshipit-source-id: 624e6e1c371ed9f287b0c66be33d6c1bafd8c98d
2022-11-24 10:42:06 -08:00
..
2021-10-21 04:28:21 -07:00
2022-01-18 07:46:05 -08:00
2021-10-21 04:28:21 -07:00
2021-10-21 04:28:21 -07:00
2021-10-21 04:28:21 -07:00
2022-11-10 06:52:13 -08:00
2022-06-01 02:49:25 -07:00
2021-10-21 04:28:21 -07:00

js-flipper

This package exposes JavaScript bindings to talk from web / Node.js directly to flipper.

Installation

yarn add js-flipper

Usage

How to build Flipper plugins is explained in the flipper documentation: Creating a Flipper plugin. Building a Flipper plugin involves building a plugin for the Desktop app, and a plugin that runs on a Device (web or Node.js). This package is only needed for the plugin that runs on the device (web / Node.js), and wants to use the WebSocket connection to communicate to Flipper.

This package exposes a flipperClient. It has:

  • addPlugin method. It accepts a plugin parameter, that registers a client plugin and will fire the relevant callbacks if the corresponding desktop plugin is selected in the Flipper Desktop. The full plugin API is documented here.
  • start method. It starts the client. It has two arguments:
    • appName - (required) the name displayed in Flipper
    • options which conforms to the interface
      interface FlipperClientOptions {
        // Make the client connect to a different URL
        urlBase?: string;
        // Override WebSocket implementation (Node.js folks, it is for you!)
        websocketFactory?: (url: string) => FlipperWebSocket;
        // Override how errors are handled (it is simple `console.error` by default)
        onError?: (e: unknown) => void;
        // Timeout after which client tries to reconnect to Flipper
        reconnectTimeout?: number;
        // Set device ID. Default: random ID persisted to local storage.
        getDeviceId?: () => Promise<string> | string
      }
      

Example (web)

An example plugin can be found in FlipperTicTacToe.js.

The corresponding Desktop plugin ships by default in Flipper, so importing the above file and dropping the <FlipperTicTacToe /> component somewhere in your application should work out of the box.

The sources of the corresponding Desktop plugin can be found here.

Node.js

Node.js does not have a built-in WebSocket implementation. You need to install any implementation of WebSockets for Node.js that is compatible with the interface of the web version.

import flipperClient from 'js-flipper';
// Say, you decided to go with 'ws'
// https://github.com/websockets/ws
import WebSocket from 'ws';

// Start the client and pass some options
// You might ask yourself why there is the second argument `{ origin: 'localhost:' }`
// Flipper Desktop verifies the `Origin` header for every WS connection. You need to set it to one of the whitelisted values (see `VALID_WEB_SOCKET_REQUEST_ORIGIN_PREFIXES`).
flipperClient.start('My cool nodejs app', { websocketFactory: url => new WebSocket(url, {origin: 'localhost:'}) });

An example plugin should be somewhat similar to what we have for React. It is currently WIP (do not confuse with RIP!).