GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor[devtools/extension]: handle ports disconnection, instead of frequent reconnection by hoxyq · Pull Request #27336 · react/react

Conversation

@hoxyq

@hoxyq hoxyq commented Sep 5, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator
  • Instead of reconnecting ports from devtools page and proxy content script, now handling their disconnection properly
  • proxy.js is now dynamically registered as a content script, which loaded for each page. This will probably not work well for Firefox, since we are still on manifest v2, I will try to fix this in the next few PRs.
  • Handling the case when devtools page port was reconnected and bridge is still present. This could happen if user switches the tab and Chrome decides to kill service worker, devtools page port gets disconnected, and then user returns back to the tab. When port is reconnected, we check if bridge message listener is present, connecting them if so.
  • Added simple debounce when evaluating if page has react application running. We start this check in chrome.network.onNavigated listener, which is asynchronous. Also, this check itself is asynchronous, so previously we could mount React DevTools multiple times if navigates multiple times while chrome.devtools.inspectedWindow.eval (which is also asynchronous) can be executed. https://github.com/hoxyq/react/blob/00b7c4331819289548b40714aea12335368e10f4/packages/react-devtools-extensions/src/main/index.js#L575-L583
Screen.Recording.2023-09-05.at.15.48.23.mov

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Biki-das reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@hoxyq
hoxyq requested a review from gsathya September 5, 2023 14:43
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Sep 5, 2023
@hoxyq
refactor[devtools/extension]: handle ports disconnection, instead of …
93675f2
…frequent reconnections
@hoxyq
hoxyq force-pushed the devtools/refactor-ports-management branch from 00b7c43 to 93675f2 Compare September 5, 2023 14:51
@Biki-das

Biki-das commented Sep 5, 2023

Copy link
Copy Markdown
Contributor

@hoxyq awesome work!

