Repository navigation
Releases: noahbald/oxvg
Release list
v0.0.9
What's Changed
- fix(oxvg_ast): #288 escape style content by @Michael-WhiteCapData in #289
- feat: #242 add oxc flag jsx by @noahbald in #290
- feat: #278 add jsonschema by @noahbald in #291
- fix(oxvg): report an unparsable config file instead of panicking by @happyarts in #293
- fix(oxvg_optimiser): honour
applyTransformsStrokedby @happyarts in #294 - fix(oxvg_collections): keep font-family lists comma-separated by @happyarts in #292
- fix(oxvg_collections): don't split lists at escaped separators by @happyarts in #298
- fix(oxvg_path): keep trailing zeros of an exponent in short_number by @happyarts in #301
- fix(oxvg_collections): round lists in presentation attributes by @happyarts in #303
- fix: #295 fix matching
xmlnsandxmlns:from generating xmlns declarations on children by @noahbald in #304 - fix: #300 add error handling in walker by @noahbald in #305
- fix(oxvg_collections): keep every digit of SVG attribute numbers by @happyarts in #302
- fix: #295 namespace map issues by @noahbald in #306
- Chore/0.0.9 readyness by @noahbald in #307
New Contributors
- @Michael-WhiteCapData made their first contribution in #289
- @happyarts made their first contribution in #293
Full Changelog: v0.0.8...v0.0.9
v0.0.8
What's Changed
- feat: 231 implement rest of path manipulations actions by @noahbald in #263
- docs: Proofreading edits and instructions for Homebrew by @chrisfinazzo in #262
- fix: #264 convert unparsed computed style to
Attr::CSSUnknownby @noahbald in #265 - feat: #231 implement insert action by @noahbald in #266
- fix: lint by @noahbald in #267
- chore: Exclude debug formatting from panics in release builds by @devongovett in #268
- feat: #231 implement creation actions by @noahbald in #269
- chore: benchmark workflow by @syi0808 in #238
- feat: #231 implement delete actions by @noahbald in #271
- feat: #232 implement select move actions by @noahbald in #273
- fix(oxvg_optimiser): keep ellipses selected by a stylesheet in convertShapeToPath by @MaxFreedomPollard in #277
- fix: unbreak formatting and spell check jobs by @j9t in #279
- feat: #226 add report step by @j9t in #276
- fix: #280 don’t panic on unparseable inline styles by @j9t in #282
- feat: #232 implement clipboard actions by @noahbald in #283
- feat: #270 svgo 4.1.0 parity by @noahbald in #284
- feat: #231 misc actions by @noahbald in #285
- feat: #275 validate parse optimise jobs by @noahbald in #287
New Contributors
- @chrisfinazzo made their first contribution in #262
- @MaxFreedomPollard made their first contribution in #277
- @j9t made their first contribution in #279
Full Changelog: v0.0.7...v0.0.8
v0.0.7
This release introduces a JSX transformer as a new feature to OXVG as well as some fixes to regressions introduced in 0.0.6.
The JSX transformer of OXVG aims to be a drop-in replacement to SVGR. It will take an SVG document, optimise it, and build it into a JSX module.
Optimisation options work the same as the optimiser.
Usage
The JSX transformer aims to work as closely as possible to SVGR and inherits its options, only with deviations in optimisation options, templating, and plugins. You can use it with either the oxvg jsx command or by using the Node bindings from @oxvg/jsx.
Similar to other commands it accepts usage with stdin/stdout
cat my-file.svg | oxvg jsx > my-file.jsxIt also accepts filesystem options in line with other OXVG commands. Note that this deviates from SVGR options.
# Read and transform file to a `.jsx` file.
oxvg jsx my-file.svg
# Read and transform many files to `.jsx` files and creates `index.js`
oxvg jsx svgs/
# Read and transform many files and directories to `.jsx` files and creates `index.js` files
oxvg jsx svgs/ -r
# Read and transform many files and directories to a new location
oxvg jsx svgs/ -r -o output/
# Read and transform many files and directories to a new location, including hidden files
oxvg jsx svgs/ -r -o output/ -. --no-ignoreOptimisation
SVG optimisation is done by the OXVG optimiser. Optimisation is available either through the CLI or NAPI bindings. Optimisation is enabled by default.
Optimisation options can be configured using a configuration file.
If using the @oxvg/jsx Node package, configuration can be passed directly.
import { transform } from "@oxvg/jsx";
const jsxCode = await transform(svgCode, { oxvg: { convertPathData: false } });Or for ease of migration, you can convert an existing SVGO config.
import { transform } from "@oxvg/jsx";
import { convertSvgoConfig } from "@oxvg/napi";
const jsxCode = await transform(svgCode, { oxvgConfig: convertSvgoConfig(svgoConfig) });Templates
OXVG supports templates which allow you to generate more bespoke components for whatever your needs may be.
The CLI will read a JavaScript and replace matching identifiers with the generated expressions.
// template.js
$imports;
$interfaces;
class $componentName extends React.Component {
constructor($props) {
super(props);
}
render() {
return $jsx;
}
}
$exports;cat my-file.svg | oxvg jsx --template template.js > output.jsx// output.jsx
import * as React from "react";
class SvgComponent extends React.Component {
constructor(props){
super(props);
}
render() {
return <svg><g/></svg>;
}
}
export default SvgComponent;The Node bindings accept the template as a function, which will receive the chunks as strings to return a final string.
transform(svgCode, { template: ({ imports, interfaces, componentName, props, jsx, exports }) => `${imports};
${interfaces};
class ${componentName} extends React.Component {
constructor(${props}) {
super(props);
}
render() {
return ${jsx};
}
}
${exports};`);Plugins
OXVG doesn't accept plugins. Consider processing the input/output directly instead.
cat my-file.svg | oxvg jsx --no-oxvg | prettier --stdin-filepath output.jsx > output.jsxWhat's Changed
- feat: #242 create oxvg_jsx by @noahbald in #243
- chore: update to Rust edition 2024 by @noahbald in #245
- chore: Update lightningcss and dedupe cssparser/selectors by @devongovett in #247
- fix: #244 remove "algorithm" as default oxvg_path feature by @noahbald in #246
- chore!: update dependencies by @noahbald in #248
- feat: skia debug commands by @noahbald in #249
- fix!: #251 stop drop z by @noahbald in #253
- fix: #250 join arc issues by @noahbald in #254
- feat: 231 implement path intersect action by @noahbald in #256
- chore: update wasm/napi dependencies by @noahbald in #257
- chore: add more napi platforms by @noahbald in #258
- chore: update readme to reflect state of the project by @noahbald in #259
- chore: update bin build targets to match napi by @noahbald in #260
Full Changelog: v0.0.6...v0.0.7
v0.0.6
This release introduces actions as well as some performance and ergonomic improvements.
Note
This release skips 0.0.5 for npm so sync npm and cargo versions
What's Changed
- fix: #214 fix bytes being reported as kb by @noahbald in #215
- fix: resolve relative subpoint compensation not being applied by @noahbald in #216
- fix!: fix clippy issues by @noahbald in #217
- Moving log release_max_level_off from workspace level to oxvg applica… by @recatek in #219
- fix: #222 fix issue where space-seperated list failed with training whitespace by @noahbald in #223
- fix: font parsing by @noahbald in #211
- fix: #186 update dependencies, remove web_atoms patch by @noahbald in #224
- feat: setup actions, create select action, create action command by @noahbald in #229
- feat: #227 web sys dom parser by @noahbald in #230
- feat: #231 implement state actions by @noahbald in #232
- feat: #231 implement attr actions by @noahbald in #233
- fix(napi): fix incorrect cpu arch by @syi0808 in #237
- feat!: path rework. Improve implementation, processing, and boolean operations by @noahbald in #235
- fix! #236 svgo conversion inconsistencies by @noahbald in #240
- Chore/release 0.0.5-1 readyness by @noahbald in #241
New Contributors
Full Changelog: v0.0.4...v0.0.6
v0.0.4
Happy Holidays! This release brings strong performance increases to the parsing and optimisation of documents. This release also introduces OXVG as a linter and LSP combo, to help you discover issues in documents.
See the updated wiki for more.
Install artifacts here.
Note
Crates are accidentally released as 0.0.5, future releases until 0.0.6 will be released as 0.0.5-1, 0.0.5-2, etc.
What's Changed
- fix: #171 fix napi config by @noahbald in #172
- fix: #171 update included file names by @noahbald in #173
- Fix building instructions by @ccouzens in #174
- feat!(oxvg): #177 support dot-config by @noahbald in #178
- fix: #179 resolve napi ci error by @noahbald in #180
- feat: #175 structured ast parsing by @noahbald in #176
- fix: #183 fix text escaping for style element content in xmlwriter by @noahbald in #185
- feat!: #189 improve whitespace handling by @noahbald in #191
- feat!: #188 improve parser api by @noahbald in #192
- perf: skip tokenisation by @noahbald in #193
- fix: #187 jobs error handling by @noahbald in #194
- Fixes typos by @gwen-lg in #196
- add checks in rust workflow by @gwen-lg in #182
- feat: add format command by @noahbald in #195
- feat: set up linting, lsp, and create new lint no_unknown_attributes lint by @noahbald in #199
- feat!: improve visitor start method to resemble common usage by @noahbald in #200
- feat: no unknkown elements lint by @noahbald in #201
- fix: #184 remove serde from napi by @noahbald in #202
- feat: lint no deprecated by @noahbald in #204
- feat: create lint no_default_attributes by @noahbald in #205
- feat: lint no xlink by @noahbald in #206
- feat: clean lint no_unused_ids by @noahbald in #207
- Various warning fixes by @gwen-lg in #198
- feat: lint no_unused_xmlns by @noahbald in #208
- feat: lint no_invalid_attributes by @noahbald in #209
- feat: #181 create separate
hiddenandno-ignorecli flags by @noahbald in #210 - fix: fix format always exiting with error by @noahbald in #212
New Contributors
Full Changelog: v0.0.3...v0.0.4
v0.0.4-1
Fixes napi pipeline, no changes to binary
v0.0.3
Special thanks to @jonasgeiler for producing a playground!
What's Changed
- export PrefixGenerator by @devongovett in #133
- feat!: #135 add napi types to bindings by @noahbald in #138
- feat!: #135 add wasm types to bindings by @noahbald in #139
- docs: #136 add/update readmes for bindings by @noahbald in #140
- Fix arc parsing by @devongovett in #142
- Fix converting curves to shorthands by @devongovett in #144
- feat: add helper for reusing svgo config by @noahbald in #150
- fix: #152 fix removing selectors when matching multiple items by @noahbald in #154
- fix: #145 remove unnecessary config features by @noahbald in #151
- add feature(core_float_math) by @ahaoboy in #156
- fix: #157 add option to prevent reckless text trimming by @noahbald in #158
- fix(optimiser): #159 rewrite inline styles & minify styles by @noahbald in #162
- fix: revert commented out code by @noahbald in #164
- fix(optimiser): #161 fix behaviour with "new" in cleanup numeric values by @noahbald in #163
- fix(optimiser): #165 prevent destroying zero value when zero precision is given by @noahbald in #167
- Add link to OXVGUI to readme by @jonasgeiler in #168
- feat(oxvg_optimiser): #148 convert style to attrs by @noahbald in #169
- fix: #149 rename jobs to match svgo by @noahbald in #170
New Contributors
- @ahaoboy made their first contribution in #156
- @jonasgeiler made their first contribution in #168
Full Changelog: v0.0.2...v0.0.3
v0.0.3-1
v0.0.3-0
v0.0.2
This release's theme is correctness, where we've managed to get 100% of the SVGs in the w3c test suite and oxygen library optimized without visually changing the document.
Check out the wiki page for more!
There's also new wasm and napi binding that will be coming to npm soon. Plus some performance improvements here and there :)
What's Changed
- Improve usage as a library by @devongovett in #110
- chore(oxvg_optimiser): #112 update convertColors to use lightningcss visitor by @noahbald in #115
- fix!: mend broken feature cfgs by @noahbald in #116
- feat: #111 create wasm bindings for npm by @noahbald in #117
- feat(oxvg_ast)!: #113 expose ast ref lifetimes by @noahbald in #114
- fix: #121 path optimisation bugs by @noahbald in #122
- feat(oxvg_optimiser): #119 add precheck job by @noahbald in #120
- feat: update ast to use arenas, add roxmltree parsing by @noahbald in #123
- feat: #124 use roxmltree by @noahbald in #126
- feat(oxvg_optimiser): #39 remove unused ns by @noahbald in #84
- feat(oxvg_optimiser): #25 remove editor ns data by @noahbald in #60
- feat(oxvg_optimiser): #43 remove xmlns by @noahbald in #102
- feat(oxvg_optimiser): #45 remove xlink by @noahbald in #103
- fix: #125 fork xmlwriter by @noahbald in #128
- Fix some correctness tests by @devongovett in #127
- fix: change the mutability of visitors by @noahbald in #129
- fix: add missing docs and fix warnings by @noahbald in #130
- feat: #118 safe preset by @noahbald in #131
- 0.0.2 cargo release by @noahbald in #132
Full Changelog: 0.0.1...v0.0.2
Self Build
cargo build --release --bin oxvgSHA256 Checksum
See the artifacts listed here.