Skip to content

Commit

Permalink
Revert "Update swc_core to v0.96.5" (vercel/turborepo#8696)
Browse files Browse the repository at this point in the history
Reverts vercel/turborepo#8646

I failed to make next.js CI pass, so I'm creating this PR to unblock
other team members updating turbopack
  • Loading branch information
kdy1 authored Jul 9, 2024
1 parent 48681d7 commit b5637dc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion crates/turbopack-core/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Environment {
ExecutionEnvironment::Browser(browser_env) => {
Vc::cell(Versions::parse_versions(browserslist::resolve(
browser_env.await?.browserslist_query.split(','),
&browserslist::Opts::default(),
&browserslist::Opts::new(),
)?)?)
}
ExecutionEnvironment::EdgeWorker(_) => todo!(),
Expand Down
8 changes: 4 additions & 4 deletions crates/turbopack-ecmascript-plugins/src/transform/relay.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{path::PathBuf, sync::Arc};
use std::path::PathBuf;

use anyhow::{Context, Result};
use async_trait::async_trait;
Expand Down Expand Up @@ -33,7 +33,7 @@ pub enum RelayLanguage {

#[derive(Debug)]
pub struct RelayTransformer {
config: Arc<swc_relay::Config>,
config: swc_relay::Config,
project_path: FileSystemPath,
}

Expand All @@ -53,7 +53,7 @@ impl RelayTransformer {
};

Self {
config: options.into(),
config: options,
project_path: project_path.clone(),
}
}
Expand All @@ -75,7 +75,7 @@ impl CustomTransformer for RelayTransformer {

let p = std::mem::replace(program, Program::Module(Module::dummy()));
*program = p.fold_with(&mut swc_relay::relay(
self.config.clone(),
&self.config,
FileName::Real(PathBuf::from(ctx.file_name_str)),
path_to_proj,
// [TODO]: pages_dir comes through next-swc-loader
Expand Down
8 changes: 4 additions & 4 deletions crates/turbopack-ecmascript/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use swc_core::{
ecma::{
ast::{EsVersion, Program},
lints::{config::LintConfig, rules::LintParams},
parser::{lexer::Lexer, EsSyntax, Parser, Syntax, TsSyntax},
parser::{lexer::Lexer, EsConfig, Parser, Syntax, TsConfig},
transforms::base::{
helpers::{Helpers, HELPERS},
resolver,
Expand Down Expand Up @@ -285,7 +285,7 @@ async fn parse_content(
let mut parsed_program = {
let lexer = Lexer::new(
match ty {
EcmascriptModuleAssetType::Ecmascript => Syntax::Es(EsSyntax {
EcmascriptModuleAssetType::Ecmascript => Syntax::Es(EsConfig {
jsx: true,
fn_bind: true,
decorators: true,
Expand All @@ -298,7 +298,7 @@ async fn parse_content(
explicit_resource_management: true,
}),
EcmascriptModuleAssetType::Typescript { tsx, .. } => {
Syntax::Typescript(TsSyntax {
Syntax::Typescript(TsConfig {
decorators: true,
dts: false,
no_early_errors: true,
Expand All @@ -307,7 +307,7 @@ async fn parse_content(
})
}
EcmascriptModuleAssetType::TypescriptDeclaration => {
Syntax::Typescript(TsSyntax {
Syntax::Typescript(TsConfig {
decorators: true,
dts: true,
no_early_errors: true,
Expand Down
4 changes: 2 additions & 2 deletions crates/turbopack-swc-ast-explorer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use swc_core::{
common::{errors::ColorConfig, source_map::FileName, Globals, SourceMap, GLOBALS},
ecma::{
ast::EsVersion,
parser::{Syntax, TsSyntax},
parser::{Syntax, TsConfig},
},
};

Expand All @@ -30,7 +30,7 @@ fn main() -> Result<()> {
let sm = Arc::new(SourceMap::default());
let file = sm.new_source_file(FileName::Anon, contents);
let target = EsVersion::latest();
let syntax = Syntax::Typescript(TsSyntax {
let syntax = Syntax::Typescript(TsConfig {
tsx: true,
decorators: false,
dts: false,
Expand Down

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

0 comments on commit b5637dc

Please sign in to comment.