Skip to content

Commit

Permalink
preset_env followup [1/2] (vercel#478)
Browse files Browse the repository at this point in the history
Addresses some feedback from vercel#380. Together with a following PR to use swc_core (currently blocked on swc-project/swc#6083 and a subsequent publish), will address vercel#474.

* Remove unnecessary Result type
* Remove unnecessary @swc/helpers
  • Loading branch information
wbinnssmith authored Oct 10, 2022
1 parent 1be8b5f commit df4bc7b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
14 changes: 7 additions & 7 deletions crates/next-core/src/next_client/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use crate::{
};

#[turbo_tasks::function]
pub fn get_client_environment(browserslist_query: &str) -> Result<EnvironmentVc> {
Ok(EnvironmentVc::new(
pub fn get_client_environment(browserslist_query: &str) -> EnvironmentVc {
EnvironmentVc::new(
Value::new(ExecutionEnvironment::Browser(
BrowserEnvironment {
dom: true,
Expand All @@ -39,7 +39,7 @@ pub fn get_client_environment(browserslist_query: &str) -> Result<EnvironmentVc>
.into(),
)),
Value::new(EnvironmentIntention::Client),
))
)
}

#[turbo_tasks::function]
Expand Down Expand Up @@ -80,7 +80,7 @@ pub async fn get_client_module_options_context(
pub fn get_client_asset_context(
project_root: FileSystemPathVc,
browserslist_query: &str,
) -> Result<AssetContextVc> {
) -> AssetContextVc {
let environment = get_client_environment(browserslist_query);
let resolve_options_context = get_client_resolve_options_context();
let module_options_context = get_client_module_options_context(project_root, environment);
Expand All @@ -93,7 +93,7 @@ pub fn get_client_asset_context(
)
.into();

Ok(context)
context
}

#[turbo_tasks::function]
Expand Down Expand Up @@ -144,9 +144,9 @@ pub fn get_resolved_client_runtime_entries(
project_root: FileSystemPathVc,
env: ProcessEnvVc,
browserslist_query: &str,
) -> Result<EcmascriptChunkPlaceablesVc> {
) -> EcmascriptChunkPlaceablesVc {
let context = get_client_asset_context(project_root, browserslist_query);
let entries = get_client_runtime_entries(project_root, env);

Ok(entries.resolve_entries(context))
entries.resolve_entries(context)
}
1 change: 0 additions & 1 deletion crates/turbopack/tests/node-file-trace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"@google-cloud/bigquery": "^4.1.4",
"@google-cloud/firestore": "^4.11.0",
"@sentry/node": "^5.5.0",
"@swc/helpers": "^0.4.11",
"@tensorflow/tfjs-node": "^3.20.0",
"@tpluscode/sparql-builder": "^0.3.12",
"@types/bindings": "^1.3.0",
Expand Down
2 changes: 0 additions & 2 deletions pnpm-lock.yaml

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

0 comments on commit df4bc7b

Please sign in to comment.