dotnet / dotnet/aspnetcore

Add ILocalStorage & ISessionStorage with Blazor WebAssembly friendly implementations

Open
#25,677 7 comments 17 reactions 0 assignees View on GitHub
affected-few area-blazor cost: M enhancement feature-blazor-builtin-components severity-minor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

The new protected browser storage support is great for persisting state in Blazor Server apps. However, it's tempting to use the `ProtectedLocalStorage` and `ProtectedSessionStorage` services directly from your components, which then means your components are no longer hosting model agnostic. To address this, could we provide `ILocalStorage` and `ISessionStorage` abstractions? And since we already have the code for interacting with local and session storage, could we also provide implementations of these interface for Blazor WebAssembly apps?

Contributor guide

Open the contributing guide

Research direction

Start by reading the existing ProtectedLocalStorage and ProtectedSessionStorage code referenced in the issue, then trace how their browser-storage interactions differ between Blazor Server and Blazor WebAssembly. Done means providing ILocalStorage and ISessionStorage abstractions plus Blazor WebAssembly-friendly implementations that let components remain hosting-model agnostic.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.