Commit Graph

686 Commits

Author SHA1 Message Date
Luke De Feo
b30f7492cd Add connection listeners and framework events
Summary: Infra that will be used to capture litho framework events

Reviewed By: lblasa

Differential Revision: D47951601

fbshipit-source-id: 1dd756dc872d474f2872ff8cac1fd6aa3697e42b
2023-08-08 11:43:05 -07:00
Pascal Hartig
24cfd74252 Remove dokka plugin (#4995)
Summary:
[gradle] Remove dokka plugin
This is currently breaking our jetpack-compose build and blocks the entire release
as a consequence: https://github.com/facebook/flipper/issues/4970

There are all sorts of workarounds but they require changing the java target
which could have other downstream consequences: https://github.com/Kotlin/dokka/issues/2956

We don't actually rely on these artefacts at all, so it's probably safe to just disable this.

Closes https://github.com/facebook/flipper/issues/4970

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

Test Plan: ./gradlew publishToMavenLocal

Reviewed By: antonk52

Differential Revision: D48062872

Pulled By: passy

fbshipit-source-id: aef0696d5ac83dd50bcbb96b0552f9b222f5a566
2023-08-07 11:18:54 -07:00
Luke De Feo
1de033c157 Add bounds to fragment
Summary: Previously the bounds was 0, the trick is to steel the offset from the view and then use offsetchild zero so it doesnt get applied twice

Reviewed By: lblasa

Differential Revision: D47915115

fbshipit-source-id: ff771470dcf1720ca265fc9017ff0ea3b0bc1ca1
2023-07-31 10:53:03 -07:00
Luke De Feo
6b74f66ab4 Add parent id to decor view
Summary: This whole nested observer approach can be simplified massively, but for now we are just threading the parent id through so its set for observer roots too

Reviewed By: lblasa

Differential Revision: D47915504

fbshipit-source-id: 924f722f38bb202b42ea9ef6da15e685f6c75e02
2023-07-31 10:53:03 -07:00
Luke De Feo
413f85964b Send invisible as hidden attribute
Summary: This allows UIDebugger to draw them differently in tree and visualiser

Reviewed By: lblasa

Differential Revision: D47915505

fbshipit-source-id: a4d2ef9d653233e3ff24bc26cfe8017f9b51dd2b
2023-07-31 10:53:03 -07:00
Luke De Feo
60016e69f5 Remove Node id default impl
Summary: This is never identity hash code for declarative framework so this default impl is just a source of bugs, including this one.

Reviewed By: lblasa

Differential Revision: D47754625

fbshipit-source-id: 470aab084c82fa847f25116342021a79d52b7c67
2023-07-26 04:58:43 -07:00
dependabot[bot]
4176415b55 Bump org.jetbrains.kotlin:kotlin-reflect from 1.8.22 to 1.9.0 (#4965)
Summary:
Bumps [org.jetbrains.kotlin:kotlin-reflect](https://github.com/JetBrains/kotlin) from 1.8.22 to 1.9.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/JetBrains/kotlin/releases">org.jetbrains.kotlin:kotlin-reflect's releases</a>.</em></p>
<blockquote>
<h2>Kotlin 1.9.0</h2>
<h2>Changelog</h2>
<h3>Analysis API</h3>
<h4>New Features</h4>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57930"><code>KT-57930</code></a> Analysis API: provide an API for extending Kotlin resolution</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57636"><code>KT-57636</code></a> K2: Add the return type of K2 reference shortener AA <code>ShortenCommand::invokeShortening()</code> e.g., <code>ShorteningResultInfo</code> to allow callers to access the shortening result PSI</li>
</ul>
<h4>Fixes</h4>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-58249"><code>KT-58249</code></a> Analysis API: Disable error logging for FE10 implementation of resolveCall when resolve is not successful</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-55626"><code>KT-55626</code></a> Impossible to restore symbol by psi from script file</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57314"><code>KT-57314</code></a> LL FIR: Combine <code>LLFirProvider$SymbolProvider</code>s in session dependencies (optimization)</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-55527"><code>KT-55527</code></a> K2 IDE: Rewrite KtScopeContext class to allow to handle each scope separately</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-55329"><code>KT-55329</code></a> LL FIR: Unexpected ACTUAL_WITHOUT_EXPECT error on constructor and function declaration</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-50732"><code>KT-50732</code></a> LL API: fix compiler based tests</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57850"><code>KT-57850</code></a> K2: contract violation due to SymbolLightAccessorMethod.propertyAccessorSymbol</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-56543"><code>KT-56543</code></a> LL FIR: rework lazy transformers so transformers modify only declarations they suppose to</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-56721"><code>KT-56721</code></a> K2: FirExtensionDeclarationsSymbolProvider: java.lang.IllegalStateException: Recursive update</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-50253"><code>KT-50253</code></a> Analysis API: Solve issues with ProcessCancelledException</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-56800"><code>KT-56800</code></a> K2 IDE: optimize deprecation calculation for symbols</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-55006"><code>KT-55006</code></a> Analysis API does not transform Java type refs for callable symbol return types</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57256"><code>KT-57256</code></a> AA FIR: Reduce lazy resolve phase for deprecation status</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57619"><code>KT-57619</code></a> K2: CFG for class initializer is not correctly built in reversed resolve mode</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-58141"><code>KT-58141</code></a> K2: AA FIR: impossible to restore symbol for declaration with annotation with argument inside type</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57462"><code>KT-57462</code></a> Symbol Light Classes: SymbolLightFieldForProperty should retrieve annotations not from KtPropertySymbol, but from the corresponding backing field</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-54864"><code>KT-54864</code></a> Analysis API: add function to get expect KtSymbol list by actual KtSymbol</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-56763"><code>KT-56763</code></a> Analysis API: <code>.KtSourceModuleImpl is missing in the map.</code> on symbol restore when symbol cannot be seen from the use-site module</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-56617"><code>KT-56617</code></a> Analysis API: optimize KtFirSymbolProviderByJavaPsi.getNamedClassSymbol</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-54430"><code>KT-54430</code></a> K2: .getAllOverriddenSymbols() returns invalid results</li>
</ul>
<h3>Backend. Native. Debug</h3>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-55440"><code>KT-55440</code></a> Kotlin/Native debugger: inline function parameters are not visible during debugging</li>
</ul>
<h3>Backend. Wasm</h3>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-58293"><code>KT-58293</code></a> Wasm: ReferenceError: e is not defined in kotlin.test.jsThrow</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-58931"><code>KT-58931</code></a> Wasm tests are failing to start on Kotlin 1.9.0-Beta</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-58188"><code>KT-58188</code></a> Restore binary compatibility of PlatformDiagnosticSuppressor.shouldReportUnusedParameter</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57136"><code>KT-57136</code></a> K/Wasm: Restrict non-external types in JS interop</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57060"><code>KT-57060</code></a> Clarify the lack of support for dynamic in Kotlin/Wasm</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-56955"><code>KT-56955</code></a> K/Wasm: Support restricted version of K/JS <code>js(code)</code></li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57276"><code>KT-57276</code></a> Wasm: &quot;Body not found for function&quot; error when compiling konform library with Kotlin/Wasm support</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-56976"><code>KT-56976</code></a> K/Wasm bug with calling override of external function with default parameters</li>
</ul>
<h3>Compiler</h3>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md">org.jetbrains.kotlin:kotlin-reflect's changelog</a>.</em></p>
<blockquote>
<h2>1.8.21</h2>
<h3>Compiler</h3>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57848"><code>KT-57848</code></a> Native: compilation of dynamic/static library fails with Xcode 14.3</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57875"><code>KT-57875</code></a> Native compilation failure: Suspend functions should be lowered out at this point, but FUN LOCAL_FUNCTION_FOR_LAMBDA</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57946"><code>KT-57946</code></a> KAPT: &quot;RuntimeException: No type for expression&quot; with delegate</li>
</ul>
<h3>JavaScript</h3>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57356"><code>KT-57356</code></a> KJS: StackOverflowException on <a href="https://github.com/JsExport"><code>@​JsExport</code></a> with type parameters referring to one another</li>
</ul>
<h3>Tools. Compiler plugins. Serialization</h3>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-58067"><code>KT-58067</code></a> Serialization: NullPointerException caused by <a href="https://github.com/Contextual"><code>@​Contextual</code></a> property with type with generic</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57730"><code>KT-57730</code></a> Serialization: &quot;IllegalStateException: Serializer for element of type <!-- raw HTML omitted -->.Foo has not been found&quot; caused by serialization of Java type</li>
</ul>
<h3>Tools. Gradle. JS</h3>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-57766"><code>KT-57766</code></a> KJS / Gradle &quot;Module not found: Error: Can't resolve 'kotlin-kotlin-stdlib-js-ir'&quot; when using &quot;useEsModules&quot;</li>
</ul>
<h3>Tools. Kapt</h3>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-58027"><code>KT-58027</code></a> Kotlin 1.8.20 kapt issue &quot;null: KtCallExpression: build()&quot;</li>
</ul>
<h3>Tools. Maven</h3>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-58048"><code>KT-58048</code></a> Maven: &quot;Too many source module declarations found&quot; after upgrading to 1.8.20</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-58101"><code>KT-58101</code></a> 'Unable to access class' in kotlin-maven-plugin after updating to Kotlin 1.8.20</li>
</ul>
<h2>1.8.20</h2>
<h3>Analysis API</h3>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-55510"><code>KT-55510</code></a> K2: Lost designation for local classes</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-55191"><code>KT-55191</code></a> AA: add an API to compare symbol pointers</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-55487"><code>KT-55487</code></a> K2: symbol pointer restoring doesn't work for static members</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-55336"><code>KT-55336</code></a> K2 IDE: &quot;java.lang.IllegalStateException: Required value was null.&quot; exception while importing a compiled JPS project</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-55098"><code>KT-55098</code></a> AA: KtDeclarationRenderer should render a context receivers</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-51181"><code>KT-51181</code></a> LL API: errors for SAM with suspend function from another module</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-50250"><code>KT-50250</code></a> Analysis API: Implement Analysis API of KtExpression.isUsedAsExpression</li>
<li><a href="https://youtrack.jetbrains.com/issue/KT-54360"><code>KT-54360</code></a> KtPropertySymbol: support JvmField in javaSetterName and javaGetterName</li>
</ul>
<h3>Analysis API. FE1.0</h3>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/KT-55825"><code>KT-55825</code></a> AA FE1.0: stackoverflow when resolution to a function with a recursive type parameter</li>
</ul>
<h3>Analysis API. FIR</h3>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="bcf27812cd"><code>bcf2781</code></a> Add ChangeLog for 1.9.0</li>
<li><a href="d372470550"><code>d372470</code></a> Don't get BuildScanExtension when buildScan report is disabled</li>
<li><a href="0ec76786a6"><code>0ec7678</code></a> [Gradle, JS] Return back deprecated methods for compatibility</li>
<li><a href="2427b51ba8"><code>2427b51</code></a> Relocate aalto-xml and stax2-api dependencies in embeddable compiler (KT-59631)</li>
<li><a href="56a7789f1d"><code>56a7789</code></a> Revert &quot;[Gradle] Fix invalidating iOS framework after import&quot;</li>
<li><a href="8cf1abc294"><code>8cf1abc</code></a> Add the possibility to omit explicitly specifying a version in annotationProc...</li>
<li><a href="4823fc3c64"><code>4823fc3</code></a> [Gradle] GranularMetadataTransformation: Collect moduleIds in ProjectData for...</li>
<li><a href="0d1932eab6"><code>0d1932e</code></a> [Gradle] Implement Future&lt;T&gt;.map(transform)</li>
<li><a href="bbf64b14d7"><code>bbf64b1</code></a> [Gradle] Implement KT59446TransformationOnTransitiveJavaDependencyTest</li>
<li><a href="54b11e3a95"><code>54b11e3</code></a> [Gradle] KotlinPluginLifecycle: Implement .toString for better diagnostics</li>
<li>Additional commits viewable in <a href="https://github.com/JetBrains/kotlin/compare/v1.8.22...v1.9.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.jetbrains.kotlin:kotlin-reflect&package-manager=gradle&previous-version=1.8.22&new-version=1.9.0)](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/4965

Reviewed By: aigoncharov

Differential Revision: D47755886

Pulled By: passy

fbshipit-source-id: 6b253ac55c5177ef58702adb89ee4ebc2b4bea92
2023-07-25 09:10:38 -07:00
Pascal Hartig
6048f09fd0 Update copyright headers for jetpack-compose
Reviewed By: lawrencelomax

Differential Revision: D47664798

fbshipit-source-id: 1dfd69e7e821fb2640cfb2fd6f481942d59a8162
2023-07-24 04:40:53 -07:00
Lorenzo Blasa
07292f837d Clear event handler after error or close
Summary:
Previous approach was a bit flawed as the `isOpen()` API returns true by the time close is called.

This was OK in the case of errors, as the open flag was set to false hence preventing us to report a close after the error. It is not OK on healthy disconnect situations as these events were not getting reported.

In this case, a better solution is just to clear the event handler after a close or error because in either case we are no longer interested in dispatching any other events to the handler.

Reviewed By: antonk52

Differential Revision: D47510883

fbshipit-source-id: 883a3f87f24f71fe44a624590a310fe2563cbd8a
2023-07-17 06:54:35 -07:00
Luke De Feo
20d7b57dbe Fix KState extraction
Summary:
The field changed from mStates to states breaking our reflection based code. Ideally I would like to just check if type == KStateContainer and access the field normally but the rest of the infrastructure expect to work on a java field.

Added tests to catch this sort of thing in the future. had to shift buck files around a bit to get it to work

Reviewed By: antonk52

Differential Revision: D46974357

fbshipit-source-id: 87a6f5883b33e4d1a7359df5987fc7ead7c19033
2023-07-03 12:19:26 -07:00
Lorenzo Blasa
e42db220ee Socket connect no longer synchronous and blocking
Summary:
Never really liked this code. Before this change, calls to connect were blocking.

Because of this, we had to make use of promises and a bit of really not that good-looking code.

So, this change makes connect non-blocking meaning that we make full use of our event handler.

These changes contain:
- CSR is not getting generated after each failed attempt.
- Connect is no longer blocking.
- Do not report events via the handler when explicitly disconnecting.

Reviewed By: jknoxville

Differential Revision: D46853228

fbshipit-source-id: 00e6a9c7c039a756175fe14982959e078d92bacb
2023-06-28 12:09:58 -07:00
Alexander Oprisnik
79e3abf6eb Migrate Flipper samples to use Fresco Vito (#4861)
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/4861

Reviewed By: steelrooter

Differential Revision: D46149846

fbshipit-source-id: 3b2a89da2a4e5ea2ee325e035e793ee18c5ce86d
2023-06-27 09:28:59 -07:00
Facebook Community Bot
23a934a47c Re-sync with internal repository 2023-06-26 10:17:06 -07:00
Pascal Hartig
820cf6a75e Add jetpack compose to sample app
Summary: Add an entry to the sample app to showcase Jetpack compose support. Note that you need to enable View Attribute Debugging in the Android Debug settings for this to work.

Reviewed By: lblasa

Differential Revision: D46933645

fbshipit-source-id: fbe2ddd50ef0e7917ef873959db5b3f35b833cf0
2023-06-23 14:42:14 -07:00
Pascal Hartig
ad25c2468d Set up gradle project
Summary: Build the jetpack compose plugin with gradle and export it to Maven.

Reviewed By: lblasa

Differential Revision: D46932689

fbshipit-source-id: cca0468bae7e6a324430aab548613aa1fdb61bf2
2023-06-23 14:42:14 -07:00
Pascal Hartig
b35cbaae55 Export jetpack-compose code
Summary: Move the jetpack plugin to a location that will get exported to GitHub. It won't get built as part of Gradle just yet.

Reviewed By: lblasa

Differential Revision: D46932691

fbshipit-source-id: 5837bbb2f31aad4221ee745fd145b91b2783d7fe
2023-06-23 14:42:14 -07:00
Luke De Feo
35e2dd2e17 Use is connected flag to know to wrap bloks
Summary:
we need to wrap the bloks layout in a debug variet in order for flipper to work. See this diff for context D45605120

We are now using wether flipper is connected at all which is much more reliable.

Reviewed By: lblasa

Differential Revision: D46854921

fbshipit-source-id: 1b3baef2681ccce50fd452044cd3f740c256b0a9
2023-06-20 05:25:21 -07:00
Lorenzo Blasa
468b5510a8 New 'isConnected' API
Summary: Expose the newly created `isConnected` API to Android FlipperClient API.

Reviewed By: LukeDefeo

Differential Revision: D46841260

fbshipit-source-id: 1512e54d28779ef62423aa52727fed3a34d00333
2023-06-20 00:46:55 -07:00
Carmi Grushko
947f1932b5 Update ktfmt component on FBS:master
Differential Revision: D46802820

fbshipit-source-id: a2737658576bf86f431a7b355d853a529f6a2c34
2023-06-18 23:22:12 -07:00
Pascal Hartig
5441494376 Centralise and bump deps (#4759)
Summary:
[android][tutorial] Centralise and bump deps
Per title.

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

Test Plan:
As before.

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4759).
* __->__ https://github.com/facebook/flipper/issues/4759
* https://github.com/facebook/flipper/issues/4758
* https://github.com/facebook/flipper/issues/4757
* https://github.com/facebook/flipper/issues/4756
* https://github.com/facebook/flipper/issues/4755
* https://github.com/facebook/flipper/issues/4754
* https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* https://github.com/facebook/flipper/issues/4751

Reviewed By: ivanmisuno

Differential Revision: D46069041

Pulled By: passy

fbshipit-source-id: c970c57e72445faca92a0618ed612ec86eb9f970
2023-05-24 04:19:58 -07:00
Pascal Hartig
7a23d6ab20 Copy deprecation note (#4756)
Summary:
[android] Copy deprecation note
Ran the Kotlin migration process. They recommend we carry forwards these warnings.

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

Test Plan:
- CI

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4756).
* https://github.com/facebook/flipper/issues/4759
* https://github.com/facebook/flipper/issues/4758
* https://github.com/facebook/flipper/issues/4757
* __->__ https://github.com/facebook/flipper/issues/4756
* https://github.com/facebook/flipper/issues/4755
* https://github.com/facebook/flipper/issues/4754
* https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* https://github.com/facebook/flipper/issues/4751

Reviewed By: ivanmisuno

Differential Revision: D46068989

Pulled By: passy

fbshipit-source-id: 7011939d9a3970376348c5b03e2352719aff3948
2023-05-24 04:19:58 -07:00
Pascal Hartig
c3013ae57b Rename no-op package namespace (#4754)
Summary:
[android] Rename no-op package namespace
Shouldn't affect anything but otherwise you get a warning:

```
[:android] /Users/realpassy/Projects/java/flipper/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml Warning:
        Namespace 'com.facebook.flipper' used in: :android, com.facebook.flipper:flipper:0.182.0.
```

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

Test Plan:
CI
Build sample

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4754).
* https://github.com/facebook/flipper/issues/4759
* https://github.com/facebook/flipper/issues/4758
* https://github.com/facebook/flipper/issues/4757
* https://github.com/facebook/flipper/issues/4756
* https://github.com/facebook/flipper/issues/4755
* __->__ https://github.com/facebook/flipper/issues/4754
* https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* https://github.com/facebook/flipper/issues/4751

Reviewed By: ivanmisuno

Differential Revision: D46068943

Pulled By: passy

fbshipit-source-id: ac806cd1c8444875fe965c95095ba886592e72d0
2023-05-24 04:19:58 -07:00
Pascal Hartig
65f28ecdbe Upgrade Kotlin to 1.8.20 (#4753)
Summary:
[android] Upgrade Kotlin to 1.8.20
The additional source/target settings should hopefully no longer be necessary with
AGP 8.1:

https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support

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

Test Plan:
- CI
- Build sample app
- AS sync

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4753).
* https://github.com/facebook/flipper/issues/4759
* https://github.com/facebook/flipper/issues/4758
* https://github.com/facebook/flipper/issues/4757
* https://github.com/facebook/flipper/issues/4756
* https://github.com/facebook/flipper/issues/4755
* https://github.com/facebook/flipper/issues/4754
* __->__ https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* https://github.com/facebook/flipper/issues/4751

Reviewed By: ivanmisuno

Differential Revision: D46068906

Pulled By: passy

fbshipit-source-id: 93da60ebfe2ec590ef88ea1936fcfd5257699cc7
2023-05-23 10:16:38 -07:00
Pascal Hartig
4e0bbb62fe Upgrade gradle plugin (#4751)
Summary:
[android] Upgrade gradle project
Makes us compatible with Android Studio Flamingo and unlocks upgrades to Kotlin
(which we need to be in sync with fbsource).

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

Test Plan:
- ./gradlew :android:assembleDebug
- Android Studio Sync
- CI

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4751).
* https://github.com/facebook/flipper/issues/4759
* https://github.com/facebook/flipper/issues/4758
* https://github.com/facebook/flipper/issues/4757
* https://github.com/facebook/flipper/issues/4756
* https://github.com/facebook/flipper/issues/4755
* https://github.com/facebook/flipper/issues/4754
* https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* __->__ https://github.com/facebook/flipper/issues/4751

Reviewed By: aigoncharov

Differential Revision: D46068236

Pulled By: passy

fbshipit-source-id: 707422134b49c0d940b663f6f40937fe6561a038
2023-05-23 08:48:24 -07:00
Pascal Hartig
cd3cd44e98 Remove deprecated kotlin plugin (#4749)
Summary:
[android] Remove deprecated kotlin plugin
See https://goo.gle/kotlin-android-extensions-deprecation.

We don't seem to be making use of the extension.

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

Test Plan:
```
./gradlew :android:assembleDebug
```

CI

Task: T153938450

Reviewed By: antonk52

Differential Revision: D46066063

Pulled By: passy

fbshipit-source-id: 1ae58535ca408bf29c97d5a945013f968f5b47a2
2023-05-22 04:34:22 -07:00
Richard Zadorozny
03a5aaa3f7 Make sure FlipperSocketImpl always sets thread TrafficStats tag
Summary:
When looking at some of our logcats in logview, I noticed lots of StrictMode warnings related to a WebSocket not being tagged, and I figured out it was due to FlipperSocketImpl.

By making sure TrafficStats stats tag is set no matter if the SSL factory is used or not, it reduces the amount of StrictMode warnings we see.

Related diff: D38280819

Differential Revision: D46024367

fbshipit-source-id: 92a0bfcef8698a61ef9b27949a5bc0859e03448f
2023-05-19 17:41:14 -07:00
Nikita Lutsenko
b66bff3837 sonar | Replace global static variables within jni/sonar.cpp with local static.
Summary: Replacing global static varaibles with local static. No cost at startup time, and also fixes any potential static initialization order fiasco.

Differential Revision: D45900844

fbshipit-source-id: 4ff05cbefe2f0c00199f40b9127e28c355d1819e
2023-05-16 18:56:17 -07:00
Luke De Feo
23ebd8b865 Change logic for generating debug wrapper for nodes
Summary:
Previously we would only generate debug wrapper for render core layout result when uidebugger was currently connected.

This meant if you navigate to a bloks screen *before* having the ui debugger open at render time it would read ui debugger as disconnected since the ui debugger is not a background plugin. The result is the user would see the native nodes instead of the bound tree, it was extra confusing since the layout result was cached so going forward and back doesnt solve it.

The ideal solution would be to have a global flipper is connected on the client but this isnt available yet, lorenzo said he would work on it later.

As a work around we use the fact that the uidebugger has ever been connected in this session.

It can still be confusing since the initial load of a bloks screen migt not generate the debug nodes until you navigate to the plugin once. I will add a note to the docs so say that you need to have open the uidebugger once before nodes will appear

Reviewed By: mweststrate

Differential Revision: D45605120

fbshipit-source-id: 970943b9f8f98221b7fc5e20bb1caf18c2266474
2023-05-10 05:05:34 -07:00
Luke De Feo
70cdc9bedc Android start sending frame scan event instead of subtree update
Summary: Cosmetic change to make the events more inline with what they are

Reviewed By: lblasa

Differential Revision: D42999134

fbshipit-source-id: e026e38da7e50e8f5520271246f9627eb22e8965
2023-05-04 04:12:01 -07:00
Luke De Feo
98b94d62cf Add bloks integration infra + Layout result wrapper
Summary:
This adds the base infra for the UIDebugger bloks integration as well as an implementation for the Layout result wrapper for bloks. When theUIDebugger is connected we wrap the original layout result with a debug varient that delegates all methods to the original layout result but also provides access to the bloks model.

This allows the UIDebugger to inspect the Layout result and bloks model together

Reviewed By: pasqualeanatriello

Differential Revision: D43444444

fbshipit-source-id: ac531a0c7491c05db1d6f7671e3ab09c73c213b9
2023-05-03 07:51:29 -07:00
Lorenzo Blasa
8657bcba64 Report payload size
Summary: Android changes to send payload size

Reviewed By: passy

Differential Revision: D45121791

fbshipit-source-id: 2cdf8f7b8849bce06949d3f7db6bdc5674fe15b7
2023-04-21 04:09:23 -07:00
Luke De Feo
53aca9a661 Hidden attributes
Summary:
These are attributes that are:
1.  Not common across frameworks
2. Not in every node
3. Will not be visualised via inspectable attribute mechansism

Currently we will use them for bloks but they should be useful for other features down the road

Reviewed By: lblasa

Differential Revision: D45048025

fbshipit-source-id: c258d0a384a2b09abb642778e68da178899fa9eb
2023-04-18 08:01:50 -07:00
Luke De Feo
c2fc54057a Make metadata tags a map and rename to custom attributes
Summary: This will allow a lot more flexibility and will be essential for making bloks work

Reviewed By: lblasa

Differential Revision: D44871256

fbshipit-source-id: 59d9fdccea7b18406eac532080e80a69a251267b
2023-04-18 08:01:50 -07:00
Luke De Feo
eee74044ff Start sending parent id
Summary: Since subtree update is effectively a frame dump its a lot easier to send the parent ID. This will save having figure it out on the client which is somewhat expensive and is needed for bloks

Reviewed By: lblasa

Differential Revision: D45048023

fbshipit-source-id: 90c4888df063de0aa69c9b93c86d9891e30becbe
2023-04-18 08:01:50 -07:00
Razvan Racasanu
c3381a3c9f Add Flipper support for secondary processes
Summary: Allow callers to pass id, deviceName, processName, and packageName when initializing Flipper. Since these are used to create the connection id, callers can use these to configure Flipper to work for secondary processes.

Reviewed By: calebgomer

Differential Revision: D44719389

fbshipit-source-id: 3df6d47855c113f454f37031df32c4891626aa66
2023-04-07 12:58:52 -07:00
generatedunixname89002005232357
452154802f Revert D44566060: Multisect successfully blamed D44566060 for test or build failures
Summary:
This diff is reverting D44566060
D44566060: Add Flipper support for secondary processes in Messenger VR by rra has been identified to be causing the following test or build failures:

Tests affected:
- [//fbandroid/javatests/com/facebook/messenger:no_sonar_in_production - main](https://www.internalfb.com/intern/test/281474996792449/)

Here's the Multisect link:
https://www.internalfb.com/multisect/1809753
Here are the tasks that are relevant to this breakage:

We're generating a revert to back out the changes in this diff, please note the backout may land if someone accepts it.

If you believe this diff has been generated in error you may Commandeer and Abandon it.

Reviewed By: passy

Differential Revision: D44682510

fbshipit-source-id: c0ae489bc5ae22c5339edd2c8988126b0adedd7f
2023-04-05 10:15:57 -07:00
Razvan Racasanu
2c12166b54 Add Flipper support for secondary processes in Messenger VR
Summary: Allow callers to pass id, deviceName, processName, and packageName when initializing Flipper. Since these are used to create the connection id, callers can use these to configure Flipper to work for secondary processes.

Reviewed By: passy

Differential Revision: D44566060

fbshipit-source-id: 605264c230956f4c9643c95c610ec40d736547ac
2023-04-04 11:25:23 -07:00
Lorenzo Blasa
8f9bf978e1 Ignore OverlayHandlerView as active child
Summary:
On foldable devices, there's an issue whereas the topmost root view is of type `OverlayHandlerView`.

This doesn't seem to be related in any way to the running app's UI. Or at least is not something of interest when debugging the running app's UI (for example, ig4a).

This change effectively ignores the `OverlayHandlerView` instance as active child and instead returns the next to last root view.

Reviewed By: LukeDefeo

Differential Revision: D44579223

fbshipit-source-id: cea52289c5ba1e6a96817232ac54725b8d2f48d9
2023-03-31 10:11:06 -07:00
Ruslan Shestopalyuk
aa6f04815b Add option to allow debugging Android services as well (#4631)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/4631

In React Native for VR we use `FlipperUtils.shouldEnableFlipper()` to determine whether Flipper should be enabled for the given app build.

The problem is that some of our apps are legitimately running as services (e.g. `com.oculus.explore:explore`), so the check added inside Flipper in D5126205 which only enables Flipper for "main application's process".

This diff adds an ability to relax this requirement (as we do want to do it for the RN VR applications)

Reviewed By: passy

Differential Revision: D44511667

fbshipit-source-id: 673912b204391799a9e8821b737681d1f44bd6a8
2023-03-30 04:17:43 -07:00
Lorenzo Blasa
76bfd67cd9 PerformanceStatsEvent
Summary: ^

Reviewed By: aigoncharov

Differential Revision: D44062826

fbshipit-source-id: 3f66411a8648e635b75dfea29a6256e64cfbf5d5
2023-03-16 07:35:44 -07:00
Luke De Feo
914b32c383 Add framework event infra
Summary:
Added infra for collecting events from UI frameworks.
1. Framework event metadata captures all the static metadata around the event. This allows to us to not send the same metadata in every event as well as populate the monitoring drop down immediately. This is sent in init since this information is static
2. Framework event itself is quite bare at the moment. It will have thread and more attributes in the future

The UIdebugger litho support ulitity has been simplified now there are 3 extension points.

Context renamed to UIDContext since it is referenced in app initialisers where the android context is also imported and it create a naming collision

Reviewed By: lblasa

Differential Revision: D42606933

fbshipit-source-id: a419f3fd424c533d586813004c40b68feafd9a2e
2023-03-01 08:49:49 -08:00
Fabio Carballo
fa74ebba68 Restore TimeMachine in Flipper
Summary:
The goal is to restore the *TimeMachine* functionality in Flipper while the new UI Debugger is working in a revamped version. This version was previously removed in D42573698 (b31f8c8755).

This time machine functionality will only be available for *LithoView* that are backed by a *ComponentTree*.

Below you can find a high-level overview of the current schema:

{F884011465}

Reviewed By: LukeDefeo, adityasharat

Differential Revision: D43574130

fbshipit-source-id: fe9d661e5fcce9655e70be4785652e7048dade54
2023-02-27 12:19:37 -08:00
Lorenzo Blasa
b6f3be01f9 Remove client connection timeout
Summary: Having a timeout of 10 seconds can create a connection loop if Desktop is slow and doesn't provide a client certificate within the timeframe.

Reviewed By: antonk52

Differential Revision: D43405793

fbshipit-source-id: b1eebb4d2d66f02000f15a9889992ed0cc79bde2
2023-02-24 07:20:54 -08:00
Sachin Tewari
2e31247486 Move flipper-fresco-plugin to fresco's repo from flipper's repo (#4546)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/4546

Move flipper-fresco-plugin to fresco's repo from flipper's repo

Reviewed By: passy

Differential Revision: D43467895

fbshipit-source-id: efea88563cf931baf4bda0c8bbdfbe41d0f769c5
2023-02-23 04:44:41 -08:00
Luke De Feo
ec7bd16439 Fix bounds for android view
Summary: Fixes: https://fb.workplace.com/groups/443457641253219/permalink/522116393387343/

Reviewed By: richkzad

Differential Revision: D43313031

fbshipit-source-id: b1f97632131cb4e71323b2c3e8cd36dfe7b0f78e
2023-02-15 10:23:42 -08:00
Luke De Feo
9540ea579c Remove attributes from layout panel
Summary: The additional panel was confusing. We can add a search filter box later if needed

Reviewed By: lblasa

Differential Revision: D42801264

fbshipit-source-id: 4b2ecb44c5bc4751564a5cac3716f5af4a951f58
2023-01-27 04:39:43 -08:00
Luke De Feo
f996f90cf4 Fix Interactions with TreeObserver Manager moved to main thread
Reviewed By: lblasa

Differential Revision: D42608384

fbshipit-source-id: 20c074eeac1372405f44edc8eb8ab41cb7dd2be9
2023-01-25 04:47:11 -08:00
Luke De Feo
73afa391f8 Introduce shared throttle
Summary:
Even with batching, updates can get split in half due to fact that each litho view has its own independant throttle. Eventually they will drift and and a traversal will get scheduled past the current frame for some of the views. It results in artifacts in the visualiser and will make time travelling wonky
The

Reviewed By: lblasa

Differential Revision: D42606932

fbshipit-source-id: c4cdf729302a380928b4d8720a59d5f7f6ff645a
2023-01-25 04:47:11 -08:00
Luke De Feo
b5392fb818 Batch subtree updates sent on the same frame
Summary:
This is needed in preperation for the next diff where we will introduce an observer per litho view. Without batching we end up with really poor performance for a few reasons:
1. There are some operations on the desktop plugin that are o(nodes) so even sending small batches
2. Flipper isnt really a high performance message bus, it seems to prefer fewer larger messages
3. Queuing time on the client builds up as you spend more time waiting on the socket

In a future diff will address:
The name of subtree update event. It should probably be called something like FrameUpdate since they are always full frames
The performance monitoring, will more to timing methods and summing the result rather than the current appraoch of time markers

Reviewed By: lblasa

Differential Revision: D42453229

fbshipit-source-id: eda9830b4420e82874717cc69b241e1689f20029
2023-01-25 04:47:11 -08:00
Luke De Feo
3b65994ca6 Interactions with TreeObserverManager moved to main thread
Summary: Needed for next diff

Reviewed By: lblasa

Differential Revision: D42453228

fbshipit-source-id: 29e2655bf08376cd12a98ab61fe95b804b0c7ba1
2023-01-25 04:47:11 -08:00