hoxyq reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gsathya
gsathya approved these changes Sep 5, 2023
View reviewed changes
@hoxyq
hoxyq merged commit a27df56 into react:main Sep 5, 2023
@hoxyq
hoxyq deleted the devtools/refactor-ports-management branch September 5, 2023 17:41
@hoxyq hoxyq mentioned this pull request Sep 5, 2023
React DevTools 4.28.2 -> 4.28.3 #27337
Merged
hoxyq added a commit that referenced this pull request Sep 5, 2023
@hoxyq
React DevTools 4.28.2 -> 4.28.3 (#27337)
a374287
This is a patch version to fix some bugs in a previous internal release.
I am expecting this one also to be internal-only, need to make sure that
extension is stable in Chrome. Some changes and improvements are
expected for Firefox, though, before going public.

* refactor[devtools/extension]: handle ports disconnection, instead of
frequent reconnection ([hoxyq](https://github.com/hoxyq) in
[#27336](#27336))
* refactor[devtools/extension]: migrate from using setInterval for
polling if react is loaded ([hoxyq](https://github.com/hoxyq) in
[#27323](#27323))
* fix[devtools/extension]: fixed duplicating panels in firefox
([hoxyq](https://github.com/hoxyq) in
[#27320](#27320))
@hoxyq hoxyq mentioned this pull request Sep 13, 2023
fix[devtools/extension]: unregister dynamically injected content scripts instead of filtering #27369
Merged
@acdlite acdlite mentioned this pull request Sep 14, 2023
Update React from dd480ef92 to d6dcad6a8. vercel/next.js#55399
Merged
acdlite added a commit to acdlite/next.js that referenced this pull request Sep 14, 2023
@acdlite
Update React from dd480ef92 to d6dcad6a8.
7e8e320
React upstream changes:

- react/react#27374
- react/react#27369
- react/react#27372
- react/react#27371
- react/react#27370
- react/react#27321
- react/react#27368
- react/react#27367
- react/react#27366
- react/react#27360
- react/react#27361
- react/react#27357
- react/react#27359
- react/react#27358
- react/react#27330
- react/react#27347
- react/react#27307
- react/react#27346
- react/react#27342
- react/react#27340
- react/react#27328
- react/react#27327
- react/react#27325
- react/react#27337
- react/react#27336
- react/react#27323
- react/react#27320
- react/react#27317
- react/react#27318
- react/react#27316
- react/react#27313
- react/react#27309
- react/react#27302
- react/react#27297
- react/react#27295
- react/react#27305
- react/react#27215
- react/react#27304
- react/react#27067
- react/react#27179
- react/react#27278
- react/react#27277
- react/react#27282
- react/react#27230
- react/react#27260
- react/react#27270
- react/react#27273
- react/react#27268
- react/react#27269
kodiakhq Bot pushed a commit to vercel/next.js that referenced this pull request Sep 14, 2023
@acdlite
Update React from dd480ef92 to d6dcad6a8. (#55399)
6f2e9ae
### React upstream changes:

- react/react#27374
- react/react#27369
- react/react#27372
- react/react#27371
- react/react#27370
- react/react#27321
- react/react#27368
- react/react#27367
- react/react#27366
- react/react#27360
- react/react#27361
- react/react#27357
- react/react#27359
- react/react#27358
- react/react#27330
- react/react#27347
- react/react#27307
- react/react#27346
- react/react#27342
- react/react#27340
- react/react#27328
- react/react#27327
- react/react#27325
- react/react#27337
- react/react#27336
- react/react#27323
- react/react#27320
- react/react#27317
- react/react#27318
- react/react#27316
- react/react#27313
- react/react#27309
- react/react#27302
- react/react#27297
- react/react#27295
- react/react#27305
- react/react#27215
- react/react#27304
- react/react#27067
- react/react#27179
- react/react#27278
- react/react#27277
- react/react#27282
- react/react#27230
- react/react#27260
- react/react#27270
- react/react#27273
- react/react#27268
- react/react#27269
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@hoxyq @AndyPengc12
refactor[devtools/extension]: handle ports disconnection, instead of …
ece2047
…frequent reconnection (react#27336)

- Instead of reconnecting ports from devtools page and proxy content
script, now handling their disconnection properly
- `proxy.js` is now dynamically registered as a content script, which
loaded for each page. This will probably not work well for Firefox,
since we are still on manifest v2, I will try to fix this in the next
few PRs.
- Handling the case when devtools page port was reconnected and bridge
is still present. This could happen if user switches the tab and Chrome
decides to kill service worker, devtools page port gets disconnected,
and then user returns back to the tab. When port is reconnected, we
check if bridge message listener is present, connecting them if so.
- Added simple debounce when evaluating if page has react application
running. We start this check in `chrome.network.onNavigated` listener,
which is asynchronous. Also, this check itself is asynchronous, so
previously we could mount React DevTools multiple times if navigates
multiple times while `chrome.devtools.inspectedWindow.eval` (which is
also asynchronous) can be executed.
https://github.com/hoxyq/react/blob/00b7c4331819289548b40714aea12335368e10f4/packages/react-devtools-extensions/src/main/index.js#L575-L583



https://github.com/facebook/react/assets/28902667/9d519a77-145e-413c-b142-b5063223d073
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@hoxyq @AndyPengc12
React DevTools 4.28.2 -> 4.28.3 (react#27337)
786ced6
This is a patch version to fix some bugs in a previous internal release.
I am expecting this one also to be internal-only, need to make sure that
extension is stable in Chrome. Some changes and improvements are
expected for Firefox, though, before going public.

* refactor[devtools/extension]: handle ports disconnection, instead of
frequent reconnection ([hoxyq](https://github.com/hoxyq) in
[react#27336](react#27336))
* refactor[devtools/extension]: migrate from using setInterval for
polling if react is loaded ([hoxyq](https://github.com/hoxyq) in
[react#27323](react#27323))
* fix[devtools/extension]: fixed duplicating panels in firefox
([hoxyq](https://github.com/hoxyq) in
[react#27320](react#27320))
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
@hoxyq
refactor[devtools/extension]: handle ports disconnection, instead of …
3e339be
…frequent reconnection (#27336)

- Instead of reconnecting ports from devtools page and proxy content
script, now handling their disconnection properly
- `proxy.js` is now dynamically registered as a content script, which
loaded for each page. This will probably not work well for Firefox,
since we are still on manifest v2, I will try to fix this in the next
few PRs.
- Handling the case when devtools page port was reconnected and bridge
is still present. This could happen if user switches the tab and Chrome
decides to kill service worker, devtools page port gets disconnected,
and then user returns back to the tab. When port is reconnected, we
check if bridge message listener is present, connecting them if so.
- Added simple debounce when evaluating if page has react application
running. We start this check in `chrome.network.onNavigated` listener,
which is asynchronous. Also, this check itself is asynchronous, so
previously we could mount React DevTools multiple times if navigates
multiple times while `chrome.devtools.inspectedWindow.eval` (which is
also asynchronous) can be executed.
https://github.com/hoxyq/react/blob/00b7c4331819289548b40714aea12335368e10f4/packages/react-devtools-extensions/src/main/index.js#L575-L583

https://github.com/facebook/react/assets/28902667/9d519a77-145e-413c-b142-b5063223d073

DiffTrain build for commit a27df56.
Akshato07 pushed a commit to Akshato07/-Luffy that referenced this pull request Feb 20, 2025
@hoxyq
React DevTools 4.28.2 -> 4.28.3 (#27337)
e497667
This is a patch version to fix some bugs in a previous internal release.
I am expecting this one also to be internal-only, need to make sure that
extension is stable in Chrome. Some changes and improvements are
expected for Firefox, though, before going public.

* refactor[devtools/extension]: handle ports disconnection, instead of
frequent reconnection ([hoxyq](https://github.com/hoxyq) in
[#27336](react/react#27336))
* refactor[devtools/extension]: migrate from using setInterval for
polling if react is loaded ([hoxyq](https://github.com/hoxyq) in
[#27323](react/react#27323))
* fix[devtools/extension]: fixed duplicating panels in firefox
([hoxyq](https://github.com/hoxyq) in
[#27320](react/react#27320))

DiffTrain build for commit react/react@a374287.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@hoxyq
refactor[devtools/extension]: handle ports disconnection, instead of …
57cf9bc
…frequent reconnection (react#27336)

- Instead of reconnecting ports from devtools page and proxy content
script, now handling their disconnection properly
- `proxy.js` is now dynamically registered as a content script, which
loaded for each page. This will probably not work well for Firefox,
since we are still on manifest v2, I will try to fix this in the next
few PRs.
- Handling the case when devtools page port was reconnected and bridge
is still present. This could happen if user switches the tab and Chrome
decides to kill service worker, devtools page port gets disconnected,
and then user returns back to the tab. When port is reconnected, we
check if bridge message listener is present, connecting them if so.
- Added simple debounce when evaluating if page has react application
running. We start this check in `chrome.network.onNavigated` listener,
which is asynchronous. Also, this check itself is asynchronous, so
previously we could mount React DevTools multiple times if navigates
multiple times while `chrome.devtools.inspectedWindow.eval` (which is
also asynchronous) can be executed.
https://github.com/hoxyq/react/blob/00b7c4331819289548b40714aea12335368e10f4/packages/react-devtools-extensions/src/main/index.js#L575-L583



https://github.com/facebook/react/assets/28902667/9d519a77-145e-413c-b142-b5063223d073
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@hoxyq
React DevTools 4.28.2 -> 4.28.3 (react#27337)
b26af76
This is a patch version to fix some bugs in a previous internal release.
I am expecting this one also to be internal-only, need to make sure that
extension is stable in Chrome. Some changes and improvements are
expected for Firefox, though, before going public.

* refactor[devtools/extension]: handle ports disconnection, instead of
frequent reconnection ([hoxyq](https://github.com/hoxyq) in
[react#27336](react#27336))
* refactor[devtools/extension]: migrate from using setInterval for
polling if react is loaded ([hoxyq](https://github.com/hoxyq) in
[react#27323](react#27323))
* fix[devtools/extension]: fixed duplicating panels in firefox
([hoxyq](https://github.com/hoxyq) in
[react#27320](react#27320))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@gsathya gsathya gsathya approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@hoxyq @Biki-das @gsathya @facebook-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.