-
Notifications
You must be signed in to change notification settings - Fork 26.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add editor links to RSC build error (#45179)
- Loading branch information
1 parent
43b6e08
commit 018208f
Showing
26 changed files
with
419 additions
and
220 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
35 changes: 35 additions & 0 deletions
35
.../next/src/client/components/react-dev-overlay/internal/components/Terminal/EditorLink.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,35 @@ | ||
import React from 'react' | ||
import { useOpenInEditor } from '../../helpers/use-open-in-editor' | ||
|
||
export function EditorLink({ file }: { file: string }) { | ||
const open = useOpenInEditor({ | ||
file, | ||
column: 1, | ||
lineNumber: 1, | ||
}) | ||
|
||
return ( | ||
<div | ||
data-with-open-in-editor-link | ||
tabIndex={10} | ||
role={'link'} | ||
onClick={open} | ||
title={'Click to open in your editor'} | ||
> | ||
{file} | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
stroke="currentColor" | ||
strokeWidth="2" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
> | ||
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path> | ||
<polyline points="15 3 21 3 21 9"></polyline> | ||
<line x1="10" y1="14" x2="21" y2="3"></line> | ||
</svg> | ||
</div> | ||
) | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../server-only-in-client/server-only-lib.js → .../server-only-in-client/server-only-lib.js
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import 'server-only' | ||
// import 'server-only' | ||
|
||
export default function ServerOnlyLib() { | ||
return 'server-only-lib' | ||
|
4 changes: 4 additions & 0 deletions
4
test/development/acceptance-app/fixtures/rsc-build-errors/app/editor-links/component.js
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,4 @@ | ||
// import { useState } from 'react' | ||
export default function Component() { | ||
return <div>Component</div> | ||
} |
5 changes: 5 additions & 0 deletions
5
test/development/acceptance-app/fixtures/rsc-build-errors/app/editor-links/page.js
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,5 @@ | ||
import Component from './component' | ||
|
||
export default function Page() { | ||
return <Component /> | ||
} |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../client-only-in-server/client-only-lib.js → .../client-only-in-server/client-only-lib.js
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import 'client-only' | ||
// import 'client-only' | ||
|
||
export default function ClientOnlyLib() { | ||
return 'client-only-lib' | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...pment/acceptance-app/fixtures/rsc-build-errors/app/server-with-errors/page-export/page.js
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,3 @@ | ||
export default function Page() { | ||
return <p>Page</p> | ||
} |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...dir/rsc-errors/app/swc/use-client/page.js → ...c-build-errors/app/swc/use-client/page.js
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// eslint-disable-next-line no-unused-vars | ||
import React from 'react' | ||
|
||
// 'use client' | ||
|
File renamed without changes.
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.