GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — DevTools: Read context values from context dependencies by eps1lon · Pull Request #28467 · react/react Conversation
|
|
Comparing: 0ae2b13...088fb2c Critical size changesIncludes critical production bundles, as well as any change greater than 2%: Significant size changesIncludes any change greater than 0.2%: Expand to show
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| if (currentFiber === null) { | ||
| // Hook inspection without access to the Fiber tree. | ||
| return context._currentValue; |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is only for ReactDebugTools.inspectHooks where we don't have access to the current fiber (we have tests that would break if we throw just because currentContextDependency is null).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… when not having access to the Fiber tree
Neither writing primitive stack cache nor `ReactDebugTools.inspectHooks()` have access to the fiber tree.
583e634 to
0775186
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good from the DevTools side, but maybe also worth waiting for a review from @sebmarkbage
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Needs to be adjusted to work for React 16.8. Currently throws with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
11d346a to
ccf1548
Compare
ccf1548 to
0df1e46
Compare
…izedValue` I considered polyfilling `memoizedValue` but it seems safer to call this out when we read the context value. And also to avoid deopts due to using expando properties on the ContextDependency type in old versions.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Can you try using @reactVersion pragma for some tests in react-debug-tools?
If yes, then you can try adding test cases that will cover compatibility with previous versions of React?
This is how we run these tests on CI:
https://github.com/facebook/react/blob/a870b2d5494351d75b68c3d9baf03a52fd40a8ef/.circleci/config.yml#L296-L309
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Problem is that the inspectedElement-test is broken. I quickly looked at it and as far as I can tell, the whole test setup is broken. It uses the specified React versions for both the inspected tree and what Devtools uses. But Devtools uses its bundled React version so the test should ensure that Devtools uses the React version from the repo, while the inspected React tree uses the specified version. Since the test setup uses the specified React version for both, the test crashes since Devtools uses newer React features from the experimental release channel (e.g. We also already have tests for context inspection. They just don't run in the first place: https://github.com/facebook/react/blob/a870b2d5494351d75b68c3d9baf03a52fd40a8ef/packages/react-devtools-shared/src/__tests__/inspectedElement-test.js#L1654-L1656 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- react/react#28596 - react/react#28625 - react/react#28616 - react/react#28491 - react/react#28583 - react/react#28427 - react/react#28613 - react/react#28599 - react/react#28611 - react/react#28610 - react/react#28606 - react/react#28598 - react/react#28549 - react/react#28557 - react/react#28467 - react/react#28591 - react/react#28459 - react/react#28590 - react/react#28564 - react/react#28582 - react/react#28579 - react/react#28578 - react/react#28521 - react/react#28550 - react/react#28576 - react/react#28577 - react/react#28571 - react/react#28572 - react/react#28560 - react/react#28569 - react/react#28573 - react/react#28546 - react/react#28568 - react/react#28562 - react/react#28566 - react/react#28565 - react/react#28559 - react/react#28508 - react/react#20432 - react/react#28555 - react/react#24730 - react/react#28472 - react/react#27991 - react/react#28514 - react/react#28548 - react/react#28526 - react/react#28515 - react/react#28533 - react/react#28532 - react/react#28531 - react/react#28407 - react/react#28522 - react/react#28538 - react/react#28509 - react/react#28534 - react/react#28527 - react/react#28528 - react/react#28519 - react/react#28411 - react/react#28520 - react/react#28518 - react/react#28493 - react/react#28504 - react/react#28499 - react/react#28501 - react/react#28496 - react/react#28471 - react/react#28351 - react/react#28486 - react/react#28490 - react/react#28488 - react/react#28468 - react/react#28321 - react/react#28477 - react/react#28479 - react/react#28480 - react/react#28478 - react/react#28464 - react/react#28475 - react/react#28456 - react/react#28319 - react/react#28345 - react/react#28337 - react/react#28335 - react/react#28466 - react/react#28462 - react/react#28322 - react/react#28444 - react/react#28448 - react/react#28449 - react/react#28446 - react/react#28447 - react/react#24580
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.