Skip to content

Commit

Permalink
Update swc_core to v0.82.4 (vercel/turborepo#5820)
Browse files Browse the repository at this point in the history
### Description

Update swc crates to
swc-project/swc@44de87f

### Testing Instructions

Take a look at CI


---

Closes WEB-1459


---

next.js counterpart: #54653
  • Loading branch information
kdy1 authored Aug 30, 2023
1 parent abba56e commit 92a32c9
Show file tree
Hide file tree
Showing 11 changed files with 189 additions and 189 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn create_proxy_module(transition_name: &str, target_import: &str) -> Progra
})],
src: Box::new(target_import.into()),
type_only: false,
asserts: Some(Box::new(ObjectLit {
with: Some(Box::new(ObjectLit {
span: DUMMY_SP,
props: vec![PropOrSpread::Prop(Box::new(Prop::KeyValue(KeyValueProp {
key: PropName::Ident(Ident::new(TURBOPACK_HELPER.into(), DUMMY_SP)),
Expand Down
4 changes: 2 additions & 2 deletions crates/turbopack-ecmascript/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ async fn parse_content(
decorators: true,
decorators_before_export: true,
export_default_from: true,
import_assertions: true,
import_attributes: true,
allow_super_outside_method: true,
allow_return_outside_function: true,
auto_accessors: true,
using_decl: true,
explicit_resource_management: true,
}),
EcmascriptModuleAssetType::Typescript
| EcmascriptModuleAssetType::TypescriptWithTypes => {
Expand Down
2 changes: 1 addition & 1 deletion crates/turbopack-ecmascript/src/references/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2602,7 +2602,7 @@ pub struct AstPath(#[turbo_tasks(trace_ignore)] Vec<AstParentKind>);
pub static TURBOPACK_HELPER: &str = "__turbopackHelper";

pub fn is_turbopack_helper_import(import: &ImportDecl) -> bool {
import.asserts.as_ref().map_or(false, |asserts| {
import.with.as_ref().map_or(false, |asserts| {
asserts.props.iter().any(|assert| {
assert
.as_prop()
Expand Down
6 changes: 3 additions & 3 deletions crates/turbopack-ecmascript/src/tree_shake/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl DepGraph {
specifiers,
src: Box::new(uri_of_module.clone().into()),
type_only: false,
asserts: Some(Box::new(create_turbopack_chunk_id_assert(dep))),
with: Some(Box::new(create_turbopack_chunk_id_assert(dep))),
})));
}

Expand Down Expand Up @@ -334,7 +334,7 @@ impl DepGraph {
)],
src: None,
type_only: false,
asserts: Some(Box::new(ObjectLit {
with: Some(Box::new(ObjectLit {
span: DUMMY_SP,
props: vec![assertion_prop],
})),
Expand Down Expand Up @@ -787,7 +787,7 @@ impl DepGraph {
})],
src: None,
type_only: false,
asserts: None,
with: None,
})),
export: Some(export.clone()),
..Default::default()
Expand Down
2 changes: 1 addition & 1 deletion crates/turbopack-ecmascript/src/tree_shake/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ where
// Try to prepend the content of module

let part_id = import
.asserts
.with
.as_deref()
.and_then(find_turbopack_chunk_id_in_asserts);

Expand Down
72 changes: 36 additions & 36 deletions crates/turbopack-ecmascript/tests/tree-shaker/analyzer/1/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,22 +370,22 @@ graph TD
# Modules (dev)
## Part 0
```js
import { foobarCopy } from "entry.js" assert {
import { foobarCopy } from "entry.js" with {
__turbopack_chunk__: 9
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 11
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 5
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 8
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 10
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 6
};
"module evaluation";
Expand All @@ -396,38 +396,38 @@ console.log(foobarCopy);
```
## Part 1
```js
import { foobar } from "entry.js" assert {
import { foobar } from "entry.js" with {
__turbopack_chunk__: 5
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 8
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 10
};
export { foobar };

```
## Part 2
```js
import { foo } from "entry.js" assert {
import { foo } from "entry.js" with {
__turbopack_chunk__: 6
};
export { foo };

```
## Part 3
```js
import { internal } from "entry.js" assert {
import { internal } from "entry.js" with {
__turbopack_chunk__: 11
};
import { foobar } from "entry.js" assert {
import { foobar } from "entry.js" with {
__turbopack_chunk__: 5
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 8
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 10
};
export { external1 };
Expand All @@ -438,10 +438,10 @@ function external1() {
```
## Part 4
```js
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 6
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 9
};
export { external2 };
Expand All @@ -458,7 +458,7 @@ export { foobar };
```
## Part 6
```js
import { foobar } from "entry.js" assert {
import { foobar } from "entry.js" with {
__turbopack_chunk__: 5
};
const foo = foobar;
Expand All @@ -473,10 +473,10 @@ export { bar };
```
## Part 8
```js
import { bar } from "entry.js" assert {
import { bar } from "entry.js" with {
__turbopack_chunk__: 7
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 6
};
foobar += bar;
Expand All @@ -485,10 +485,10 @@ export { foobar };
```
## Part 9
```js
import { foobar } from "entry.js" assert {
import { foobar } from "entry.js" with {
__turbopack_chunk__: 5
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 8
};
let foobarCopy = foobar;
Expand All @@ -497,10 +497,10 @@ export { foobarCopy };
```
## Part 10
```js
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 6
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 9
};
foobar += "foo";
Expand All @@ -509,13 +509,13 @@ export { foobar };
```
## Part 11
```js
import { foobar } from "entry.js" assert {
import { foobar } from "entry.js" with {
__turbopack_chunk__: 5
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 8
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 10
};
import { upper } from "module";
Expand Down Expand Up @@ -551,10 +551,10 @@ console.log(foobarCopy);
# Modules (prod)
## Part 0
```js
import { foobar } from "entry.js" assert {
import { foobar } from "entry.js" with {
__turbopack_chunk__: 5
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 7
};
"module evaluation";
Expand All @@ -566,21 +566,21 @@ export { foobarCopy };
```
## Part 1
```js
import { foobar } from "entry.js" assert {
import { foobar } from "entry.js" with {
__turbopack_chunk__: 5
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 7
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 8
};
export { foobar };

```
## Part 2
```js
import { foobar } from "entry.js" assert {
import { foobar } from "entry.js" with {
__turbopack_chunk__: 5
};
export { foo };
Expand All @@ -590,13 +590,13 @@ export { foo };
```
## Part 3
```js
import { foobar } from "entry.js" assert {
import { foobar } from "entry.js" with {
__turbopack_chunk__: 5
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 7
};
import "entry.js" assert {
import "entry.js" with {
__turbopack_chunk__: 8
};
export { external1 };
Expand Down Expand Up @@ -631,7 +631,7 @@ export { bar };
```
## Part 7
```js
import { bar } from "entry.js" assert {
import { bar } from "entry.js" with {
__turbopack_chunk__: 6
};
foobar += bar;
Expand Down
Loading

0 comments on commit 92a32c9

Please sign in to comment.