-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(logger): support for collecting debug informations when renderin…
…g failed (#4524) * feat(logger): support for collecting debug informations when rendering failed * chore: update * feat: add location information * fix: test * fix: test * fix: tests * fix: bug
- Loading branch information
Showing
15 changed files
with
184 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
packages/core/client/src/schema-component/antd/error-fallback/__tests__/components/basic.tsx
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
packages/core/client/src/schema-component/antd/error-fallback/__tests__/components/modal.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/core/client/src/schema-component/antd/error-fallback/demos/basic.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
import { ErrorBoundary } from 'react-error-boundary'; | ||
import { ErrorFallback } from '../ErrorFallback'; | ||
import { Plugin } from '@nocobase/client'; | ||
import { mockApp } from '@nocobase/client/demo-utils'; | ||
|
||
const App = () => { | ||
throw new Error('error message'); | ||
}; | ||
|
||
const Demo = () => { | ||
return ( | ||
<ErrorBoundary FallbackComponent={ErrorFallback} onError={console.error}> | ||
<App /> | ||
</ErrorBoundary> | ||
); | ||
}; | ||
|
||
class DemoPlugin extends Plugin { | ||
async load() { | ||
this.app.router.add('root', { path: '/', Component: Demo }); | ||
} | ||
} | ||
|
||
const app = mockApp({ plugins: [DemoPlugin] }); | ||
|
||
export default app.getRootComponent(); |
27 changes: 27 additions & 0 deletions
27
packages/core/client/src/schema-component/antd/error-fallback/demos/modal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
import { ErrorBoundary } from 'react-error-boundary'; | ||
import { ErrorFallback } from '../ErrorFallback'; | ||
import { mockApp } from '@nocobase/client/demo-utils'; | ||
import { Plugin } from '@nocobase/client'; | ||
|
||
const App = () => { | ||
throw new Error('error message'); | ||
}; | ||
|
||
const Demo = () => { | ||
return ( | ||
<ErrorBoundary FallbackComponent={ErrorFallback.Modal} onError={console.error}> | ||
<App /> | ||
</ErrorBoundary> | ||
); | ||
}; | ||
|
||
class DemoPlugin extends Plugin { | ||
async load() { | ||
this.app.router.add('root', { path: '/', Component: Demo }); | ||
} | ||
} | ||
|
||
const app = mockApp({ plugins: [DemoPlugin] }); | ||
|
||
export default app.getRootComponent(); |
26 changes: 0 additions & 26 deletions
26
packages/core/client/src/schema-component/antd/error-fallback/demos/new-demos/basic.tsx
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
packages/core/client/src/schema-component/antd/error-fallback/demos/new-demos/modal.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.