Skip to content

Modify legacy registration mechanism#1375

Merged
jerelmiller merged 7 commits intomainfrom
jerel/register-legacy
May 22, 2024
Merged

Modify legacy registration mechanism#1375
jerelmiller merged 7 commits intomainfrom
jerel/register-legacy

Conversation

@jerelmiller
Copy link
Copy Markdown
Member

This is a precursor to some work I'm doing to make client discovery a bit less chaotic. Uses Object.defineProperty for the global property to monitor its setter and register the client with the devtools.

@jerelmiller jerelmiller requested a review from a team as a code owner May 17, 2024 23:40
@jerelmiller jerelmiller requested review from alessbell and phryneas May 17, 2024 23:40
Comment thread src/extension/tab/hook.ts
(preExisting as Array<ApolloClient<any>>).forEach(registerClient);
}

findClient();
Copy link
Copy Markdown
Member Author

@jerelmiller jerelmiller May 17, 2024

Choose a reason for hiding this comment

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

We no longer need this on initialization since we register the client immediately if its available, or registers it when the value is assigned from a legacy client.

@relativeci
Copy link
Copy Markdown

relativeci bot commented May 17, 2024

#409 Bundle Size — 1.26MiB (~+0.01%).

5040547(current) vs f6f500e main#394(baseline)

Warning

Bundle contains 12 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#409
     Baseline
#394
Regression  Initial JS 1.22MiB(~+0.01%) 1.22MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 1.13% 0%
No change  Chunks 5 5
No change  Assets 12 12
No change  Modules 940 940
No change  Duplicate Modules 45 45
No change  Duplicate Code 3.82% 3.82%
No change  Packages 160 160
No change  Duplicate Packages 9 9
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#409
     Baseline
#394
Regression  JS 1.22MiB (~+0.01%) 1.22MiB
No change  IMG 35.85KiB 35.85KiB
No change  HTML 810B 810B
No change  Other 778B 778B

Bundle analysis reportBranch jerel/register-legacyProject dashboard

@jerelmiller jerelmiller force-pushed the jerel/register-legacy branch from 8078164 to 0b39b19 Compare May 19, 2024 01:37
Comment thread src/extension/tab/hook.ts
};

window.addEventListener("load", () => {
if (hook.ApolloClient) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was almost never true, but with the changes in this PR, we don't need it anyways since we will register the client immediately if its available when this content script loads, or register it when the client is assigned on the window.

@jerelmiller jerelmiller merged commit 7267351 into main May 22, 2024
@jerelmiller jerelmiller deleted the jerel/register-legacy branch May 22, 2024 16:14
@github-actions github-actions bot mentioned this pull request May 22, 2024
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