app-monorepo icon indicating copy to clipboard operation
app-monorepo copied to clipboard

feat: jotai context shared store

Open sidmorizon opened this issue 1 year ago • 2 comments
trafficstars

sidmorizon avatar Feb 21 '24 09:02 sidmorizon

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

codesandbox[bot] avatar Feb 21 '24 09:02 codesandbox[bot]

PR Summary

Updates to Global Settings, Dependencies, and Components

  • A new global declaration, $$navigationShortcuts, has been introduced.
  • The dependencies within a function useOutsideClick have been improved, which would re-trigger the function more accurately when necessary.
  • Various unnecessary import statements and chunks of code have been removed from several files, leading to cleaner and more efficient codebase.
  • Import information for ServiceScanQRCode has been updated in the BackgroundApiProxy.ts file.
  • Necessary variable and component names have been changed for better cohesion and understanding.

Strategic Additions and Removals

  • A robust check has been added to the SimpleDbEntityAccountSelector.ts file for EAccountSelectorSceneName.discover, enhancing the program's accuracy.
  • A new function getAccountSelectorMap has been added to SimpleDbEntityDappConnection.ts, laying the groundwork for expanded functionality.
  • Several unnecessary import statements and pieces of code have been unmounted from both ServiceDApp.ts and ServiceToken.ts files.

Atom Renaming and Replacement

  • A comprehensive renaming of atoms has been undertaken, replacing accountSelectorMapAtom with jotaiContextStoreMapAtom and EAccountSelectorSceneName to EJotaiContextStoreNames.
  • This renaming process included an overall replacement of accountSelectorMap.ts with a new file jotaiContextStoreMap.ts.

Component Renaming and Addition

  • The existing component accountSelectorStore has been renamed to jotaiContextStore with corresponding update of imports in AccountSelectorProvider.tsx.
  • A brand new component AccountSelectorRootProvider.tsx has been added, standing in for the removed accountSelectorStore.

Architectural Improvements and Method Updates

  • The lodash library in the actions.ts file was made more efficient, and new import statements were added to accommodate this change.
  • A new logic file JotaiContextStoreMirrorTracker.tsx was added, providing a means of tracking and managing context store mirrors.
  • The createJotaiContext.tsx file underwent several removals to simplify its functionality.
  • A number of new files and hooks were added, each contributing to the creation and maintenance of Jotai context stores.
  • The TokenSelector.tsx file was updated to improve its function call capabilities.

UI Modifications and New Additions

  • A new component has been added to handle the syncing of accounts.
  • Methods in several files were updated to accept new parameters to enhance their performance.
  • Added a new file HomeTokenListProviderMirror.tsx and HomeTokenListRootProvider.tsx in the Home/components directory.
  • Added HomeTokenListProviderMirror component to TokenListContainer.tsx.
  • Removed WalletActionsContainer component from TokenListContainer.tsx.
  • Removed TokenListContainer export and renamed TokenListContainerWithProvider to TokenListContainer export in TokenListContainer.tsx.

Error Management and Date Formatting

  • Enhanced error management methods have been incorporated, providing more robust error handling.
  • Improvements have also been made to the formatRelativeDate method in the dateUtils.ts.

what-the-diff[bot] avatar Feb 21 '24 09:02 what-the-diff[bot]

状态管理复杂度再次升级 😣

originalix avatar Feb 22 '24 14:02 originalix