Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spec] Implement Effects #1226

Closed
Tracked by #22
PureWeen opened this issue Jun 9, 2021 · 0 comments
Closed
Tracked by #22

[Spec] Implement Effects #1226

PureWeen opened this issue Jun 9, 2021 · 0 comments
Assignees
Labels
fixed-in-6.0.100-preview.7.3 Look for this fix in 6.0.100-preview.7.3! proposal/open t/enhancement ☀️ New feature or request

Comments

@PureWeen
Copy link
Member

PureWeen commented Jun 9, 2021

Effects

Currently Effects don't get wired into Handlers. The need for effects in XF came from the need to be able to register something that was smaller than a renderer. The usefulness of an effect inside MAUI is debatable because inside MAUI users can just subscribe to AttachedHandler/DetachedHandler and achieve basically the same thing. You could even just use a behavior at this point. Should we deprecate effects and just tell people to use Behaviors?

Parts we need

  • AppHostingExtension method that lets users specify the xplat effect and the native effect type
  • Ensure that assembly scanning works.

Implementation

Effects should be fairly trivial to implement from a functional stand point. We should be able to just subscribe to the AttachedHandler/DetachedHandler events on a view. If that view has an effect then we new up the native effect and call OnAttached

We need to also figure out where to register effects outside of the registrar?

API

Registering an effect

An effect has the native part, resolution group, and the xplat part. I'm pretty sure the resolution group only really mattered for assembly scanning purposes so that effects wouldn't collide.

Should Effects be apart of Configure Handlers? Or should it be its own Configure Effects with its own _effectsCollection?

builder.ConfigureEffects(effectsCollection =>
{
    effectsCollection.RegisterEffect<XplatEffect, NativeEffectPart>();
});

Migration Notes

Once this has been implemented please update the WIKI about how users should migrate their app to handle effects

Backward Compatibility

if users enable assembly scanning then whatever custom effects they have made should still register

Difficulty : [low]

@mattleibow mattleibow self-assigned this Jun 14, 2021
@PureWeen PureWeen assigned PureWeen and unassigned mattleibow Jul 7, 2021
@PureWeen PureWeen mentioned this issue Jul 7, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Feb 19, 2022
@samhouts samhouts added the fixed-in-6.0.100-preview.7.3 Look for this fix in 6.0.100-preview.7.3! label Jul 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-6.0.100-preview.7.3 Look for this fix in 6.0.100-preview.7.3! proposal/open t/enhancement ☀️ New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants