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 — Remove invokeGuardedCallback and replay trick by sebmarkbage · Pull Request #28515 · react/react

Remove invokeGuardedCallback and replay trick #28515

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.

Sign up for GitHub

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

Merged
sebmarkbage merged 4 commits into react:main from sebmarkbage:rminvokeguardedcallback
Mar 12, 2024

Uh oh!

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

Merged

Remove invokeGuardedCallback and replay trick #28515

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit Hold shift + click to select a range
6455dbc
Remove invokeGuardedCallback and replay trick
sebmarkbage Mar 7, 2024
944275e
Inline ReactErrorUtils
sebmarkbage Mar 10, 2024
aae244d
Print the error in DEV with addendum
sebmarkbage Mar 10, 2024
8ed9d7c
Rebase fix
sebmarkbage Mar 12, 2024
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

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

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

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

Diff view
Diff view
Next Next commit
Remove invokeGuardedCallback and replay trick
  • Loading branch information

Uh oh!

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

@sebmarkbage
sebmarkbage committed Mar 11, 2024
commit 6455dbc107d6692820814f77d24b0bf4748ed654

There are no files selected for viewing

5 changes: 0 additions & 5 deletions 5 fixtures/dom/src/toWarnDev.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ const util = require('util');
function shouldIgnoreConsoleError(format, args) {
if (__DEV__) {
if (typeof format === 'string') {
if (format.indexOf('Error: Uncaught [') === 0) {
// This looks like an uncaught error from invokeGuardedCallback() wrapper
// in development that is reported by jsdom. Ignore because it's noisy.
return true;
}
if (format.indexOf('The above error occurred') === 0) {
// This looks like an error addendum from ReactFiberErrorLogger.
// Ignore it too.
Expand Down
4 changes: 0 additions & 4 deletions 4 packages/react-cache/src/__tests__/ReactCacheOld-test.internal.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
let ReactCache;
let createResource;
let React;
let ReactFeatureFlags;
let ReactNoop;
let Scheduler;
let Suspense;
Expand All @@ -27,9 +26,6 @@ describe('ReactCache', () => {
beforeEach(() => {
jest.resetModules();

ReactFeatureFlags = require('shared/ReactFeatureFlags');

ReactFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
React = require('react');
Suspense = React.Suspense;
ReactCache = require('react-cache');
Expand Down
4 changes: 0 additions & 4 deletions 4 packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -870,15 +870,13 @@ describe('Timeline profiler', () => {
"--component-render-start-ErrorBoundary",
"--component-render-stop",
"--component-render-start-ExampleThatThrows",
"--component-render-start-ExampleThatThrows",
"--component-render-stop",
"--error-ExampleThatThrows-mount-Expected error",
"--render-stop",
"--render-start-32",
"--component-render-start-ErrorBoundary",
"--component-render-stop",
"--component-render-start-ExampleThatThrows",
"--component-render-start-ExampleThatThrows",
"--component-render-stop",
"--error-ExampleThatThrows-mount-Expected error",
"--render-stop",
Expand Down Expand Up @@ -2161,10 +2159,8 @@ describe('Timeline profiler', () => {
await waitForAll([
'ErrorBoundary render',
'ExampleThatThrows',
'ExampleThatThrows',
'ErrorBoundary render',
'ExampleThatThrows',
'ExampleThatThrows',
'ErrorBoundary fallback',
]);

Expand Down
22 changes: 10 additions & 12 deletions 22 packages/react-dom/src/__tests__/InvalidEventListeners-test.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('InvalidEventListeners', () => {
);
const node = container.firstChild;

spyOnProd(console, 'error');
console.error = jest.fn();

const uncaughtErrors = [];
function handleWindowError(e) {
Expand All @@ -70,18 +70,16 @@ describe('InvalidEventListeners', () => {
}),
);

if (!__DEV__) {
expect(console.error).toHaveBeenCalledTimes(1);
expect(console.error.mock.calls[0][0]).toEqual(
expect.objectContaining({
detail: expect.objectContaining({
message:
'Expected `onClick` listener to be a function, instead got a value of `string` type.',
}),
type: 'unhandled exception',
expect(console.error).toHaveBeenCalledTimes(1);
expect(console.error.mock.calls[0][0]).toEqual(
expect.objectContaining({
detail: expect.objectContaining({
message:
'Expected `onClick` listener to be a function, instead got a value of `string` type.',
}),
);
}
type: 'unhandled exception',
}),
);
});

it('should not prevent null listeners, at dispatch', async () => {
Expand Down
15 changes: 0 additions & 15 deletions 15 packages/react-dom/src/__tests__/ReactCompositeComponent-test.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1231,13 +1231,6 @@ describe('ReactCompositeComponent', () => {
});
}).toThrow();
}).toErrorDev([
// Expect two errors because invokeGuardedCallback will dispatch an error event,
// Causing the warning to be logged again.
'Warning: No `render` method found on the RenderTextInvalidConstructor instance: ' +
'did you accidentally return an object from the constructor?',
'Warning: No `render` method found on the RenderTextInvalidConstructor instance: ' +
'did you accidentally return an object from the constructor?',
// And then two more because we retry errors.
'Warning: No `render` method found on the RenderTextInvalidConstructor instance: ' +
'did you accidentally return an object from the constructor?',
'Warning: No `render` method found on the RenderTextInvalidConstructor instance: ' +
Expand Down Expand Up @@ -1278,14 +1271,6 @@ describe('ReactCompositeComponent', () => {
});
}).toThrow();
}).toErrorDev([
// Expect two errors because invokeGuardedCallback will dispatch an error event,
// Causing the warning to be logged again.
'Warning: No `render` method found on the RenderTestUndefinedRender instance: ' +
'you may have forgotten to define `render`.',
'Warning: No `render` method found on the RenderTestUndefinedRender instance: ' +
'you may have forgotten to define `render`.',

// And then two more because we retry errors.
'Warning: No `render` method found on the RenderTestUndefinedRender instance: ' +
'you may have forgotten to define `render`.',
'Warning: No `render` method found on the RenderTestUndefinedRender instance: ' +
Expand Down
Loading
Oops, something went wrong.

Uh oh!

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

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 01402809 — 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.