Skip to content

Commit dff9296

Browse files
committed
1.1.0
1 parent 9f67f75 commit dff9296

File tree

19 files changed

+326
-89
lines changed

19 files changed

+326
-89
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
js-binding.js
22
js-binding.d.ts
3-
target
3+
target

.gitattributes

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* text=auto
33

44

5-
*.ts text eol=lf merge=union
6-
*.tsx text eol=lf merge=union
7-
*.rs text eol=lf merge=union
8-
*.js text eol=lf merge=union
9-
*.json text eol=lf merge=union
10-
*.debug text eol=lf merge=union
5+
*.ts text eol=lf merge=union
6+
*.tsx text eol=lf merge=union
7+
*.rs text eol=lf merge=union
8+
*.js text eol=lf merge=union
9+
*.json text eol=lf merge=union
10+
*.debug text eol=lf merge=union
1111

1212
# Generated files
1313
js-binding.js linguist-detectable=false
14-
js-binding.d.ts linguist-detectable=false
14+
js-binding.d.ts linguist-detectable=false

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
target
22
js-binding.js
3-
js-binding.d.ts
3+
js-binding.d.ts

CHANGELOG.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,35 @@ This changelog also contains important changes in dependencies.
99

1010
## [Unreleased]
1111

12+
## [1.1.0] - 2021-11-11
13+
14+
### Added
15+
16+
- feat: implement `renderAsync()` function. By @Brooooooklyn
17+
18+
We have made a major upgrade to napi-rs, from v1 to 2.x alpha. This allows better support for asynchronous binding and automatic generation of TypeScript definitions. Now you can enjoy `async/await`.
19+
20+
```js
21+
const { renderAsync } = require('@resvg/resvg-js')
22+
23+
async function main() {
24+
const pngData = await renderAsync(/* SVG string or buffer */)
25+
}
26+
```
27+
28+
- feat: The input to the `render()` and `renderAsync()` functions supports buffer.
29+
- feat: improved webpack support, no more need `@node-rs/helper` dependency.
30+
31+
The `@node-rs/helper` is convenient to load native binary cross platform and cpu arch. But it's not friendly to [`webpack`](https://github.com/webpack/webpack), [`vercel/nft`](https://github.com/vercel/nft) and [`vercel/ncc`](https://github.com/vercel/ncc) because the logic is too dynamic.
32+
33+
- feat: add `example/compare.js`.
34+
35+
### Changed
36+
37+
- fix: the default font no longer throws an error if it is not found, it changes to a warning.
38+
- chore: benchmark adds tests for svg icons and other improvements.
39+
- chore: upgrade Rust Edition to 2021.
40+
1241
## [1.0.4] - 2021-10-19
1342

