fix: upgrade chrome 120+, java 17 and gradlew 8#725
fix: upgrade chrome 120+, java 17 and gradlew 8#725leoleitemelo wants to merge 3 commits intofacebook:mainfrom
Conversation
|
Hi @leoleitemelo! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Pull Request: Chrome 120+ DevTools Protocol Compatibility Update
SUMMARY
This PR modernizes the Stetho debugging library to support Chrome 120+ DevTools by updating the Chrome DevTools Protocol to version 1.3, implementing required Browser and Target domains, and upgrading the testing infrastructure to use modern dependencies (Robolectric 4.x, Mockito 3.x). The changes ensure full compatibility with the latest Chrome DevTools while maintaining backward compatibility with existing functionality.
FILES MODIFIED
Protocol & Configuration
Core Library (stetho/)
OkHttp Integration (stetho-okhttp/)
OkHttp3 Integration (stetho-okhttp3/)
Test Files
KEY CHANGES
1. Chrome DevTools Protocol Update (v1.1 → v1.3)
2. New Protocol Domains Implementation
Browser Domain: Provides version information, browser-level operations, and command line access
getVersion(): Returns protocol version, product info, V8 versionclose(): Graceful browser close (minimal implementation)getCommandLine(): Returns command line argumentsTarget Domain: Enables multi-target debugging support
setDiscoverTargets(): Controls target discoverygetTargets(): Returns list of available debugging targetsattachToTarget(): Attaches to specific targetdetachFromTarget(): Detaches from target3. DevTools Frontend Integration
chrome-devtools-frontend.appspot.comtodevtools://devtools/bundled/inspector.html4. Testing Infrastructure Modernization
Robolectric: Upgraded from 2.4 to 4.9.2
emulateSdktosdkin @config annotationsMockito: Upgraded from 1.x to 3.12.4
mockStatic()for static mockingMatcherstoArgumentMatchersJUnit: Updated from 4.12 to 4.13.2
OkHttp3: Updated from 3.4.2 to 3.14.9
5. Build System Modernization
TECHNICAL DETAILS
New Classes
com.facebook.stetho.inspector.protocol.module.Browser
getVersion(),close(),getCommandLine()GetVersionResult,GetCommandLineResultcom.facebook.stetho.inspector.protocol.module.Target
setDiscoverTargets(),getTargets(),attachToTarget(),detachFromTarget()GetTargetsResult,TargetInfo,AttachToTargetResultModified Methods
Stetho.DefaultInspectorModulesBuilder.finish()
ChromeDiscoveryHandler
WEBKIT_REVconstanthandleVersion()to include V8 versionhandleList()to use modern DevTools frontend URLWebSocketHandler.isSupportableUpgradeRequest()
handleWebSocketExtensions()method for future extension supportTest Infrastructure Changes
--add-opensJVM arguments for Java 9+ reflection accessIMPACT
Compatibility
Breaking Changes
Dependencies Updated
Performance
Security
TESTING
Unit Tests Updated
Testing Performed
Recommended Testing
Integration Testing: Test with Chrome 120+ DevTools
Regression Testing: Verify existing functionality
Cross-Version Testing: Test with multiple Chrome versions
MIGRATION NOTES
For Developers Using Stetho
No action required - This update is fully backward compatible. Simply update your dependency version:
For Contributors/Maintainers
Java Version: Ensure Java 11+ for building (Java 9+ module system support)
Test Execution: Tests now require JVM args for reflection access (already configured in build.gradle)
Protocol Updates: Future protocol updates should use the new protocol.json format (v1.3)
Testing Framework: New tests should use:
@Config(sdk = XX)syntaxmockStatic()instead of PowerMockArgumentMatchersinstead ofMatchersBuild System: Publishing now uses Maven Publish plugin:
./gradlew publish # Publishes to configured Maven repositoryEnvironment Updates
NOTES
Ready for Review: This PR has been tested with Chrome 120+ and maintains full backward compatibility with existing Stetho functionality.