Code Monkey home page Code Monkey logo

Comments (7)

Maple0817 avatar Maple0817 commented on August 21, 2024 1

@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.

SyMind avatar SyMind commented on August 21, 2024

@Maple0817 I published a new one, please try it.

If you have other problem, must tell me!

from svgr-rs.

Maple0817 avatar Maple0817 commented on August 21, 2024

@SyMind , 2 things could imporve:

  1. return Result<String, Error> rather than Result<String, String>, since now transform function is directly used in rust.
  2. transform class to className since it is a jsx.

from svgr-rs.

SyMind avatar SyMind commented on August 21, 2024

transform class to className since it is a jsx.

@Maple0817 What does this mean? Can you explain it in detail.

from svgr-rs.

Maple0817 avatar Maple0817 commented on August 21, 2024

<?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.

SyMind avatar SyMind commented on August 21, 2024

@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.

Maple0817 avatar Maple0817 commented on August 21, 2024

@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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.