Comments (4)
I've added a simple example here in 519256f.
from componentizejs.
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.
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.
Good point, definitely, let's update the example to use an import.
from componentizejs.
Related Issues (20)
- Documentation disagrees with itself HOT 3
- Use of `wasi-http` fails to fully finish writing the body HOT 11
- Support for targeting multiple worlds HOT 14
- Document `witPath` option HOT 1
- Create a componentize-js CLI experience HOT 3
- Question - Should componentize-js tree shake unused imports? HOT 6
- Question - Can we optionally enable `cli` and `fs` worlds. HOT 3
- fetch globals are not available HOT 3
- Reference packages to import HOT 2
- Question: Using custom build of starlingmonkey HOT 7
- Async export support HOT 5
- `componentize` should throw an error when it it builds a component without satisfying world exports. HOT 2
- Optionally allow using `fetchEvent` to handle `wasi:http/[email protected]#handle` HOT 1
- Question - state of fetch in 0.9.0 HOT 2
- Cannot call static resource methods HOT 3
- Support building with `weval` HOT 1
- Host Env variables are not passed through to `wizer` HOT 1
- Error: Failed to initialize the compiled Wasm binary with Wizer HOT 2
- Support debug traces HOT 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 componentizejs.