Convert component resource to a record - #17
Open
scothis wants to merge 3 commits into
Open
Conversation
Resources are not composable from unique sources within the same component. For example, component resources in the wac-loader could only be consumed as resources from the wac-loader. This makes it impossible to actually bootstrap and compose a component. Switching to a record avoids these issues. A significant downside to using a record is that the bytes for the component must be initialized when the record is created. This makes lazy loading components on demand impossible. Likewise, if we wanted to change the list<u8> to stream<u8>, it could only be read once, and inherently less useful. Signed-off-by: Scott Andrews <scott@andrews.me>
scothis
force-pushed
the
resourceless
branch
from
September 1, 2026 11:43
ba17637 to
93c0433
Compare
wit map's are now part of the component model spec. Unfortunately, the
key cannot be a complex type like a record, or even a type alias for a
supported type. So we're denormalizing the id types from records to
strings. Each id take the form of `type:{value}` so that the keys in
each map are unique.
Signed-off-by: Scott Andrews <scott@andrews.me>
Loaders may extract and populate the wit, or leave it empty until a consumer needs the wit content. Signed-off-by: Scott Andrews <scott@andrews.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resources are not composable from unique sources within the same component. For example, component resources in the wac-loader could only be consumed as resources from the wac-loader. This makes it impossible to actually bootstrap and compose a component.
Switching to a record avoids these issues.
A significant downside to using a record is that the bytes for the component must be initialized when the record is created. This makes lazy loading components on demand impossible. Likewise, if we wanted to change the list to stream, it could only be read once, and inherently less useful.