Git Product home page Git Product logo

Comments (4)

guybedford avatar guybedford commented on September 25, 2024 1

I've added a simple example here in 519256f.

from componentizejs.

guybedford avatar guybedford commented on September 25, 2024

Yes, ideally this is also resolved by generating types or boilerplates via #48, as that would allow editor integration without needing to check reference documentation.

For reference documentation, the first step here is to fully document the WIT type structure used in the Jco project, for which I've posted bytecodealliance/jco#418.

With the WIT types fully defined there, the definition of imports here is then simply "import the corresponding WIT type by its fully qualified import name".

from componentizejs.

rylev avatar rylev commented on September 25, 2024

the definition of imports here is then simply "import the corresponding WIT type by its fully qualified import name".

I think this deserves to be documented now even before the other pieces are in place (albeit perhaps not so tersely as this particular description). From experience, once I know how to import a module that is generated from corresponding wit types, it's a lot easier to intuit how wit types are being translated into JavaScript syntax. The missing piece that took me the longest to figure out was what actually needs to go in the module string in an import statement. While the choice is obvious in hindsight, having it documented would have been very helpful even if a thorough explanation of how wit is translated into JavaScript was not included.

At the very least, including an import in the example would go a long way. At least then, it becomes possible to cargo cult.

from componentizejs.

guybedford avatar guybedford commented on September 25, 2024

Good point, definitely, let's update the example to use an import.

from componentizejs.

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.