Closed wasnotrice closed 2 months ago
Apologies for taking this long to respond.
It should be possible to work around this by marking the compose capability with #[effect(skip)]
, e.g.
#[derive(Effect)]
pub struct Capabilities {
pub render: Render<Event>,
#[effect(skip)]
pub compose: Compose<Event>,
}
It may or may not be possible for us to detect this during type gen and skip it, but it's unclear to me whether with the current typegen we can only do it specifically for Compose
or for any capability with Never
as the operation type.
Using #[effect(skip)] had no effect.
I've been working around this by just adding a dummy case to the enum
pub enum Never { Never }
I'm not sure if this has any side effects, but it works fine for my purpose
@mmannes thanks for the fix for #[effect(skip)]
❤️
I saw that this was fixed with https://github.com/redbadger/crux/pull/259 (thanks @mmannes for that 🙏). Quick question: Do we have a timeline when this could be released?
I'm currently using a quite ugly workaround where I manually register all the types of the effects and exclude compose
. I'd love to get rid of this piece of code :)
Hey, sorry about this. We're cutting a release candidate at the moment, so will keep you up to date.
I tried adding the Compose capability to my app. The
shared
crate compiles, but typegen fails inshared_types
, because theNever
enum has no cases. See the backtrace below for details.We don't need to include
Compose
orNever
in typegen, since they are not exposed to shells, but is there a way to mark a capability as "excluded"? Or maybe another workaround?Here's a minimal repo that produces the error. You don't even have to use Compose, just include it in Capabilities.