Re: What's the best way to enable this feature in WildFly?
The Context needs to be enabled via a CDI Extension. I'm currently enabling this via a configuration file (javax.enterprise.inject.spi.Extension) placed in the META-INF of the application. I think this is the way to do this for applications that run in a simple CDI container. However, we can remove this burden for applications deployed to WildFly. It's quite simple to enable this Extension in a DeploymentProcessor of the transactions SubSystem. However, we would need to either, enable it for all deployments, or just those that use @TransactionScoped (I don't yet know how to detect this).
Does enabling the extension when an application does not use it add overhead to the application? Maybe provide a way to disable it rather than enable it if so?