Skip to content

fix(devtools): fix extension config name and VM service response parsing - #17

Merged
vietnguyentuan2019 merged 2 commits into
brewkits:mainfrom
DrkXo:fix/hyper-render-devtools
Oct 1, 2026
Merged

vietnguyentuan2019 merged 2 commits into
brewkits:mainfrom
DrkXo:fix/hyper-render-devtools

Conversation

@DrkXo

@DrkXo DrkXo commented Oct 1, 2026

Copy link
Copy Markdown
Contributor
  • Update extension/devtools/config.yaml name to hyper_render_devtools to match package name and pass DevTools validation.
  • Update devtools_ui _call to handle Map, String, or raw responses from VM service.
  • Rebuild extension web assets in extension/devtools/build.

DrkXo and others added 2 commits October 1, 2026 13:54
- Update extension/devtools/config.yaml name to hyper_render_devtools to match package name and pass DevTools validation.
- Update devtools_ui _call to handle Map, String, or raw responses from VM service.
- Rebuild extension web assets in extension/devtools/build.
Two bugs kept the DevTools extension from ever working:

- extension/devtools/config.yaml used the display name "HyperRender
  Inspector" as `name`; devtools_extensions requires the owning package
  name, so validation rejected the extension. Now hyper_render_devtools.
- devtools_ui _call read result.json['result'] as a JSON string, but
  vm_service already unwraps the JSON-RPC envelope: result.json IS the
  object the extension returned (e.g. {'renderers': [...]}). No payload
  has a 'result' key, so every call returned null and the panel always
  showed "Could not connect". Return result.json directly.

Verified against a live app via vm_service (listRenderers / getUdt /
getPerformance all return the payload unwrapped). Rebuilt
extension/devtools/build with Flutter 3.41.9 (flutter build web; the
devtools_extensions 0.2.2 build_and_copy passes the removed
--web-renderer flag). `devtools_extensions validate` passes. Adds a
test pinning config name == package name.

Builds on the first fix in this PR; replaces its prebuilt assets with a
maintainer rebuild and simplifies _call (the Map/String branches never ran).

Co-authored-by: DrkXo <chayantaposh@gmail.com>
@vietnguyentuan2019

Copy link
Copy Markdown
Contributor

Thank you @DrkXo — great catch, and a real one: the inspector had never been able to connect.

I verified both bugs against a live app:

  • config.yaml name must be the package name, or devtools_extensions validate rejects the extension.
  • vm_service already unwraps the JSON-RPC envelope, so result.json is the extension payload. None of the payloads has a result key, so _call always returned null.

I pushed one maintainer commit on top of yours:

  • _call now simply returns result.json (the String/Map branches never ran).
  • extension/devtools/build is a maintainer rebuild. We rebuild prebuilt web assets ourselves because they ship to pub.dev and can't be reviewed line by line — nothing personal.
  • I also added a test that pins the config name to the package name.

Squash-merging with you as author. It will ship in the next hyper_render_devtools release with credit in the CHANGELOG. Thanks again! 🙏

@vietnguyentuan2019
vietnguyentuan2019 merged commit 13d929f into brewkits:main Oct 1, 2026
@DrkXo

DrkXo commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Thank you! 🙏 really appreciate you taking the time to verify everything and clean this up.

I’m glad the issues were tracked down and fixed properly.

I’m currently working on a separate fork/branch for [Readaway], which needed a couple of core changes:

  • fix(core): use line top and height for highlight bounding boxes
  • fix(core): bridge inter-word gaps and preserve internal spaces in getBoxesForCharRange

I kept these changes separate for now since they were needed for my project. If you think they would be useful in hyper_render itself, I’d be happy to have them included in the original repository as well. Just let me know and I can get them over to you.

Thanks again for the review and for keeping the attribution/credit. Really appreciate it! 🙏

@vietnguyentuan2019

Copy link
Copy Markdown
Contributor

Thanks a lot for the kind words, and for the fixes in this PR! 🙏

Yes please, those 2 fixes would be useful upstream. Could you open a separate PR from the latest main (it has 1.10.0 now)? Only these commits + the test file:

Please leave out the devtools build files, they will conflict with the DevTools v2 we just merged.

Few small things before merge:

  • pass textScaler to the TextPainter, so highlight is not off when user changes system font size
  • doc comment still says "tight height", but we use line height now
  • add tests for white-space: pre and an inline image between 2 words (the 16px gap merge might join them)

Your authorship stays, of course. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants