Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
62b63098
Unverified
Commit
62b63098
authored
Jan 24, 2022
by
Jiachi Liu
Committed by
GitHub
Jan 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rsc export component name detection (#33608)
parent
0fb11839
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
next-flight-server-loader.ts
...s/next/build/webpack/loaders/next-flight-server-loader.ts
+7
-2
image.server.js
...-and-server-components/app/pages/next-api/image.server.js
+4
-1
No files found.
packages/next/build/webpack/loaders/next-flight-server-loader.ts
View file @
62b63098
...
@@ -43,7 +43,7 @@ async function parseImportsInfo(
...
@@ -43,7 +43,7 @@ async function parseImportsInfo(
let
transformedSource
=
''
let
transformedSource
=
''
let
lastIndex
=
0
let
lastIndex
=
0
let
defaultExportName
=
'RSComponent'
let
defaultExportName
=
'RSC
C
omponent'
for
(
let
i
=
0
;
i
<
body
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
body
.
length
;
i
++
)
{
const
node
=
body
[
i
]
const
node
=
body
[
i
]
...
@@ -89,7 +89,12 @@ async function parseImportsInfo(
...
@@ -89,7 +89,12 @@ async function parseImportsInfo(
continue
continue
}
}
case
'ExportDefaultDeclaration'
:
{
case
'ExportDefaultDeclaration'
:
{
defaultExportName
=
node
.
declaration
.
id
.
name
const
def
=
node
.
declaration
if
(
def
.
type
===
'Identifier'
)
{
defaultExportName
=
def
.
name
}
else
if
(
def
.
type
===
'FunctionDeclaration'
)
{
defaultExportName
=
def
.
id
.
name
}
break
break
}
}
default
:
default
:
...
...
test/integration/react-streaming-and-server-components/app/pages/next-api/image.server.js
View file @
62b63098
import
NextImage
from
'next/image'
import
NextImage
from
'next/image'
import
src
from
'../../public/test.jpg'
import
src
from
'../../public/test.jpg'
export
default
function
Image
()
{
// Keep arrow function to test rsc loaders
const
Page
=
()
=>
{
return
<
NextImage
src
=
{
src
}
/
>
return
<
NextImage
src
=
{
src
}
/
>
}
}
export
default
Page
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment