Skip to content

Commit 613c6f6

Browse files
committed
Revert "select cross_origin field instead of depending on the whole config"
This reverts commit 8671edb.
1 parent e74e04e commit 613c6f6

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

crates/next-core/src/next_config.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub struct NextConfig {
105105
pub skip_middleware_url_normalize: Option<bool>,
106106
pub skip_trailing_slash_redirect: Option<bool>,
107107
pub i18n: Option<I18NConfig>,
108-
cross_origin: Option<CrossOriginConfig>,
108+
pub cross_origin: Option<CrossOriginConfig>,
109109
pub dev_indicators: Option<DevIndicatorsConfig>,
110110
pub output: Option<OutputType>,
111111
pub turbopack: Option<TurbopackConfig>,
@@ -157,17 +157,14 @@ pub struct NextConfig {
157157
}
158158

159159
#[derive(
160-
Clone, Debug, PartialEq, Eq, Serialize, Deserialize, TraceRawVcs, NonLocalValue, OperationValue,
160+
Clone, Debug, PartialEq, Serialize, Deserialize, TraceRawVcs, NonLocalValue, OperationValue,
161161
)]
162162
#[serde(rename_all = "kebab-case")]
163163
pub enum CrossOriginConfig {
164164
Anonymous,
165165
UseCredentials,
166166
}
167167

168-
#[turbo_tasks::value(transparent)]
169-
pub struct OptionCrossOriginConfig(Option<CrossOriginConfig>);
170-
171168
#[derive(
172169
Clone,
173170
Debug,
@@ -1860,11 +1857,6 @@ impl NextConfig {
18601857
))
18611858
}
18621859

1863-
#[turbo_tasks::function]
1864-
pub fn cross_origin(&self) -> Vc<OptionCrossOriginConfig> {
1865-
Vc::cell(self.cross_origin.clone())
1866-
}
1867-
18681860
#[turbo_tasks::function]
18691861
pub fn output_file_tracing_includes(&self) -> Vc<OptionJsonValue> {
18701862
Vc::cell(self.output_file_tracing_includes.clone())

crates/next-core/src/next_manifests/client_reference_manifest.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ async fn build_manifest(
175175
// TODO: Add `suffix` to the manifest for React to use.
176176
// entry_manifest.module_loading.prefix = prefix_path;
177177

178-
entry_manifest.module_loading.cross_origin = next_config.cross_origin().owned().await?;
178+
entry_manifest.module_loading.cross_origin = next_config
179+
.await?
180+
.cross_origin
181+
.as_ref()
182+
.map(|p| p.to_owned());
179183
let ClientReferencesChunks {
180184
client_component_client_chunks,
181185
layout_segment_client_chunks,

0 commit comments

Comments
 (0)