Skip to content

Commit 06132be

Browse files
SaerisCompuIves
authored andcommitted
✨ Add URL to Crash Report, Add CodeSadbox route in Development (codesandbox#2376)
Updated the crash report template to include the current URL so as to make it easier to hunt down where crashes are occurring. Also updated the template copy to make it more explicit that the user should use the template to write up a crash report. When running the client locally, the `/codesadbox` route will now be available to make it easier to test changes to the error boundary components. This route is removed in production builds.
1 parent 7b22b2a commit 06132be

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

packages/app/src/app/pages/common/ErrorBoundary/CodeSadbox/CodeSadbox.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,3 @@ export const CodeSadbox = inject('store')(
6969
)
7070
)
7171
);
72-
73-
CodeSadbox.displayName = `CodeSadbox`;

packages/app/src/app/pages/common/ErrorBoundary/CodeSadbox/buildCrashReport.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ export const buildCrashReport = ({
1111
}: IbuildCrashReport): string => {
1212
const { name, version, os } = browser();
1313

14-
const title = `💥 Crash Report: <Short Description of Crash Circumstances>`;
14+
const title = `💥 Crash Report: <Please Add a Short Description of Crash Circumstances>`;
1515

1616
const body = `<h1>💥 Crash Report</h1>
1717
1818
<h2>What were you trying to accomplish when the crash occurred?</h2>
1919
20+
> Please use this issue template to describe what you were doing when you encountered this crash. While we are able to fill in some details automatically, it's not always enough to reproduce!
21+
2022
<h3>Link to sandbox: [link]() (optional)</h3>
2123
2224
<h3>Crash Details</h3>
@@ -28,6 +30,9 @@ export const buildCrashReport = ({
2830
| ------- | --------- | ---------------- |
2931
| ${name} | ${version} | ${os} |
3032
33+
**Route:**
34+
${window.location.href}
35+
3136
</details>
3237
3338
<details>

packages/app/src/app/pages/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const Patron = Loadable(() =>
4949
const Curator = Loadable(() =>
5050
import(/* webpackChunkName: 'page-curator' */ './Curator')
5151
);
52+
const CodeSadbox = () => this[`💥`].kaboom();
5253

5354
const Boundary = withRouter(ErrorBoundary);
5455

@@ -96,6 +97,9 @@ const RoutesComponent = ({ signals: { appUnmounted } }) => {
9697
<Route path="/patron" component={Patron} />
9798
<Route path="/cli/login" component={CLI} />
9899
<Route path="/auth/zeit" component={ZeitSignIn} />
100+
{process.env.NODE_ENV === `development` && (
101+
<Route path="/codesadbox" component={CodeSadbox} />
102+
)}
99103
<Route component={NotFound} />
100104
</Switch>
101105
</Content>

0 commit comments

Comments
 (0)