Restructuring for Multi-Platform Extensions (Phase 2) #11483
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Follow up of #11460.
This PR implements the platform service architecture designed in Phase 1, moving our business logic into the new structure. It enables sharing core functionality between Chrome and Front extensions while keeping platform-specific code cleanly separated.
Implementation Details
The core of this change is the
PlatformService
interface and its implementations. Shared business logic lives inBasePlatformLogic
, while platform-specific code (storage, auth flows) is implemented separately for each platform. React components access these services through a shared context.Key Changes
Some behavior changes:
getAccessToken
which will refresh if token is expired.Motivation
As we prepare to integrate with Front's mail client, this architecture lets us reuse our core extension logic without duplicating code. Each platform only needs to implement its specific storage and auth mechanisms.
Tests
Risk
Deploy Plan