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.
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
Webpack 5 Upgrade #22267
Webpack 5 Upgrade #22267
Changes from 9 commits
d4126d7
22813af
f79e01d
1c2da66
b1b7622
5770b68
97686ff
d50af18
13f3bd6
3ab20d4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something about this change causes the following error to be thrown in the extension process:
Looking at the code in question, I see:
Seems like this is coming from an imported module?
Seems like the result of this error is that the named hooks feature does not work. (Clicking the little "🪄" button for an inspected element eventually times out whereas it used to work.)
To reproduce this problem, build the extension as described here and then open a website like Code Sandbox and try to inspect a component with hooks. (You can see the error thrown when the extension is initializing actually, by undocking the DevTools and opening a second level of DevTools to inspect the extension.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will look into this further
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇🏼♂️ Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
react-devtools-shell
test app is broken by this change. (I think actually it's thereact-devtools-inline
package that gets broken, but I'll explain that below.)Looks like the page is trying to request
/dist/devtools.js
and it's getting a 400 response. (Interestingly, the page is also requesting/devtools.js
and that's returning okay.)Editing the
index.html
file so the<script>
tag loads/devtools.js
instead (no/dist/...
) fixes the failed network requests, but still doesn't fix the broken shell.I see the following error in the console:
I also see a few (related?) warnings in the console when running the test shell:
Inspecting the imported module, it looks like there's an extra
backend
wrapper now, e.g.Whereas before it was:
This behavior can be reproduced by following the steps here:
https://github.com/facebook/react/blob/main/packages/react-devtools/CONTRIBUTING.md#option-1-fastest-using-the-test-shell
Then loading localhost:8080.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could work around this by updating the entrypoint files like so:
react-devtools-inline/backend.js
react-devtools-inline/frontend.js
But I don't know why this is necessary or (more importantly) what other places it might cause trouble.
Anyway, in the spirit of testing, I've made this change locally to see if things works otherwise– and it looks like the DevTools UI is not visible in the test shell (so something is still broken) and I see the following two errors in the console:
Here's my local changes when testing this (in case it helps you any):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I can fix the GET failures by modifying the following files:
But now for some reason the test app code loads 3 times in the page (so there's 3 duplicate copies) and DevTools UI is still not visible at all (though it's loading). It looks like the CSS/styles are weird somehow, because the DevTools UI is loading in the background (behind the duplicate copies of the app).
Digging in a little more, I see a lot of
<div>
elements in the root of the page (outside of the<iframe>
the test app is supposed to load into). Deleting them reveals the DevTools UI underneath, and it even mostly works, but there are a lot of "duplicate ID" errors in the console (presumably from the duplicate test apps) so...something wonky is still going on here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly related to the "3 copies of the app are on the page" thing I mentioned above– the console also shows 3 copies of these logs:
Spaces added by me to highlight the fact that– although the content of the logs is the same, the file locations are different. I think this suggests that Webpack is bundling things oddly?