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
b3e28cab
Unverified
Commit
b3e28cab
authored
Nov 21, 2023
by
Zack Tanner
Committed by
GitHub
Nov 21, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'canary' into revert-58669-seed-cachenodes-immediately
parents
3ff3cb34
34671167
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
219 additions
and
113 deletions
+219
-113
Cargo.lock
Cargo.lock
+33
-33
Cargo.toml
Cargo.toml
+3
-3
babel.rs
packages/next-swc/crates/next-core/src/babel.rs
+2
-0
next_config.rs
packages/next-swc/crates/next-core/src/next_config.rs
+4
-0
next_import_map.rs
packages/next-swc/crates/next-core/src/next_import_map.rs
+15
-2
context.rs
...ages/next-swc/crates/next-core/src/next_server/context.rs
+4
-0
resolve.rs
...ages/next-swc/crates/next-core/src/next_server/resolve.rs
+133
-64
resolve.rs
...ages/next-swc/crates/next-core/src/next_shared/resolve.rs
+6
-0
swc_ecma_transform_plugins.rs
.../src/next_shared/transforms/swc_ecma_transform_plugins.rs
+9
-3
package.json
packages/next/package.json
+1
-1
action-handler.ts
packages/next/src/server/app-render/action-handler.ts
+3
-2
require-hook.ts
packages/next/src/server/require-hook.ts
+1
-0
pnpm-lock.yaml
pnpm-lock.yaml
+5
-5
No files found.
Cargo.lock
View file @
b3e28cab
This diff is collapsed.
Click to expand it.
Cargo.toml
View file @
b3e28cab
...
...
@@ -43,11 +43,11 @@ next-transform-strip-page-exports = { path = "packages/next-swc/crates/next-tran
testing
=
{
version
=
"0.35.10"
}
# Turbo crates
turbopack-binding
=
{
git
=
"https://github.com/vercel/turbo.git"
,
tag
=
"turbopack-23112
0
.2"
}
turbopack-binding
=
{
git
=
"https://github.com/vercel/turbo.git"
,
tag
=
"turbopack-23112
1
.2"
}
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks
=
{
git
=
"https://github.com/vercel/turbo.git"
,
tag
=
"turbopack-23112
0
.2"
}
turbo-tasks
=
{
git
=
"https://github.com/vercel/turbo.git"
,
tag
=
"turbopack-23112
1
.2"
}
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs
=
{
git
=
"https://github.com/vercel/turbo.git"
,
tag
=
"turbopack-23112
0
.2"
}
turbo-tasks-fs
=
{
git
=
"https://github.com/vercel/turbo.git"
,
tag
=
"turbopack-23112
1
.2"
}
# General Deps
...
...
packages/next-swc/crates/next-core/src/babel.rs
View file @
b3e28cab
...
...
@@ -5,6 +5,7 @@ use turbopack_binding::{
turbopack
::{
core
::{
issue
::{
Issue
,
IssueExt
,
IssueSeverity
,
StyledString
},
reference_type
::{
CommonJsReferenceSubType
,
ReferenceType
},
resolve
::{
parse
::
Request
,
pattern
::
Pattern
,
resolve
},
},
node
::
transforms
::
webpack
::
WebpackLoaderItem
,
...
...
@@ -122,6 +123,7 @@ pub async fn maybe_add_babel_loader(
pub
async
fn
is_babel_loader_available
(
project_path
:
Vc
<
FileSystemPath
>
)
->
Result
<
Vc
<
bool
>>
{
let
result
=
resolve
(
project_path
,
Value
::
new
(
ReferenceType
::
CommonJs
(
CommonJsReferenceSubType
::
Undefined
)),
Request
::
parse
(
Value
::
new
(
Pattern
::
Constant
(
"babel-loader/package.json"
.to_string
(),
))),
...
...
packages/next-swc/crates/next-core/src/next_config.rs
View file @
b3e28cab
...
...
@@ -832,6 +832,10 @@ async fn load_next_config_and_custom_routes_internal(
import_map
.insert_exact_alias
(
"next"
,
ImportMapping
::
External
(
None
)
.into
());
import_map
.insert_wildcard_alias
(
"next/"
,
ImportMapping
::
External
(
None
)
.into
());
import_map
.insert_exact_alias
(
"styled-jsx"
,
ImportMapping
::
External
(
None
)
.into
());
import_map
.insert_exact_alias
(
"styled-jsx/style"
,
ImportMapping
::
External
(
Some
(
"styled-jsx/style.js"
.to_string
()))
.cell
(),
);
import_map
.insert_wildcard_alias
(
"styled-jsx/"
,
ImportMapping
::
External
(
None
)
.into
());
let
context
=
node_evaluate_asset_context
(
...
...
packages/next-swc/crates/next-core/src/next_import_map.rs
View file @
b3e28cab
...
...
@@ -7,6 +7,7 @@ use turbopack_binding::{
turbo
::
tasks_fs
::{
glob
::
Glob
,
FileSystem
,
FileSystemPath
},
turbopack
::{
core
::{
reference_type
::{
CommonJsReferenceSubType
,
ReferenceType
},
resolve
::{
options
::{
ConditionValue
,
ImportMap
,
ImportMapping
,
ResolveOptions
,
ResolvedMap
},
parse
::
Request
,
...
...
@@ -219,6 +220,10 @@ pub fn get_next_build_import_map() -> Vc<ImportMap> {
import_map
.insert_exact_alias
(
"next"
,
external
);
import_map
.insert_wildcard_alias
(
"next/"
,
external
);
import_map
.insert_exact_alias
(
"styled-jsx"
,
external
);
import_map
.insert_exact_alias
(
"styled-jsx/style"
,
ImportMapping
::
External
(
Some
(
"styled-jsx/style.js"
.to_string
()))
.cell
(),
);
import_map
.insert_wildcard_alias
(
"styled-jsx/"
,
external
);
import_map
.cell
()
...
...
@@ -293,6 +298,10 @@ pub async fn get_next_server_import_map(
import_map
.insert_exact_alias
(
"react-dom"
,
external
);
import_map
.insert_wildcard_alias
(
"react-dom/"
,
external
);
import_map
.insert_exact_alias
(
"styled-jsx"
,
external
);
import_map
.insert_exact_alias
(
"styled-jsx/style"
,
ImportMapping
::
External
(
Some
(
"styled-jsx/style.js"
.to_string
()))
.cell
(),
);
import_map
.insert_wildcard_alias
(
"styled-jsx/"
,
external
);
// TODO: we should not bundle next/dist/build/utils in the pages renderer at all
import_map
.insert_wildcard_alias
(
"next/dist/build/utils"
,
external
);
...
...
@@ -508,7 +517,7 @@ async fn insert_next_server_special_aliases(
"@opentelemetry/api"
,
// TODO(WEB-625) this actually need to prefer the local version of
// @opentelemetry/api
external_if_node
(
pages_dir
,
"next/dist/compiled/@opentelemetry/api"
),
external_if_node
(
pages_dir
,
"next/dist/compiled/@opentelemetry/api
/index.js
"
),
);
insert_alias_to_alternatives
(
import_map
,
...
...
@@ -544,7 +553,10 @@ async fn insert_next_server_special_aliases(
"@opentelemetry/api"
,
// TODO(WEB-625) this actually need to prefer the local version of
// @opentelemetry/api
request_to_import_mapping
(
app_dir
,
"next/dist/compiled/@opentelemetry/api"
),
request_to_import_mapping
(
app_dir
,
"next/dist/compiled/@opentelemetry/api/index.js"
,
),
);
import_map
.insert_exact_alias
(
"styled-jsx"
,
...
...
@@ -880,6 +892,7 @@ async fn package_lookup_resolve_options(
pub
async
fn
get_next_package
(
context_directory
:
Vc
<
FileSystemPath
>
)
->
Result
<
Vc
<
FileSystemPath
>>
{
let
result
=
resolve
(
context_directory
,
Value
::
new
(
ReferenceType
::
CommonJs
(
CommonJsReferenceSubType
::
Undefined
)),
Request
::
parse
(
Value
::
new
(
Pattern
::
Constant
(
"next/package.json"
.to_string
(),
))),
...
...
packages/next-swc/crates/next-core/src/next_server/context.rs
View file @
b3e28cab
...
...
@@ -126,6 +126,8 @@ pub async fn get_server_resolve_options_context(
project_path
,
project_path
.root
(),
ExternalPredicate
::
Only
(
Vc
::
cell
(
external_packages
))
.cell
(),
// TODO(sokra) esmExternals support
false
,
);
let
ty
=
ty
.into_value
();
...
...
@@ -144,6 +146,8 @@ pub async fn get_server_resolve_options_context(
project_path
,
project_path
.root
(),
ExternalPredicate
::
AllExcept
(
next_config
.transpile_packages
())
.cell
(),
// TODO(sokra) esmExternals support
false
,
);
let
next_external_plugin
=
NextExternalResolvePlugin
::
new
(
project_path
);
...
...
packages/next-swc/crates/next-core/src/next_server/resolve.rs
View file @
b3e28cab
This diff is collapsed.
Click to expand it.
packages/next-swc/crates/next-core/src/next_shared/resolve.rs
View file @
b3e28cab
...
...
@@ -10,6 +10,7 @@ use turbopack_binding::{
diagnostics
::
DiagnosticExt
,
file_source
::
FileSource
,
issue
::{
unsupported_module
::
UnsupportedModuleIssue
,
IssueExt
},
reference_type
::
ReferenceType
,
resolve
::{
parse
::
Request
,
pattern
::
Pattern
,
...
...
@@ -67,6 +68,7 @@ impl ResolvePlugin for UnsupportedModulesResolvePlugin {
&
self
,
_fs_path
:
Vc
<
FileSystemPath
>
,
file_path
:
Vc
<
FileSystemPath
>
,
_reference_type
:
Value
<
ReferenceType
>
,
request
:
Vc
<
Request
>
,
)
->
Result
<
Vc
<
ResolveResultOption
>>
{
if
let
Request
::
Module
{
...
...
@@ -131,6 +133,7 @@ impl ResolvePlugin for NextExternalResolvePlugin {
&
self
,
fs_path
:
Vc
<
FileSystemPath
>
,
_context
:
Vc
<
FileSystemPath
>
,
_reference_type
:
Value
<
ReferenceType
>
,
_request
:
Vc
<
Request
>
,
)
->
Result
<
Vc
<
ResolveResultOption
>>
{
let
raw_fs_path
=
&*
fs_path
.await
?
;
...
...
@@ -179,6 +182,7 @@ impl ResolvePlugin for NextNodeSharedRuntimeResolvePlugin {
&
self
,
fs_path
:
Vc
<
FileSystemPath
>
,
_context
:
Vc
<
FileSystemPath
>
,
_reference_type
:
Value
<
ReferenceType
>
,
_request
:
Vc
<
Request
>
,
)
->
Result
<
Vc
<
ResolveResultOption
>>
{
let
stem
=
fs_path
.file_stem
()
.await
?
;
...
...
@@ -240,6 +244,7 @@ impl ResolvePlugin for ModuleFeatureReportResolvePlugin {
&
self
,
_fs_path
:
Vc
<
FileSystemPath
>
,
_context
:
Vc
<
FileSystemPath
>
,
_reference_type
:
Value
<
ReferenceType
>
,
request
:
Vc
<
Request
>
,
)
->
Result
<
Vc
<
ResolveResultOption
>>
{
if
let
Request
::
Module
{
...
...
@@ -294,6 +299,7 @@ impl ResolvePlugin for NextSharedRuntimeResolvePlugin {
&
self
,
fs_path
:
Vc
<
FileSystemPath
>
,
_context
:
Vc
<
FileSystemPath
>
,
_reference_type
:
Value
<
ReferenceType
>
,
_request
:
Vc
<
Request
>
,
)
->
Result
<
Vc
<
ResolveResultOption
>>
{
let
raw_fs_path
=
&*
fs_path
.await
?
;
...
...
packages/next-swc/crates/next-core/src/next_shared/transforms/swc_ecma_transform_plugins.rs
View file @
b3e28cab
...
...
@@ -40,7 +40,7 @@ pub async fn get_swc_ecma_transform_plugin_impl(
core
::{
asset
::
Asset
,
issue
::
IssueSeverity
,
reference_type
::
ReferenceType
,
reference_type
::
{
CommonJsReferenceSubType
,
ReferenceType
}
,
resolve
::{
handle_resolve_error
,
parse
::
Request
,
pattern
::
Pattern
,
resolve
},
},
ecmascript_plugin
::
transform
::
swc_ecma_transform_plugins
::{
...
...
@@ -68,8 +68,14 @@ pub async fn get_swc_ecma_transform_plugin_impl(
);
let
plugin_wasm_module_resolve_result
=
handle_resolve_error
(
resolve
(
project_path
,
request
,
resolve_options
)
.as_raw_module_result
(),
Value
::
new
(
ReferenceType
::
Undefined
),
resolve
(
project_path
,
Value
::
new
(
ReferenceType
::
CommonJs
(
CommonJsReferenceSubType
::
Undefined
)),
request
,
resolve_options
,
)
.as_raw_module_result
(),
Value
::
new
(
ReferenceType
::
CommonJs
(
CommonJsReferenceSubType
::
Undefined
)),
project_path
,
request
,
resolve_options
,
...
...
packages/next/package.json
View file @
b3e28cab
...
...
@@ -193,7 +193,7 @@
"@types/ws"
:
"8.2.0"
,
"@vercel/ncc"
:
"0.34.0"
,
"@vercel/nft"
:
"0.22.6"
,
"@vercel/turbopack-ecmascript-runtime"
:
"https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-23112
0
.2"
,
"@vercel/turbopack-ecmascript-runtime"
:
"https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-23112
1
.2"
,
"acorn"
:
"8.5.0"
,
"amphtml-validator"
:
"1.0.35"
,
"anser"
:
"1.4.9"
,
...
...
packages/next/src/server/app-render/action-handler.ts
View file @
b3e28cab
...
...
@@ -540,8 +540,9 @@ To configure the body size limit for Server Actions, see: https://nextjs.org/doc
}
}
const
actionHandler
=
ComponentMod
.
__next_app__
.
require
(
actionModId
)[
actionId
]
const
actionHandler
=
(
await
ComponentMod
.
__next_app__
.
require
(
actionModId
)
)[
actionId
]
const
returnVal
=
await
actionHandler
.
apply
(
null
,
bound
)
...
...
packages/next/src/server/require-hook.ts
View file @
b3e28cab
...
...
@@ -18,6 +18,7 @@ export const hookPropertyMap = new Map()
export
const
defaultOverrides
=
{
'styled-jsx'
:
path
.
dirname
(
resolve
(
'styled-jsx/package.json'
)),
'styled-jsx/style'
:
resolve
(
'styled-jsx/style'
),
'styled-jsx/style.js'
:
resolve
(
'styled-jsx/style'
),
}
const
toResolveMap
=
(
map
:
Record
<
string
,
string
>
):
[
string
,
string
][]
=>
...
...
pnpm-lock.yaml
View file @
b3e28cab
...
...
@@ -1065,8 +1065,8 @@ importers:
specifier
:
0.22.6
version
:
0.22.6
'
@vercel/turbopack-ecmascript-runtime'
:
specifier
:
https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-23112
0
.2
version
:
'
@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-23112
0
.2(react-refresh@0.12.0)(webpack@5.86.0)'
specifier
:
https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-23112
1
.2
version
:
'
@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-23112
1
.2(react-refresh@0.12.0)(webpack@5.86.0)'
acorn
:
specifier
:
8.5.0
version
:
8.5.0
...
...
@@ -24646,9 +24646,9 @@ packages:
/zwitch@2.0.4
:
resolution
:
{
integrity
:
sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==
}
'
@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-23112
0
.2(react-refresh@0.12.0)(webpack@5.86.0)'
:
resolution
:
{
registry
:
https
:
//registry.npmjs.org/
,
tarball
:
https
:
//gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js
?
turbopack-231120
.2
}
id
:
'
@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-23112
0
.2'
'
@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-23112
1
.2(react-refresh@0.12.0)(webpack@5.86.0)'
:
resolution
:
{
tarball
:
https
:
//gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js
?
turbopack-231121
.2
}
id
:
'
@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-23112
1
.2'
name
:
'
@vercel/turbopack-ecmascript-runtime'
version
:
0.0.0
dependencies
:
...
...
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