Comments (7)
@SyMind this is a sample svg code, the class="icon" is not transformed. so one warning will happen:
Invalid DOM property class
. Did you mean className
?
from svgr-rs.
@Maple0817 I published a new one, please try it.
If you have other problem, must tell me!
from svgr-rs.
@SyMind , 2 things could imporve:
- return Result<String, Error> rather than Result<String, String>, since now transform function is directly used in rust.
- transform class to className since it is a jsx.
from svgr-rs.
transform class to className since it is a jsx.
@Maple0817 What does this mean? Can you explain it in detail.
from svgr-rs.
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1684477297859" class="icon" viewBox="0 0 1053 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="33426" xmlns:xlink="http://www.w3.org/1999/xlink" width="32.90625" height="32"><path d="xxx" p-id="33429"></path></svg>
from svgr-rs.
@Maple0817 I fix second problem in #23.
But i have no idea to change String to Error, because i don't have much experience with the actual design for Rust library, what are the advantages of using Error?
Can you help make changes?
from svgr-rs.
@SyMind You can use thiserror crates.
It looks like
`#[derive(thiserror::Error, Debug)]
pub enum SvgrRsError {
#[error("********")]
Error1(string),
#[error("")]
Error2(string),
}
pub fn fn1() -> Result<String, SvgrRsError> {
Err(SvgrRsError::Error2("********"))
}`
Since some functions should be changed include the napi, I am afraid would break other function.
So it will be better to change by you.
from svgr-rs.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svgr-rs.