Skip to content

provide debug utilities for inspector via event communication #20580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

patricklx
Copy link
Contributor

@patricklx patricklx commented Nov 28, 2023

this would allow inspector to communicate with emberjs without relying on any globals like the define, require functions and without the barrel file.
it would be required for inspector to provide more functionality when using vite or also when building with embroider webpack and staticEmberSources=true

would also like to glimmerjs/glimmer-vm#1489
as part of this

emberjs/ember-inspector#2554

@kategengler
Copy link
Member

maybe @chancancode ?

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Jun 11, 2024

We now need this to proceed with emberjs/rfcs#1015

For the VM side of this, glimmerjs/glimmer-vm#1489, benchmarks are running, so we'll know if this is safe.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this implementation is good for now, but we'll need to change things later, because I think we want ember-source to push panels into the inspector somehow.

needs some planning there, but it'd be great if ember-source's part of the inspector could be tested within ember-source, and than the inspector slurps those up (automatic updates depending on ember-source version!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think pushing panels is not needed. more important would be to push a ember_debug directly from ember.js instead of having inspectors ember_debug try to support multiple versions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well the thinking here is that because ember.js is has more people working on it, it could be updated more easily than the inspector -- and then the inspector also doesn't need to maintain compatibility with everything going forward -- as it would be provided by ember-source

we should probs move to talking about this on the discord though -- lots of details to work through

we are saving pure values (string)
@patricklx patricklx changed the title proposal: provide debug utilities for inspector via event communication provide debug utilities for inspector via event communication Jun 11, 2024
@ef4
Copy link
Contributor

ef4 commented Jun 14, 2024

Are these things not already accessible via their existing private import paths?

@patricklx
Copy link
Contributor Author

Not with ember static source enabled. Then it's not accessible.

@patricklx
Copy link
Contributor Author

patricklx commented Jun 14, 2024

Biggest issue is the boot load event.
https://github.com/emberjs/ember.js/blob/main/packages/ember/barrel.ts#L749

And the whole ember source needs to be loaded before inspector can access it. (With AMD) There have been multiple issues around that in the past.

@patricklx
Copy link
Contributor Author

E.g. emberjs/ember-inspector#2051

As an example

Copy link

Development Assets

Diff

--- main/out.txt	2025-04-10 17:47:56.000000000 +0000
+++ pr/./pr-14704709762/out.txt	2025-04-28 09:37:40.000000000 +0000
@@ -1,6 +1,6 @@
- 2.2M └─┬ .
-1015K   ├─┬ @ember
- 205K   │ ├─┬ -internals
+ 2.3M └─┬ .
+1020K   ├─┬ @ember
+ 206K   │ ├─┬ -internals
   69K   │ │ ├─┬ views
   64K   │ │ │ └─┬ lib
   23K   │ │ │   ├── mixins
@@ -27,7 +27,7 @@
  4.1K   │ │ └── environment
  183K   │ ├─┬ routing
   28K   │ │ └── lib
- 149K   │ ├─┬ object
+ 150K   │ ├─┬ object
   66K   │ │ └─┬ lib
   62K   │ │   └── computed
  114K   │ ├─┬ template-compiler
@@ -37,7 +37,7 @@
  4.1K   │ │   └── -internal
   66K   │ ├─┬ application
  5.6K   │ │ └── lib
-  52K   │ ├─┬ debug
+  57K   │ ├─┬ debug
   21K   │ │ └── lib
   38K   │ ├─┬ array
  4.9K   │ │ └── lib
@@ -63,23 +63,23 @@
  4.2K   │ ├── deprecated-features
  4.1K   │ ├── template-factory
  4.1K   │ └── version
- 709K   ├── shared-chunks
- 384K   ├─┬ @glimmer
- 166K   │ ├── runtime
+ 898K   ├── shared-chunks
+ 203K   ├─┬ @glimmer
   60K   │ ├── opcode-compiler
   30K   │ ├── manager
-  22K   │ ├── validator
   14K   │ ├── program
   12K   │ ├── reference
   11K   │ ├── destroyable
-  10K   │ ├─┬ tracking
- 4.4K   │ │ └── primitives
   10K   │ ├── util
+ 8.9K   │ ├─┬ tracking
+ 4.5K   │ │ └── primitives
  8.1K   │ ├── node
  7.3K   │ ├── global-context
  6.4K   │ ├── wire-format
+ 5.5K   │ ├── runtime
  5.0K   │ ├── vm
  4.9K   │ ├── encoder
+ 4.7K   │ ├── validator
  4.6K   │ ├── owner
  4.1K   │ └── env
   60K   ├─┬ ember-testing

Details

This PRmain
Dev
 2.3M └─┬ .
1020K   ├─┬ @ember
 206K   │ ├─┬ -internals
  69K   │ │ ├─┬ views
  64K   │ │ │ └─┬ lib
  23K   │ │ │   ├── mixins
  22K   │ │ │   ├── system
  10K   │ │ │   ├── views
 4.3K   │ │ │   └── compat
  35K   │ │ ├─┬ runtime
  30K   │ │ │ └─┬ lib
  21K   │ │ │   ├── mixins
 5.7K   │ │ │   └── ext
  26K   │ │ ├─┬ meta
  21K   │ │ │ └── lib
  11K   │ │ ├── owner
 9.4K   │ │ ├── deprecations
 7.4K   │ │ ├── metal
 7.0K   │ │ ├── string
 5.1K   │ │ ├── glimmer
 4.9K   │ │ ├── utils
 4.9K   │ │ ├── routing
 4.5K   │ │ ├── error-handling
 4.5K   │ │ ├── utility-types
 4.2K   │ │ ├── container
 4.2K   │ │ ├── browser-environment
 4.1K   │ │ └── environment
 183K   │ ├─┬ routing
  28K   │ │ └── lib
 150K   │ ├─┬ object
  66K   │ │ └─┬ lib
  62K   │ │   └── computed
 114K   │ ├─┬ template-compiler
 109K   │ │ └─┬ lib
  20K   │ │   ├── plugins
 4.6K   │ │   ├── system
 4.1K   │ │   └── -internal
  66K   │ ├─┬ application
 5.6K   │ │ └── lib
  57K   │ ├─┬ debug
  21K   │ │ └── lib
  38K   │ ├─┬ array
 4.9K   │ │ └── lib
  31K   │ ├─┬ engine
 4.7K   │ │ └── lib
  27K   │ ├── runloop
  22K   │ ├─┬ utils
  18K   │ │ └── lib
  20K   │ ├── helper
  11K   │ ├── destroyable
 9.8K   │ ├── instrumentation
 9.4K   │ ├── controller
 7.4K   │ ├── service
 7.2K   │ ├── owner
 6.2K   │ ├── component
 5.6K   │ ├── canary-features
 5.5K   │ ├── modifier
 5.1K   │ ├── template-compilation
 5.0K   │ ├── enumerable
 5.0K   │ ├── test
 4.4K   │ ├── template
 4.4K   │ ├── renderer
 4.2K   │ ├── deprecated-features
 4.1K   │ ├── template-factory
 4.1K   │ └── version
 898K   ├── shared-chunks
 203K   ├─┬ @glimmer
  60K   │ ├── opcode-compiler
  30K   │ ├── manager
  14K   │ ├── program
  12K   │ ├── reference
  11K   │ ├── destroyable
  10K   │ ├── util
 8.9K   │ ├─┬ tracking
 4.5K   │ │ └── primitives
 8.1K   │ ├── node
 7.3K   │ ├── global-context
 6.4K   │ ├── wire-format
 5.5K   │ ├── runtime
 5.0K   │ ├── vm
 4.9K   │ ├── encoder
 4.7K   │ ├── validator
 4.6K   │ ├── owner
 4.1K   │ └── env
  60K   ├─┬ ember-testing
  56K   │ └─┬ lib
  14K   │   ├── test
  14K   │   ├── helpers
  10K   │   ├── ext
 6.5K   │   └── adapters
  31K   ├── backburner.js
  25K   ├── ember
  24K   ├── route-recognizer
  18K   ├─┬ @simple-dom
  14K   │ └── document
 9.2K   ├── dag-map
 4.3K   ├── rsvp
 4.3K   └── router_js
 2.2M └─┬ .
1015K   ├─┬ @ember
 205K   │ ├─┬ -internals
  69K   │ │ ├─┬ views
  64K   │ │ │ └─┬ lib
  23K   │ │ │   ├── mixins
  22K   │ │ │   ├── system
  10K   │ │ │   ├── views
 4.3K   │ │ │   └── compat
  35K   │ │ ├─┬ runtime
  30K   │ │ │ └─┬ lib
  21K   │ │ │   ├── mixins
 5.7K   │ │ │   └── ext
  26K   │ │ ├─┬ meta
  21K   │ │ │ └── lib
  11K   │ │ ├── owner
 9.4K   │ │ ├── deprecations
 7.4K   │ │ ├── metal
 7.0K   │ │ ├── string
 5.1K   │ │ ├── glimmer
 4.9K   │ │ ├── utils
 4.9K   │ │ ├── routing
 4.5K   │ │ ├── error-handling
 4.5K   │ │ ├── utility-types
 4.2K   │ │ ├── container
 4.2K   │ │ ├── browser-environment
 4.1K   │ │ └── environment
 183K   │ ├─┬ routing
  28K   │ │ └── lib
 149K   │ ├─┬ object
  66K   │ │ └─┬ lib
  62K   │ │   └── computed
 114K   │ ├─┬ template-compiler
 109K   │ │ └─┬ lib
  20K   │ │   ├── plugins
 4.6K   │ │   ├── system
 4.1K   │ │   └── -internal
  66K   │ ├─┬ application
 5.6K   │ │ └── lib
  52K   │ ├─┬ debug
  21K   │ │ └── lib
  38K   │ ├─┬ array
 4.9K   │ │ └── lib
  31K   │ ├─┬ engine
 4.7K   │ │ └── lib
  27K   │ ├── runloop
  22K   │ ├─┬ utils
  18K   │ │ └── lib
  20K   │ ├── helper
  11K   │ ├── destroyable
 9.8K   │ ├── instrumentation
 9.4K   │ ├── controller
 7.4K   │ ├── service
 7.2K   │ ├── owner
 6.2K   │ ├── component
 5.6K   │ ├── canary-features
 5.5K   │ ├── modifier
 5.1K   │ ├── template-compilation
 5.0K   │ ├── enumerable
 5.0K   │ ├── test
 4.4K   │ ├── template
 4.4K   │ ├── renderer
 4.2K   │ ├── deprecated-features
 4.1K   │ ├── template-factory
 4.1K   │ └── version
 709K   ├── shared-chunks
 384K   ├─┬ @glimmer
 166K   │ ├── runtime
  60K   │ ├── opcode-compiler
  30K   │ ├── manager
  22K   │ ├── validator
  14K   │ ├── program
  12K   │ ├── reference
  11K   │ ├── destroyable
  10K   │ ├─┬ tracking
 4.4K   │ │ └── primitives
  10K   │ ├── util
 8.1K   │ ├── node
 7.3K   │ ├── global-context
 6.4K   │ ├── wire-format
 5.0K   │ ├── vm
 4.9K   │ ├── encoder
 4.6K   │ ├── owner
 4.1K   │ └── env
  60K   ├─┬ ember-testing
  56K   │ └─┬ lib
  14K   │   ├── test
  14K   │   ├── helpers
  10K   │   ├── ext
 6.5K   │   └── adapters
  31K   ├── backburner.js
  25K   ├── ember
  24K   ├── route-recognizer
  18K   ├─┬ @simple-dom
  14K   │ └── document
 9.2K   ├── dag-map
 4.3K   ├── rsvp
 4.3K   └── router_js

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.

4 participants