1443
### Added
@@ -86,7 +115,8 @@ The first official version, use [resvg 0.18.0](https://github.com/RazrFalcon/res
86115
- Support custom fonts and system fonts.
87116
- Supports setting the background color of PNG.
88117

89-
[unreleased]: https://github.com/yisibl/resvg-js/compare/v1.0.4...HEAD
118+
[unreleased]: https://github.com/yisibl/resvg-js/compare/v1.1.0...HEAD
119+
[1.1.0]: https://github.com/yisibl/resvg-js/compare/v1.0.4...v1.1.0
90120
[1.0.4]: https://github.com/yisibl/resvg-js/compare/v1.0.3...v1.0.4
91121
[1.0.3]: https://github.com/yisibl/resvg-js/compare/v1.0.2...v1.0.3
92122
[1.0.2]: https://github.com/yisibl/resvg-js/compare/v1.0.1...v1.0.2

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ npm test
9595
I will consider implementing the following features, if you happen to be interested,
9696
please feel free to discuss with me or submit a PR.
9797

98+
- [x] Support async API
99+
- [x] Upgrade to napi-rs v2
98100
- [ ] Support for getting SVG Bounding box
99101
- [ ] Output usvg-simplified SVG string
100102
- [ ] Support for generating more lossless bitmap formats, e.g. avif, webp, JPEG XL
101-
- [ ] Support async API (dependent on [napi-rs PR #760](https://github.com/napi-rs/napi-rs/pull/760))
102103
- [ ] Support WebAssembly(.wasm)
103104

104105
## Release package

js-binding.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,4 @@ if (!nativeBinding) {
213213
const { render, renderAsync } = nativeBinding
214214

215215
module.exports.render = render
216-
module.exports.renderAsync = renderAsync
216+
module.exports.renderAsync = renderAsync

npm/android-arm64/package.json

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
{
22
"name": "@resvg/resvg-js-android-arm64",
3-
"version": "1.0.4",
4-
"os": ["android"],
5-
"cpu": ["arm64"],
3+
"version": "1.1.0",
4+
"os": [
5+
"android"
6+
],
7+
"cpu": [
8+
"arm64"
9+
],
610
"main": "resvgjs.android-arm64.node",
7-
"files": ["resvgjs.android-arm64.node"],
11+
"files": [
12+
"resvgjs.android-arm64.node"
13+
],
814
"description": "A high-performance SVG renderer, powered by Rust based resvg and napi-rs",
9-
"keywords": ["resvg", "svg", "node-resvg", "resvg-js", "resvg-node", "rust", "svg2png", "svg2img", "svg to png"],
15+
"keywords": [
16+
"resvg",
17+
"svg",
18+
"node-resvg",
19+
"resvg-js",
20+
"resvg-node",
21+
"rust",
22+
"svg2png",
23+
"svg2img",
24+
"svg to png"
25+
],
1026
"license": "MPL-2.0",
1127
"engines": {
1228
"node": ">= 10"
@@ -16,4 +32,4 @@
1632
"access": "public"
1733
},
1834
"repository": "[email protected]:yisibl/resvg-js.git"
19-
}
35+
}

npm/darwin-arm64/package.json

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
{
22
"name": "@resvg/resvg-js-darwin-arm64",
3-
"version": "1.0.4",
4-
"os": ["darwin"],
5-
"cpu": ["arm64"],
3+
"version": "1.1.0",
4+
"os": [
5+
"darwin"
6+
],
7+
"cpu": [
8+
"arm64"
9+
],
610
"main": "resvgjs.darwin-arm64.node",
7-
"files": ["resvgjs.darwin-arm64.node"],
11+
"files": [
12+
"resvgjs.darwin-arm64.node"
13+
],
814
"description": "A high-performance SVG renderer, powered by Rust based resvg and napi-rs",
9-
"keywords": ["resvg", "svg", "node-resvg", "resvg-js", "resvg-node", "rust", "svg2png", "svg2img", "svg to png"],
15+
"keywords": [
16+
"resvg",
17+
"svg",
18+
"node-resvg",
19+
"resvg-js",
20+
"resvg-node",
21+
"rust",
22+
"svg2png",
23+
"svg2img",
24+
"svg to png"
25+
],
1026
"license": "MPL-2.0",
1127
"engines": {
1228
"node": ">= 10"
@@ -16,4 +32,4 @@
1632
"access": "public"
1733
},
1834
"repository": "[email protected]:yisibl/resvg-js.git"
19-
}
35+
}

npm/darwin-x64/package.json

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
{
22
"name": "@resvg/resvg-js-darwin-x64",
3-
"version": "1.0.4",
4-
"os": ["darwin"],
5-
"cpu": ["x64"],
3+
"version": "1.1.0",
4+
"os": [
5+
"darwin"
6+
],
7+
"cpu": [
8+
"x64"
9+
],
610
"main": "resvgjs.darwin-x64.node",
7-
"files": ["resvgjs.darwin-x64.node"],
11+
"files": [
12+
"resvgjs.darwin-x64.node"
13+
],
814
"description": "A high-performance SVG renderer, powered by Rust based resvg and napi-rs",
9-
"keywords": ["resvg", "svg", "node-resvg", "resvg-js", "resvg-node", "rust", "svg2png", "svg2img", "svg to png"],
15+
"keywords": [
16+
"resvg",
17+
"svg",
18+
"node-resvg",
19+
"resvg-js",
20+
"resvg-node",
21+
"rust",
22+
"svg2png",
23+
"svg2img",
24+
"svg to png"
25+
],
1026
"license": "MPL-2.0",
1127
"engines": {
1228
"node": ">= 10"
@@ -16,4 +32,4 @@
1632
"access": "public"
1733
},
1834
"repository": "[email protected]:yisibl/resvg-js.git"
19-
}
35+
}
Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
{
22
"name": "@resvg/resvg-js-linux-arm-gnueabihf",
3-
"version": "1.0.4",
4-
"os": ["linux"],
5-
"cpu": ["arm"],
3+
"version": "1.1.0",
4+
"os": [
5+
"linux"
6+
],
7+
"cpu": [
8+
"arm"
9+
],
610
"main": "resvgjs.linux-arm-gnueabihf.node",
7-
"files": ["resvgjs.linux-arm-gnueabihf.node"],
11+
"files": [
12+
"resvgjs.linux-arm-gnueabihf.node"
13+
],
814
"description": "A high-performance SVG renderer, powered by Rust based resvg and napi-rs",
9-
"keywords": ["resvg", "svg", "node-resvg", "resvg-js", "resvg-node", "rust", "svg2png", "svg2img", "svg to png"],
15+
"keywords": [
16+
"resvg",
17+
"svg",
18+
"node-resvg",
19+
"resvg-js",
20+
"resvg-node",
21+
"rust",
22+
"svg2png",
23+
"svg2img",
24+
"svg to png"
25+
],
1026
"license": "MPL-2.0",
1127
"engines": {
1228
"node": ">= 10"
@@ -16,4 +32,4 @@
1632
"access": "public"
1733
},
1834
"repository": "[email protected]:yisibl/resvg-js.git"
19-
}
35+
}

0 commit comments

Comments
 (0)