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

Update swc_core to v0.82.4 #5820

Merged
merged 10 commits into from
Aug 30, 2023
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
428 changes: 291 additions & 137 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ lto = "off"
async-recursion = "1.0.2"
# Keep consistent with preset_env_base through swc_core
browserslist-rs = { version = "0.12.2" }
mdxjs = { version = "0.1.14" }
modularize_imports = { version = "0.33.0" }
styled_components = { version = "0.60.0" }
styled_jsx = { version = "0.37.0" }
swc_core = { version = "0.79.55" }
swc_emotion = { version = "0.36.0" }
swc_relay = { version = "0.8.0" }
testing = { version = "0.33.21" }
mdxjs = { version = "0.1.15" }
modularize_imports = { version = "0.37.0" }
styled_components = { version = "0.64.0" }
styled_jsx = { version = "0.41.0" }
swc_core = { version = "0.82.4" }
swc_emotion = { version = "0.40.0" }
swc_relay = { version = "0.12.0" }
testing = { version = "0.34.0" }

auto-hash-map = { path = "crates/turbo-tasks-auto-hash-map" }
node-file-trace = { path = "crates/node-file-trace", default-features = false }
Expand Down
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 @@ -253,11 +253,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
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
Loading