Code Monkey home page Code Monkey logo

Comments (3)

RReverser avatar RReverser commented on May 27, 2024 2

You might be interested in looking at https://crates.io/crates/typescript-definitions - I remember seeing it briefly while searching for some other stuff in the past, but never dug in. However, given that both that crate and serde-wasm-bindgen build upon Serde attributes, it's possible combining the two on same types might work out of the box, or at least with little effort.

But yeah, I think an adapter that combines the two (if such is necessary) would be a bit out of scope of implementation. That said, I'm happy to add links or section to the docs showing how to use them together once you figure it out :)

Closing this issue for now.

from serde-wasm-bindgen.

RReverser avatar RReverser commented on May 27, 2024

Yeah me neither. Due to complexity seems rather out of scope of this project tbh, but if someone would make a macro like this, it sure could be cool.

from serde-wasm-bindgen.

trevyn avatar trevyn commented on May 27, 2024

So wasm-bindgen does some truly bonkers stuff to generate its TypeScript definitions, which initially scared me.

But I'm most interested in the case of relatively simple, flat user-defined structs that only contain basic types. If the macro is invoked on both the struct and the function, it should have all the info it needs to do a basic typedef without getting too crazy in the type system. Then more generality could be future work.

Totally cool if you consider this out-of-scope; it should be easy to layer on top of serde-wasm-bindgen as a separate crate. I suspect I'll give this first-pass version a shot, and will link back to this issue to keep everyone updated. :)

xref: rustwasm/wasm-bindgen#2645

from serde-wasm-bindgen.

Related Issues (20)

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.