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
c2541e2f
Unverified
Commit
c2541e2f
authored
Oct 26, 2021
by
Jiachi Liu
Committed by
GitHub
Oct 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flight loader parsing (#30345)
parent
4c83292a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
3 deletions
+14
-3
next-flight-client-loader.ts
...s/next/build/webpack/loaders/next-flight-client-loader.ts
+1
-1
foo.client.js
.../integration/react-rsc-basic/app/components/foo.client.js
+3
-0
index.server.js
test/integration/react-rsc-basic/app/pages/index.server.js
+8
-1
index.test.js
test/integration/react-rsc-basic/test/index.test.js
+2
-1
No files found.
packages/next/build/webpack/loaders/next-flight-client-loader.ts
View file @
c2541e2f
...
@@ -122,7 +122,7 @@ async function parseExportNamesInto(
...
@@ -122,7 +122,7 @@ async function parseExportNamesInto(
}
}
continue
continue
default
:
default
:
return
break
}
}
}
}
}
}
...
...
test/integration/react-rsc-basic/app/components/foo.client.js
0 → 100644
View file @
c2541e2f
export
default
function
foo
()
{
return
'foo.client'
}
test/integration/react-rsc-basic/app/pages/index.server.js
View file @
c2541e2f
import
Foo
from
'../components/foo.client'
export
default
function
Index
()
{
export
default
function
Index
()
{
return
'thisistheindexpage'
return
(
<
div
>
<
h1
>
{
`thisistheindexpage.server`
}
<
/h1
>
<
Foo
/>
<
/div
>
)
}
}
test/integration/react-rsc-basic/test/index.test.js
View file @
c2541e2f
...
@@ -98,7 +98,8 @@ async function runTests(context) {
...
@@ -98,7 +98,8 @@ async function runTests(context) {
it
(
'should render the correct html'
,
async
()
=>
{
it
(
'should render the correct html'
,
async
()
=>
{
const
homeHTML
=
await
renderViaHTTP
(
context
.
appPort
,
'/'
)
const
homeHTML
=
await
renderViaHTTP
(
context
.
appPort
,
'/'
)
const
linkHTML
=
await
renderViaHTTP
(
context
.
appPort
,
'/next-api/link'
)
const
linkHTML
=
await
renderViaHTTP
(
context
.
appPort
,
'/next-api/link'
)
expect
(
homeHTML
).
toContain
(
'thisistheindexpage'
)
expect
(
homeHTML
).
toContain
(
'thisistheindexpage.server'
)
expect
(
homeHTML
).
toContain
(
'foo.client'
)
expect
(
linkHTML
).
toContain
(
'go home'
)
expect
(
linkHTML
).
toContain
(
'go home'
)
})
})
}
}
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