Skip to content
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

[WIP] add a memory panel #1288

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

[WIP] add a memory panel #1288

wants to merge 1 commit into from

Conversation

phryneas
Copy link
Member

No description provided.

Comment on lines +83 to +89
resolvers: {
Query: {
memoryInternals(): Promise<MemoryInternals | undefined> {
return rpc.request("getMemoryInternals");
},
},
},
Copy link
Member Author

@phryneas phryneas Mar 21, 2024

Choose a reason for hiding this comment

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

I don't know if this pattern is genius or incredibly stupid, but it might be very interesting in combination with pollInterval and remove a lot of our orchestration complexities.
@jerelmiller do you have an opinion on this?

Copy link
Member

Choose a reason for hiding this comment

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

I think this is totally fine! And agreed. The more I'm working with devtools, the more I think we can move some of the code in devtools.ts over to the React application, This falls in line with my thinking there so I dig it.

Copy link

relativeci bot commented Mar 21, 2024

Job #89: Bundle Size — 1.11MiB (+1.3%).

b7ba25d(current) vs 7d3d445 main#80(baseline)

Warning

Bundle contains 5 duplicate packages – View duplicate packages

Warning

Bundle introduced one new package: rehackt – View changed packages

Bundle metrics  Change 6 changes Regression 4 regressions
                 Current
Job #89
     Baseline
Job #80
Regression  Initial JS 1.07MiB(+1.35%) 1.06MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 94.33% 1.63%
No change  Chunks 5 5
No change  Assets 12 12
Change  Modules 518(+3.19%) 502
Regression  Duplicate Modules 47(+6.82%) 44
Regression  Duplicate Code 8.04%(+1.01%) 7.96%
Regression  Packages 61(+1.67%) 60
No change  Duplicate Packages 4 4
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #89
     Baseline
Job #80
Regression  JS 1.07MiB (+1.35%) 1.06MiB
Not changed  IMG 35.85KiB 35.85KiB
Not changed  HTML 810B 810B
Not changed  Other 777B 777B

View job #89 reportView pr/memory-panel branch activityView project dashboard

Comment on lines +137 to +143
unsubscribers.add(
createRPCBridge(
createPortMessageAdapter(port),
createWindowMessageAdapter(window)
)
);

Copy link
Member Author

Choose a reason for hiding this comment

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

Not 100% sure if this is the right place to create this bridge 😬

Copy link
Member

Choose a reason for hiding this comment

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

I would make two changes here:

  1. Move the createRPCBridge call inside the the if (!connectedToPanel) below.
  2. Remove the unsubscribers.add call around this

The reasoning here is that we still want to allow messages to travel between the background port and the panel window even when the panel is hidden (e.g. the user navigated away by clicked the "Elements" tab). I can think of some cases like opening the Apollo tab, then quickly switching away from it, but still allowing the injected script to report back whether it found a client or not (which will eventually be an RPC call as well). If we unsubscribe the bridge, any message that gets sent while the panel is hidden will be dropped.

The if (!connectedToPanel) should only ever execute the first time the panel is created, so we shouldn't have to worry about this script accidentally creating too many bridges.

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.

None yet

2 participants