Skip to content

Commit 34ef3d2

Browse files
authored
perf(styled-components): Check before allocating (#399)
1 parent a879b47 commit 34ef3d2

File tree

6 files changed

+19
-3
lines changed

6 files changed

+19
-3
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/styled-components/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @swc/plugin-styled-components
22

3+
## 6.5.0
4+
5+
### Minor Changes
6+
7+
- 04c2925: Improve performance
8+
39
## 6.4.0
410

511
### Minor Changes

packages/styled-components/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ Then update your `.swcrc` file like below:
2828

2929
# @swc/plugin-styled-components
3030

31+
## 6.5.0
32+
33+
### Minor Changes
34+
35+
- 04c2925: Improve performance
36+
3137
## 6.4.0
3238

3339
### Minor Changes

packages/styled-components/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@swc/plugin-styled-components",
3-
"version": "6.4.0",
3+
"version": "6.5.0",
44
"description": "SWC plugin for styled-components",
55
"main": "swc_plugin_styled_components.wasm",
66
"scripts": {

packages/styled-components/transform/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ homepage = { workspace = true }
1212
license = { workspace = true }
1313
repository = { workspace = true }
1414
rust-version = { workspace = true }
15-
version = "0.100.0"
15+
version = "0.100.1"
1616

1717

1818
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

packages/styled-components/transform/src/visitors/transpile_css_prop/transpile.rs

+4
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ impl VisitMut for TranspileCssProp<'_> {
377377
);
378378
}
379379

380+
if !self.state.need_work() {
381+
return;
382+
}
383+
380384
let mut serialized_body: Vec<ModuleItem> = vec![];
381385
let body = std::mem::take(&mut n.body);
382386
for item in body {

0 commit comments

Comments
 (0)