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

Update Integration Base class to v2 #344

Open
wants to merge 1 commit into
base: update-core-exports
Choose a base branch
from

Conversation

seanspeaks
Copy link
Contributor

@seanspeaks seanspeaks commented Oct 17, 2024

Integration Base Class Overhaul

This update significantly revamps the Integration Base class, introducing new concepts and methods to align with Frigg v2 architecture:

  • Replaces the legacy "notify" and "delegate" pattern with a new "send" method, similar to XState's state machine concept.
  • Introduces an event handler registration system, including standard lifecycle events.
  • Adds user action concepts and loaders.
  • Centralizes the "Definition" concept with static definitions and dynamic constructor-based loading of instance variables and event handlers.
  • Implements helper functions for various framework implementation moments.
  • Removes outdated methods and properties.

Key changes include:

  • New loadModules() method to dynamically load modules defined in Definition.modules.
  • registerEventHandlers() method to set up default and custom event handlers.
  • send() method for triggering events with associated data.
  • Enhanced testAuth() method to handle multiple modules.
  • New methods for handling user actions: loadDynamicUserActions() and loadUserActions().
  • Updated getActionOptions() method signature.

This update lays the groundwork for the new integration structure in Frigg v2. Further testing and potential refinements may be necessary when integrated with the v1.3 prototyping repository.

…d a different name? Basically, this loads up the class with helper methods and functions that are used by the rest of Frigg core to be able to take advantage of new updates and concepts in Frigg v2.

- Removes the legacy "notify" concept with the "delegate" pattern.
- Replaces with "send", which is similar in concept to a state machine send that XState uses. But ultimately it's sending an event to the integration instance, with data, which ultimately invokes the handler found at the "on" event register.
- Adds an event handler registration method and flow, whereby standard/default/lifecycle events are added to the register
- Adds user action concepts/loaders
- Adds a few other helper functions intended to be used in various implementation moments across the framework
- Centralizes the "Definition" concept so that there's a static definition and a dynamic constructor-based loading of instance variables and event handlers

All of these should likely be combined with another few commits. And tested with the v1.3 prototyping repo.
Copy link

sonarcloud bot commented Oct 17, 2024

@seanspeaks seanspeaks marked this pull request as ready for review October 17, 2024 03:36
@seanspeaks seanspeaks changed the title Lots going on here. Updating the Integraton Base class, which may need a different name? Basically, this loads up the class with helper methods and functions that are used by the rest of Frigg core to be able to take advantage of new updates and concepts in Frigg v2. - Removes the legacy "notify" concept with the "delegate" pattern. - Replaces with "send", which is similar in concept to a state machine send that XState uses. But ultimately it's sending an event to the integration instance, with data, which ultimately invokes the handler found at the "on" event register. - Adds an event handler registration method and flow, whereby standard/default/lifecycle events are added to the register - Adds user action concepts/loaders - Adds a few other helper functions intended to be used in various implementation moments across the framework - Centralizes the "Definition" concept so that there's a static definition and a dynamic constructor-based loading of instance variables and event handlers Update Integration Base class to v2 Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant