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

Introduction of cerebralWrapper Module #5258

Open
JayFlexy opened this issue Aug 16, 2024 · 0 comments
Open

Introduction of cerebralWrapper Module #5258

JayFlexy opened this issue Aug 16, 2024 · 0 comments

Comments

@JayFlexy
Copy link
Contributor

JayFlexy commented Aug 16, 2024

Issue: Introduction of cerebralWrapper Module

Summary

We are introducing the cerebralWrapper module to wrap the functionality of the Cerebral state management library. Given that Cerebral is no longer maintained upstream, this module will provide a centralized place in the codebase to manage and mitigate any breakages related to Cerebral.

Goals

  1. Centralized State Management: Provide a single point of control for all state management-related code.
  2. Flexibility: Allow for easy integration of fixes or patches.
  3. Scalability: Enable the module to grow and evolve as the project's needs change.

Usage Example

import { ClientApplicationContext } from '@web-client/applicationContext';
import { Get } from '../../utilities/cerebralWrapper';
import { state } from '@web-client/presenter/app.cerebral';

export const externalConsolidatedCaseGroupHelper = (
  get: Get,
  applicationContext: ClientApplicationContext,
): any => {
  const caseDetail = get(state.caseDetail);

Future Development

  • Adding new helper functions and utilities.
  • Patching or extending the forked version of the legacy Cerebral library.
  • Evaluating and potentially integrating alternative state management libraries.

Importance of Centralized Breakage Mitigation

Addressing breakages in one location, rather than searching the entire codebase, is crucial. By replacing all references to the legacy library with the wrapper, we create a more linear path to mitigation. This approach simplifies fixing breakages and provides more options for remediation paths, ensuring consistent and maintainable state management.

Experimental Branch

For more details and to view the updated code changes, please refer to the experimental branch.

WIP Draft PR

Module Readme


This issue serves as an introduction to the new cerebralWrapper module and a location to place links pointing to the experimental branch hosting the updated code changes.

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

No branches or pull requests

1 participant