Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
swc-bot committed Apr 12, 2024
2 parents 19bd3f4 + 6bc4de6 commit 6c7e138
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 24 deletions.
18 changes: 6 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

- **(es/compat)** Handle class fields correctly ([#8835](https://github.com/swc-project/swc/issues/8835)) ([5cc585b](https://github.com/swc-project/swc/commit/5cc585b8f3359d960420e31a91f53c761c90f3f5))


- **(es/helpers)** Add missing helpers ([#8843](https://github.com/swc-project/swc/issues/8843)) ([67bfcf4](https://github.com/swc-project/swc/commit/67bfcf41f59699ebb5286211fcc2cf5546f94376))


- **(es/plugin)** Create `tokio` runtime only if necessary ([#8845](https://github.com/swc-project/swc/issues/8845)) ([62c4f5e](https://github.com/swc-project/swc/commit/62c4f5efb84daa5f9e7f88bbbfddd7823bb1355d))

### Documentation


Expand Down Expand Up @@ -1358,22 +1364,10 @@

## [1.3.86] - 2023-09-18

### Miscellaneous Tasks



- **(es/preset-env)** Ignore `tp` in the version of a browser version ([#7968](https://github.com/swc-project/swc/issues/7968)) ([005ddc5](https://github.com/swc-project/swc/commit/005ddc573e3752183783cc25dd6242b750f8beb5))

### Refactor



- **(es/lint)** Remove usage of `box_patterns` ([#7966](https://github.com/swc-project/swc/issues/7966)) ([f7b5e16](https://github.com/swc-project/swc/commit/f7b5e16aef968c9c9f38f40962edf334cc3983e6))

### Build



- **(bindings/node)** Link msvc runtime statically ([#7965](https://github.com/swc-project/swc/issues/7965)) ([0759779](https://github.com/swc-project/swc/commit/07597795cc39cce527f505bc5db304ad93082494))

<!-- generated by git-cliff -->
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/swc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0"
name = "swc"
repository = "https://github.com/swc-project/swc.git"
version = "0.273.24"
version = "0.273.25"

[lib]
bench = false
Expand Down
21 changes: 12 additions & 9 deletions crates/swc/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,19 @@ impl RustPlugins {
return Ok(n);
}

tokio::runtime::Runtime::new()
.unwrap()
.block_on(async move {
self.apply_inner(n).with_context(|| {
format!(
"failed to invoke plugin on '{:?}'",
self.metadata_context.filename
)
})
let fut = async move {
self.apply_inner(n).with_context(|| {
format!(
"failed to invoke plugin on '{:?}'",
self.metadata_context.filename
)
})
};
if let Ok(handle) = tokio::runtime::Handle::try_current() {
handle.block_on(fut)
} else {
tokio::runtime::Runtime::new().unwrap().block_on(fut)
}
}

#[tracing::instrument(level = "info", skip_all, name = "apply_plugins")]
Expand Down
5 changes: 5 additions & 0 deletions packages/helpers/esm/_identity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export function _identity(x) {
return x;
}

export { _identity as _ };
1 change: 1 addition & 0 deletions packages/helpers/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export { _export_star } from "./_export_star.js";
export { _extends } from "./_extends.js";
export { _get } from "./_get.js";
export { _get_prototype_of } from "./_get_prototype_of.js";
export { _identity } from "./_identity.js";
export { _inherits } from "./_inherits.js";
export { _inherits_loose } from "./_inherits_loose.js";
export { _initializer_define_property } from "./_initializer_define_property.js";
Expand Down
6 changes: 5 additions & 1 deletion packages/helpers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@swc/helpers",
"packageManager": "yarn@4.0.2",
"version": "0.5.8",
"version": "0.5.9",
"description": "External helpers for the swc project.",
"module": "esm/index.js",
"main": "cjs/index.cjs",
Expand Down Expand Up @@ -251,6 +251,10 @@
"import": "./esm/_get_prototype_of.js",
"default": "./cjs/_get_prototype_of.cjs"
},
"./_/_identity": {
"import": "./esm/_identity.js",
"default": "./cjs/_identity.cjs"
},
"./_/_inherits": {
"import": "./esm/_inherits.js",
"default": "./cjs/_inherits.cjs"
Expand Down

0 comments on commit 6c7e138

Please sign in to comment.