Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix node externals resolving #58129

Merged
merged 25 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
34896be
fix node externals resolving
sokra Nov 7, 2023
63ab02d
Merge branch 'canary' into sokra/fix-node-externals
ForsakenHarmony Nov 7, 2023
cc7cdc1
Merge branch 'canary' into sokra/fix-node-externals
sokra Nov 8, 2023
382c209
Merge branch 'canary' into sokra/fix-node-externals
sokra Nov 9, 2023
d5944f0
Merge branch 'canary' into sokra/fix-node-externals
sokra Nov 14, 2023
be8b540
Merge branch 'canary' into sokra/fix-node-externals
ztanner Nov 17, 2023
bd9ff7e
Merge branch 'canary' into sokra/fix-node-externals
sokra Nov 17, 2023
906338f
Merge branch 'canary' into sokra/fix-node-externals
sokra Nov 20, 2023
eb78ca6
select resolving type based on reference type
sokra Nov 20, 2023
29ba415
link
sokra Nov 20, 2023
6bfa447
clippy
sokra Nov 20, 2023
a8247eb
Merge remote-tracking branch 'origin/canary' into sokra/fix-node-exte…
sokra Nov 20, 2023
e50238a
update turbopack
sokra Nov 20, 2023
802e7fe
Merge remote-tracking branch 'origin/canary' into sokra/fix-node-exte…
sokra Nov 21, 2023
33cc8cd
Merge remote-tracking branch 'origin/canary' into sokra/fix-node-exte…
sokra Nov 21, 2023
72336b0
make styled-js alias ESM compatible
sokra Nov 21, 2023
bab49e1
action module might be an async module
sokra Nov 21, 2023
41fb1cd
link
sokra Nov 21, 2023
ce529b9
fix externals resolving logic for import_externals
sokra Nov 21, 2023
dc2520d
fixup
sokra Nov 21, 2023
907a06c
link
sokra Nov 21, 2023
58b3752
link
sokra Nov 21, 2023
ff703ce
extra check for fallback commonjs package to be really commonjs
sokra Nov 21, 2023
274bfa1
update require-hook for styled-jsx change
sokra Nov 21, 2023
c0e51d6
update turbopack
sokra Nov 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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-231120.2" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231120.3" }
# [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-231120.2" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231120.3" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231120.2" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231120.3" }

# General Deps

Expand Down
2 changes: 2 additions & 0 deletions packages/next-swc/crates/next-core/src/babel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(),
))),
Expand Down
2 changes: 2 additions & 0 deletions packages/next-swc/crates/next-core/src/next_import_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -880,6 +881,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(),
))),
Expand Down
Loading
Loading