Skip to content

Commit ec7008f

Browse files
committed
fix: use next-taskless to share contonts
1 parent 3d4f6df commit ec7008f

File tree

13 files changed

+828
-830
lines changed

13 files changed

+828
-830
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/next-core/src/next_server/resolve.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
use std::sync::LazyLock;
2-
31
use anyhow::Result;
4-
use regex::Regex;
2+
use next_taskless::NEVER_EXTERNAL_RE;
53
use serde::{Deserialize, Serialize};
64
use turbo_rcstr::{RcStr, rcstr};
75
use turbo_tasks::{NonLocalValue, ResolvedVc, Vc, trace::TraceRawVcs};
@@ -95,11 +93,6 @@ impl AfterResolvePlugin for ExternalCjsModulesResolvePlugin {
9593
return Ok(ResolveResultOption::none());
9694
};
9795

98-
// from https://github.com/vercel/next.js/blob/8d1c619ad650f5d147207f267441caf12acd91d1/packages/next/src/build/handle-externals.ts#L188
99-
static NEVER_EXTERNAL_RE: LazyLock<Regex> = LazyLock::new(|| {
100-
Regex::new("^(?:private-next-pages\\/|next\\/(?:dist\\/pages\\/|(?:app|cache|document|link|form|head|image|legacy\\/image|constants|dynamic|script|navigation|headers|router|compat\\/router|server)$)|string-hash|private-next-rsc-action-validate|private-next-rsc-action-client-wrapper|private-next-rsc-server-reference|private-next-rsc-cache-wrapper$)").unwrap()
101-
});
102-
10396
let (Pattern::Constant(package), Pattern::Constant(package_subpath)) =
10497
(package, package_subpath)
10598
else {

crates/next-rspack/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.node

crates/next-rspack/Cargo.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/next-rspack/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ rustc-hash = { version = "2.1.1" }
2424
napi = { version = "=3.1.2" }
2525
napi-derive = { version = "=3.1.1" }
2626

27+
next-taskless = { path = "../next-taskless" }
28+
2729
# Enable SWC plugin feature for targets that support it
2830
# Skip: wasm32-wasip1-threads, i686-pc-windows-msvc, aarch64-pc-windows-msvc, armv7-linux-androideabi, armv7-unknown-linux-gnueabihf
2931
[target.'cfg(not(any(target_arch = "wasm32", target_arch = "arm", all(target_os = "windows", target_arch = "x86"), all(target_os = "windows", target_arch = "aarch64"))))'.dependencies]

crates/next-rspack/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fn main() {
2-
rspack_binding_build::setup();
2+
rspack_binding_build::setup();
33
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#[derive(Debug, Clone, PartialEq, Eq, Default)]
22
pub enum EsmExternalsConfig {
3-
#[default]
4-
None,
5-
Loose,
6-
Strict,
3+
#[default]
4+
None,
5+
Loose,
6+
Strict,
77
}
88

99
#[derive(Debug, Clone, Default)]
1010
pub struct ExperimentalConfig {
11-
pub esm_externals: EsmExternalsConfig,
11+
pub esm_externals: EsmExternalsConfig,
1212
}
1313

1414
#[derive(Debug, Clone, Default)]
1515
pub struct NextConfigComplete {
16-
pub experimental: ExperimentalConfig,
17-
pub bundle_pages_router_dependencies: Option<bool>,
16+
pub experimental: ExperimentalConfig,
17+
pub bundle_pages_router_dependencies: Option<bool>,
1818
}

0 commit comments

Comments
 (0)