Skip to content

Conversation

SAHU-01
Copy link
Contributor

@SAHU-01 SAHU-01 commented Aug 26, 2025

Following the REDUX-BUNDLER-MIGRATION-GUIDE.md this PR migrates local-storage.js bundler to fix part of #2349

Changes:

  • Created: src/contexts/local-storage-context.tsx - React context wrapping readSetting/writeSetting utilities
  • Updated: src/index.js - Added LocalStorageProvider to app hierarchy
  • Migrated 4 bundles to use context bridge instead of direct imports:

->src/bundles/pinning.js
->src/bundles/gateway.js
->src/bundles/ipns.js
->src/bundles/ipfs-provider.js

  • Removed: src/bundles/local-storage.js

Pattern: Replaced import { readSetting, writeSetting } from './local-storage.js' with context bridge selectors using createContextSelector('localStorage').
Testing: App loads without localStorage-related console errors. All localStorage functionality preserved.

Reviewer:
@SgtPooki

@SAHU-01 SAHU-01 requested a review from a team as a code owner August 26, 2025 07:16
@SgtPooki
Copy link
Member

@SAHU-01 thanks for your contribution..

However, this local storage file doesn't seem to be an actual redux-bundler bundle. We could probably just move the file as-is to src/lib/local-storage.. no need to use context or context-bridge for this at all as they're just function wrappers for localStorage.

@SAHU-01
Copy link
Contributor Author

SAHU-01 commented Aug 28, 2025

@SAHU-01 thanks for your contribution..

However, this local storage file doesn't seem to be an actual redux-bundler bundle. We could probably just move the file as-is to src/lib/local-storage.. no need to use context or context-bridge for this at all as they're just function wrappers for localStorage.

Thank you for your review @SgtPooki , I'll do the needful and update this PR asap!

Copy link
Member

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly looks good except some breakage of indentation

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.

2 participants