Commit Graph

6 Commits

Author SHA1 Message Date
Michel Weststrate
5df34a337c Unshare global types
Summary:
This diff adds `types` fields on the compiler config for every project. This way we can make sure that for example node types and packages are not available in flipper-ui-core. Without an explicit types field, all types would be shared between all packages, and implicitly included into the compilation of everything. For the same reason `types/index.d.ts` has been removed, we want to be intentional on which types are being used in which package.

This diff does most of the work, the next diff will fine tune the globals, and do some further cleanup.

As an alternative solution I first tried a `nohoist: **/node_modules/types/**` and make sure every package list explicitly the types used in package json, which works but is much more error prone, as for example two different react types versions in two packages will cause the most unreadable compiler error due to the types not being shared and not literally the same.

Reviewed By: lawrencelomax

Differential Revision: D33124441

fbshipit-source-id: c2b9d768f845ac28005d8331ef5fa1066c7e4cd7
2021-12-17 07:36:07 -08:00
dependabot[bot]
34a09a3096 Bump react-virtual from 2.8.0 to 2.8.2 in /desktop (#2999)
Summary:
Bumps [react-virtual](https://github.com/tannerlinsley/react-virtual) from 2.8.0 to 2.8.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/tannerlinsley/react-virtual/releases">react-virtual's releases</a>.</em></p>
<blockquote>
<h2>v2.8.2</h2>
<h2><a href="https://github.com/tannerlinsley/react-virtual/compare/v2.8.1...v2.8.2">2.8.2</a> (2021-09-30)</h2>
<h3>Performance Improvements</h3>
<ul>
<li>reuse already measure items, include key into virtualItem (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/179">https://github.com/facebook/flipper/issues/179</a>) (<a href="8cb22fb46f">8cb22fb</a>)</li>
</ul>
<h2>v2.8.1</h2>
<h2><a href="https://github.com/tannerlinsley/react-virtual/compare/v2.8.0...v2.8.1">2.8.1</a> (2021-08-05)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Page Title (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/177">https://github.com/facebook/flipper/issues/177</a>) (<a href="38726c8a7d">38726c8</a>)</li>
<li>range calculated only on scroll (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/166">https://github.com/facebook/flipper/issues/166</a>) (<a href="adf60b3f31">adf60b3</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="8cb22fb46f"><code>8cb22fb</code></a> perf: reuse already measure items, include key into virtualItem (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/179">https://github.com/facebook/flipper/issues/179</a>)</li>
<li><a href="433d9663ce"><code>433d966</code></a> Update CarbonAds.js</li>
<li><a href="121a5dfad7"><code>121a5df</code></a> docs(index): Fix typo in 'dyanmically' (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/176">https://github.com/facebook/flipper/issues/176</a>)</li>
<li><a href="adf60b3f31"><code>adf60b3</code></a> fix: range calculated only on scroll (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/166">https://github.com/facebook/flipper/issues/166</a>)</li>
<li><a href="38726c8a7d"><code>38726c8</code></a> fix: Page Title (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/177">https://github.com/facebook/flipper/issues/177</a>)</li>
<li><a href="80207b716a"><code>80207b7</code></a> Update index.js</li>
<li><a href="7c2501ee08"><code>7c2501e</code></a> new gh header</li>
<li><a href="36d57d323c"><code>36d57d3</code></a> Update README.md</li>
<li><a href="b72c0291a5"><code>b72c029</code></a> Update overview.md</li>
<li><a href="31ed0e323a"><code>31ed0e3</code></a> docs: fix links</li>
<li>Additional commits viewable in <a href="https://github.com/tannerlinsley/react-virtual/compare/v2.8.0...v2.8.2">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=react-virtual&package-manager=npm_and_yarn&previous-version=2.8.0&new-version=2.8.2)](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/2999

Reviewed By: passy

Differential Revision: D31991577

Pulled By: mweststrate

fbshipit-source-id: b81c96b80478c4ae92aac26e809eabec8dbe90e9
2021-11-11 12:21:58 -08:00
Anton Kastritskiy
4a4cc21d89 Refine DataSource id to use actual key type instead of a wide string type
Summary: Current implementation uses type `string` as a key for indexing items stored in datasource. However, users can provide any key as an index which means that the type of index item can be anything, not only string. This diff introduces a more refined types for the key. It adds another requirement to provide a key property to a generic which is used to infer the index type.

Reviewed By: mweststrate, aigoncharov

Differential Revision: D31895751

fbshipit-source-id: 19ba907bd6f35df87e3fa442db5fc5cec6af174d
2021-10-28 10:44:01 -07:00
Michel Weststrate
bc647972e1 Type improvements
Summary: some type simplifications, that makes it easier to reuse data sources and helps type inference

Reviewed By: passy

Differential Revision: D28413380

fbshipit-source-id: 261a8b981bf18a00edc3075926bd668322e1c37d
2021-06-07 08:09:53 -07:00
Michel Weststrate
9261f0dd40 Fix scroll bar regression
Summary:
Changelog: [Logs] Fix regression causing the scrollbars to be hidden. This diff fixes a regression where the Logs plugin was no longer scrollable (and scrolls indefinitely, killing perf).

As reported in https://fb.workplace.com/groups/flippersupport/permalink/1133775743769749/

The cause of the problem is the swap between the `PluginContainer` and `outOfContentsContainer`.

The deeper root that caused in the first place, is that containers use a `flex: 1` layout, which gets interpreted as `flex: 1 1 0%` (grow, shrink, 0% by default), where it was always inteded to be `flex: 1 1 0` (grow, shrink, by default zero pixels). In practice that difference usually doesn't matter. But sometimes it does... See https://stackoverflow.com/a/42630660/1983583

My whole life has been a lie up to this point.

Will trigger a new release after landing this.

Reviewed By: nikoant

Differential Revision: D28422966

fbshipit-source-id: 3ebd5f8ae76e032c5d698154b021df8ebef2c757
2021-05-13 13:52:39 -07:00
Michel Weststrate
84e2646909 Reorganise for easier extraction
Summary:
To make the DataSource abstraction reusable for other teams and an upcoming talk, this diff moves all DataSource storage & virtualization logic in one folder.

Will set up a build process and demo project in later diffs.

Reviewed By: nikoant

Differential Revision: D28056700

fbshipit-source-id: 7cfe5b40bbbe387da711f765a604a45029d451c7
2021-05-10 07:03:39 -07:00