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

Remove unused app-turbopack files #62087

Merged
merged 4 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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

This file was deleted.

This file was deleted.

82 changes: 25 additions & 57 deletions packages/next-swc/crates/next-core/src/next_client/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,66 +363,34 @@ pub async fn get_client_runtime_entries(
execution_context: Vc<ExecutionContext>,
) -> Result<Vc<RuntimeEntries>> {
let mut runtime_entries = vec![];
let resolve_options_context =
get_client_resolve_options_context(project_root, ty, mode, next_config, execution_context);

match mode {
NextMode::Development => {
let resolve_options_context = get_client_resolve_options_context(
project_root,
ty,
mode,
next_config,
execution_context,
);
let enable_react_refresh =
assert_can_resolve_react_refresh(project_root, resolve_options_context)
.await?
.as_request();
if matches!(mode, NextMode::Development) {
let enable_react_refresh =
assert_can_resolve_react_refresh(project_root, resolve_options_context)
.await?
.as_request();

// It's important that React Refresh come before the regular bootstrap file,
// because the bootstrap contains JSX which requires Refresh's global
// functions to be available.
if let Some(request) = enable_react_refresh {
runtime_entries
.push(RuntimeEntry::Request(request, project_root.join("_".to_string())).cell())
};
// It's important that React Refresh come before the regular bootstrap file,
// because the bootstrap contains JSX which requires Refresh's global
// functions to be available.
if let Some(request) = enable_react_refresh {
runtime_entries
.push(RuntimeEntry::Request(request, project_root.join("_".to_string())).cell())
};
}

if matches!(*ty, ClientContextType::App { .. },) {
runtime_entries.push(
RuntimeEntry::Request(
Request::parse(Value::new(Pattern::Constant(
"next/dist/client/app-next-dev-turbopack.js".to_string(),
))),
project_root.join("_".to_string()),
)
.cell(),
);
}
}
NextMode::Build => match *ty {
ClientContextType::App { .. } => {
runtime_entries.push(
RuntimeEntry::Request(
Request::parse(Value::new(Pattern::Constant(
"./build/client/app-bootstrap.ts".to_string(),
))),
next_js_fs().root().join("_".to_string()),
)
.cell(),
);
}
ClientContextType::Pages { .. } => {
runtime_entries.push(
RuntimeEntry::Request(
Request::parse(Value::new(Pattern::Constant(
"./build/client/bootstrap.ts".to_string(),
))),
next_js_fs().root().join("_".to_string()),
)
.cell(),
);
}
_ => {}
},
if matches!(*ty, ClientContextType::App { .. },) {
runtime_entries.push(
RuntimeEntry::Request(
Request::parse(Value::new(Pattern::Constant(
"next/dist/client/app-next-turbopack.js".to_string(),
))),
project_root.join("_".to_string()),
)
.cell(),
);
}

Ok(Vc::cell(runtime_entries))
Expand Down
24 changes: 4 additions & 20 deletions packages/next-swc/crates/next-core/src/next_server/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use turbopack_binding::{
},
environment::{Environment, ExecutionEnvironment, NodeJsEnvironment, RuntimeVersions},
free_var_references,
resolve::{parse::Request, pattern::Pattern},
},
ecmascript::{references::esm::UrlRewriteBehavior, TreeShakingMode},
ecmascript_plugin::transform::directives::client::ClientDirectiveTransformer,
Expand Down Expand Up @@ -44,7 +43,7 @@ use crate::{
embed_js::next_js_fs,
mode::NextMode,
next_build::{get_external_next_compiled_package_mapping, get_postcss_package_mapping},
next_client::{RuntimeEntries, RuntimeEntry},
next_client::RuntimeEntries,
next_config::NextConfig,
next_import_map::{get_next_server_import_map, mdx_import_source_file},
next_server::resolve::ExternalPredicate,
Expand Down Expand Up @@ -721,25 +720,10 @@ pub fn get_build_module_options_context() -> Vc<ModuleOptionsContext> {

#[turbo_tasks::function]
pub fn get_server_runtime_entries(
ty: Value<ServerContextType>,
mode: NextMode,
_ty: Value<ServerContextType>,
_mode: NextMode,
) -> Vc<RuntimeEntries> {
let mut runtime_entries = vec![];

if matches!(mode, NextMode::Build) {
if let ServerContextType::AppRSC { .. } = ty.into_value() {
runtime_entries.push(
RuntimeEntry::Request(
Request::parse(Value::new(Pattern::Constant(
"./build/server/app-bootstrap.ts".to_string(),
))),
next_js_fs().root().join("_".to_string()),
)
.cell(),
);
}
}

let runtime_entries = vec![];
Vc::cell(runtime_entries)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ window.next.version += '-turbo'
;(self as any).__webpack_hash__ = ''

appBootstrap(() => {
require('./app-turbopack')
const { hydrate } = require('./app-index')
hydrate()
})
Expand Down
4 changes: 0 additions & 4 deletions packages/next/src/client/app-turbopack.ts

This file was deleted.

Loading