Skip to content

Commit

Permalink
comment out edge context plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed May 10, 2024
1 parent 59d7ad4 commit bb3bfe1
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions packages/next-swc/crates/next-core/src/next_edge/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ use crate::{
next_import_map::get_next_edge_import_map,
next_server::context::ServerContextType,
next_shared::resolve::{
get_invalid_client_only_resolve_plugin, get_invalid_styled_jsx_resolve_plugin,
ModuleFeatureReportResolvePlugin, NextSharedRuntimeResolvePlugin,
// get_invalid_client_only_resolve_plugin, get_invalid_styled_jsx_resolve_plugin,
ModuleFeatureReportResolvePlugin,
NextSharedRuntimeResolvePlugin,
UnsupportedModulesResolvePlugin,
},
util::{foreign_code_context_condition, NextRuntime},
Expand Down Expand Up @@ -99,29 +100,30 @@ pub async fn get_edge_resolve_options_context(
get_next_edge_import_map(project_path, ty, next_config, execution_context);

let ty = ty.into_value();
let invalid_client_only_resolve_plugin = get_invalid_client_only_resolve_plugin(project_path);
let invalid_styled_jsx_client_only_resolve_plugin =
get_invalid_styled_jsx_resolve_plugin(project_path);

let plugins = match ty {
ServerContextType::Pages { .. } => {
vec![]
}
ServerContextType::PagesData { .. }
| ServerContextType::PagesApi { .. }
| ServerContextType::AppRSC { .. }
| ServerContextType::AppRoute { .. }
| ServerContextType::Middleware { .. }
| ServerContextType::Instrumentation => {
vec![
Vc::upcast(invalid_client_only_resolve_plugin),
Vc::upcast(invalid_styled_jsx_client_only_resolve_plugin),
]
}
ServerContextType::AppSSR { .. } => {
vec![]
}
};
// let invalid_client_only_resolve_plugin =
// get_invalid_client_only_resolve_plugin(project_path);
// let invalid_styled_jsx_client_only_resolve_plugin =
// get_invalid_styled_jsx_resolve_plugin(project_path);

// let plugins = match ty {
// ServerContextType::Pages { .. } => {
// vec![]
// }
// ServerContextType::PagesData { .. }
// | ServerContextType::PagesApi { .. }
// | ServerContextType::AppRSC { .. }
// | ServerContextType::AppRoute { .. }
// | ServerContextType::Middleware { .. }
// | ServerContextType::Instrumentation => {
// vec![
// Vc::upcast(invalid_client_only_resolve_plugin),
// Vc::upcast(invalid_styled_jsx_client_only_resolve_plugin),
// ]
// }
// ServerContextType::AppSSR { .. } => {
// vec![]
// }
// };

// https://github.com/vercel/next.js/blob/bf52c254973d99fed9d71507a2e818af80b8ade7/packages/next/src/build/webpack-config.ts#L96-L102
let mut custom_conditions = vec![mode.await?.condition().to_string()];
Expand Down Expand Up @@ -161,7 +163,7 @@ pub async fn get_edge_resolve_options_context(
foreign_code_context_condition(next_config, project_path).await?,
resolve_options_context.clone().cell(),
)],
plugins,
// plugins,
..resolve_options_context
}
.cell())
Expand Down

0 comments on commit bb3bfe1

Please sign in to comment.