I've opened an issue on the component-model repo about a near-term plan for optional imports which if folks have thoughts on please feel free to drop them there or here!
@Alex Crichton Maybe related: I've been trying to model a plugin system where plugin authors may request optional host permissions (which won't necessarily all be granted by the user), where permissions end up translating to functionality linked by the host, but which shouldn't fail to instantiate if some capabilities are missing (and it's left to the guest to check at runtime whether necessary capabilities are available), ideally without requiring plugin authors to write any .wit themselves
Would I be correct in thinking that future phases of optional imports may help facilitate something like this? Am I making things unnecessarily complicated for myself, and I should just write some sort of capability discovery WIT interface, which returns optional resources? Not assuming I have a particularly novel use-case, so wondering what others have done here and what might be recommended.
You're thinking is about the same as mine, optional imports are probably the most natural implementation of this but in the meantime optional resource getters is probably the way to model this
Well that's definitely encouraging to hear that I'm at least somewhat close to understanding things haha, thanks for the response.
Last updated: Dec 06 2025 at 05:03 UTC