feat(isolatedwit): Moving the adder wit to a separate package.#136
Conversation
component-model/src/tutorial.md
Outdated
|
|
||
| ```sh | ||
| wasmtime run final.wasm 1 2 add | ||
| wasmtime run command.wasm 1 2 add |
There was a problem hiding this comment.
We are still creating final.wasm on line 134... is that no longer used? Doesn't command.wasm have unsatisfied imports at this point?
There was a problem hiding this comment.
I meant to overwrite command.wasm. But I missed updating line 134 .
I think it is better to leave it as final.wasm. Will update soon.
component-model/src/tutorial.md
Outdated
| } | ||
| eval-expression: func(op: op, x: u32, y: u32) -> u32; | ||
| } | ||
| //adder/wit/world.wit |
There was a problem hiding this comment.
Provide more intro here. This now goes from a paragraph talking about the "calculate" interface/world to a WIT that is just the adder interface/world. E.g. // WIT for the "adder" world - see <file path>, or a bridging paragraph.
Or break up the "these files" define section into e..g
The "adder" file defines:
(list of bullets)
... WIT WIT WIT ...The "calculator" file defines:
(list of bullets)
... WIT WIT WIT ...
(I'm not sure which approach will work best - we may need to experiment a bit!)
There was a problem hiding this comment.
I added description for the adder with separately. please let me know if this works . @itowlson
component-model/src/tutorial.md
Outdated
| world calculator { | ||
| export calculate; | ||
| import add; | ||
| import docs:adder/add; |
There was a problem hiding this comment.
This adds a new concept of cross-package references. Do we need to explain that here? It feels like it complicates the tutorial, but as a reader I would have questions given that these world have supposedly come from different sources. Maybe a forward reference is enough?
There was a problem hiding this comment.
I think cross package reference example is very much required. Because the real use cases for most teams to use component model will be to build components independently and compose them later as and when required.
I felt that was missing in the example and documentation. which was the main reason for me to create a separate repo which my team used to understand this concept.
I did not understand the forward reference part .
There was a problem hiding this comment.
By "forward reference" I mean a link to a section of the documentation that explains it (rather than explaining it in the tutorial itself).
There was a problem hiding this comment.
Based on our discussion, the scope of this PR will not be to update the language reference.
| @@ -67,14 +74,14 @@ world app { | |||
|
|
|||
| Reference the [language guide](language-support.md) and [authoring components | |||
There was a problem hiding this comment.
Are the language guides going to need any update to reflect that we now have two WIT packages/files in play?
There was a problem hiding this comment.
I kept the scope of this PR to the tutorial section. The language reference doesn't use this tutorial as a link reference , but I do see some differences.
Do you want me to update that in another PR ? Or you prefer all the changes in one PR here itself?
There was a problem hiding this comment.
If the language guide is general guidance and not tied to the tutorial files layout, then there is no need to change it.
|
|
||
| ## Create a `calculator` component | ||
|
|
||
| Reference the [language guide](language-support.md) and [authoring components |
There was a problem hiding this comment.
Again, any updates needed to the language guides?
There was a problem hiding this comment.
I am a bit confused about this.
@kate-goldenring asked me to keep the scope minimal. I am not sure if I should update the language guide.
Can you please confirm?
There was a problem hiding this comment.
Per the other thread (#136 (comment)), if the language guide is general guidance and not tied to the tutorial files layout, then there is no need to change it.
There was a problem hiding this comment.
@kate-goldenring @itowlson , Did you get a chance to review this PR?
What are the next steps?
Co-authored-by: itowlson <github@hestia.cc>
| package = "docs:calculator" | ||
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
|
||
| [dependencies] |
There was a problem hiding this comment.
Any reason for the reordering here?
There was a problem hiding this comment.
I changed the package name to command to show that these components can be isolated in their own packages. Do you prefer to keep the package "docs:calculator"? @kate-goldenring
itowlson
left a comment
There was a problem hiding this comment.
This looks okay to me - thanks @ritesh089 for working through all the discussion! Holding for @kate-goldenring who knows the tutorial pages better than I do!
kate-goldenring
left a comment
There was a problem hiding this comment.
Thank you @ritesh089. I tested everything locally and it looks good. Some small nits to finish cleaning up the WIT paths but LGTM
Co-authored-by: Kate Goldenring <kate.goldenring@gmail.com>
Co-authored-by: Kate Goldenring <kate.goldenring@gmail.com>
Co-authored-by: Kate Goldenring <kate.goldenring@gmail.com>
Co-authored-by: Kate Goldenring <kate.goldenring@gmail.com>
Co-authored-by: Kate Goldenring <kate.goldenring@gmail.com>
This PR updates the tutorial example that shows that components can be built with their own wit and then composed together with another parent component.
This PR is based on the feedback provided by @kate-goldenring on
#135