Skip to content

Commit 37de7d3

Browse files
Copilotilonatommy
andcommitted
Update DeserializedAuthenticationStateProvider to use persistent component state properly
Co-authored-by: ilonatommy <[email protected]>
1 parent 0a88fce commit 37de7d3

File tree

9 files changed

+162
-14
lines changed

9 files changed

+162
-14
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/WebAssembly/WebAssembly.Authentication/src/Services/DeserializedAuthenticationStateProvider.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@ internal sealed class DeserializedAuthenticationStateProvider : AuthenticationSt
1919
[SupplyParameterFromPersistentComponentState]
2020
private AuthenticationStateData? AuthStateData { get; set; }
2121

22-
[UnconditionalSuppressMessage(
23-
"Trimming",
24-
"IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code",
25-
Justification = $"{nameof(DeserializedAuthenticationStateProvider)} uses the {nameof(DynamicDependencyAttribute)} to preserve the necessary members.")]
26-
[DynamicDependency(JsonSerialized, typeof(AuthenticationStateData))]
27-
[DynamicDependency(JsonSerialized, typeof(IList<ClaimData>))]
28-
[DynamicDependency(JsonSerialized, typeof(ClaimData))]
22+
2923
public DeserializedAuthenticationStateProvider(IOptions<AuthenticationStateDeserializationOptions> options)
3024
{
3125
_authenticationStateTask = AuthStateData is not null

src/Components/WebAssembly/WebAssembly.Authentication/src/WebAssemblyAuthenticationServiceCollectionExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Reflection;
66
using Microsoft.AspNetCore.Components;
77
using Microsoft.AspNetCore.Components.Authorization;
8+
using Microsoft.AspNetCore.Components.Infrastructure;
89
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
910
using Microsoft.AspNetCore.Components.WebAssembly.Authentication.Internal;
1011
using Microsoft.Extensions.DependencyInjection.Extensions;
@@ -30,6 +31,7 @@ public static IServiceCollection AddAuthenticationStateDeserialization(this ISer
3031
{
3132
services.AddOptions();
3233
services.TryAddScoped<AuthenticationStateProvider, DeserializedAuthenticationStateProvider>();
34+
RegisterPersistentComponentStateServiceCollectionExtensions.AddPersistentServiceRegistration<DeserializedAuthenticationStateProvider>(services, RenderMode.InteractiveWebAssembly);
3335
if (configure != null)
3436
{
3537
services.Configure(configure);

src/JSInterop/Microsoft.JSInterop.JS/src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@
4444
"rimraf": "^5.0.5",
4545
"typescript": "^5.3.3"
4646
}
47-
}
47+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "@microsoft/dotnet-js-interop",
3+
"version": "10.0.0-dev",
4+
"description": "Provides abstractions and features for interop between .NET and JavaScript code.",
5+
"main": "dist/src/Microsoft.JSInterop.js",
6+
"types": "dist/src/Microsoft.JSInterop.d.ts",
7+
"type": "module",
8+
"scripts": {
9+
"clean": "rimraf ./dist",
10+
"test": "jest",
11+
"test:watch": "jest --watch",
12+
"test:debug": "node --nolazy --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --colors --verbose",
13+
"build": "npm run clean && npm run build:esm",
14+
"build:lint": "eslint -c .eslintrc.json --ext .ts ./src",
15+
"build:esm": "tsc --project ./tsconfig.json",
16+
"get-version": "node -e \"const { name, version } = require('./package.json'); console.log(`${name};${version}`);\""
17+
},
18+
"repository": {
19+
"type": "git",
20+
"url": "git+https://github.com/dotnet/extensions.git"
21+
},
22+
"author": "Microsoft",
23+
"license": "MIT",
24+
"bugs": {
25+
"url": "https://github.com/dotnet/aspnetcore/issues"
26+
},
27+
"homepage": "https://github.com/dotnet/aspnetcore/tree/main/src/JSInterop",
28+
"files": [
29+
"dist/**"
30+
],
31+
"devDependencies": {
32+
"@babel/core": "^7.23.6",
33+
"@babel/preset-env": "^7.23.6",
34+
"@babel/preset-typescript": "^7.26.0",
35+
"@typescript-eslint/eslint-plugin": "^6.15.0",
36+
"@typescript-eslint/parser": "^6.15.0",
37+
"babel-jest": "^29.7.0",
38+
"eslint": "^8.56.0",
39+
"eslint-plugin-jsdoc": "^46.9.1",
40+
"eslint-plugin-prefer-arrow": "^1.2.3",
41+
"jest": "^29.7.0",
42+
"jest-environment-jsdom": "^29.7.0",
43+
"jest-junit": "^16.0.0",
44+
"rimraf": "^5.0.5",
45+
"typescript": "^5.3.3"
46+
}
47+
}

src/SignalR/clients/ts/signalr-protocol-msgpack/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/signalr-protocol-msgpack",
3-
"version": "5.0.0-dev",
3+
"version": "10.0.0-dev",
44
"description": "MsgPack Protocol support for ASP.NET Core SignalR",
55
"main": "./dist/cjs/index.js",
66
"module": "./dist/esm/index.js",
@@ -41,11 +41,11 @@
4141
"src/**/*"
4242
],
4343
"dependencies": {
44-
"@microsoft/signalr": "*",
44+
"@microsoft/signalr": ">=10.0.0-dev",
4545
"@msgpack/msgpack": "^2.7.0"
4646
},
4747
"overrides": {
4848
"ws": ">=7.4.6",
4949
"tough-cookie": ">=4.1.3"
5050
}
51-
}
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "@microsoft/signalr-protocol-msgpack",
3+
"version": "5.0.0-dev",
4+
"description": "MsgPack Protocol support for ASP.NET Core SignalR",
5+
"main": "./dist/cjs/index.js",
6+
"module": "./dist/esm/index.js",
7+
"typings": "./dist/esm/index.d.ts",
8+
"umd": "./dist/browser/signalr-protocol-msgpack.js",
9+
"umd_name": "signalR.protocols.msgpack",
10+
"unpkg": "./dist/browser/signalr-protocol-msgpack.js",
11+
"directories": {
12+
"test": "spec"
13+
},
14+
"sideEffects": false,
15+
"scripts": {
16+
"clean": "rimraf ./dist",
17+
"prebuild": "rimraf ./src/pkg-version.ts && node -e \"const fs = require('fs'); const packageJson = require('./package.json'); fs.writeFileSync('./src/pkg-version.ts', 'export const VERSION = \\'' + packageJson.version + '\\';');\"",
18+
"build": "npm run build:esm && npm run build:cjs && npm run build:browser && npm run build:uglify",
19+
"build:esm": "tsc --project ./tsconfig.json --module es2015 --outDir ./dist/esm -d",
20+
"build:cjs": "tsc --project ./tsconfig.json --module commonjs --outDir ./dist/cjs",
21+
"build:browser": "webpack-cli",
22+
"build:uglify": "terser -m -c --ecma 2019 --module --source-map \"url='signalr-protocol-msgpack.min.js.map',content='./dist/browser/signalr-protocol-msgpack.js.map'\" --comments -o ./dist/browser/signalr-protocol-msgpack.min.js ./dist/browser/signalr-protocol-msgpack.js",
23+
"get-version": "node -e \"const { name, version } = require('./package.json'); console.log(`${name};${version}`);\""
24+
},
25+
"keywords": [
26+
"signalr",
27+
"aspnetcore"
28+
],
29+
"repository": {
30+
"type": "git",
31+
"url": "git+https://github.com/dotnet/aspnetcore.git"
32+
},
33+
"author": "Microsoft",
34+
"license": "MIT",
35+
"bugs": {
36+
"url": "https://github.com/dotnet/aspnetcore/issues"
37+
},
38+
"homepage": "https://github.com/dotnet/aspnetcore/tree/main/src/SignalR#readme",
39+
"files": [
40+
"dist/**/*",
41+
"src/**/*"
42+
],
43+
"dependencies": {
44+
"@microsoft/signalr": "*",
45+
"@msgpack/msgpack": "^2.7.0"
46+
},
47+
"overrides": {
48+
"ws": ">=7.4.6",
49+
"tough-cookie": ">=4.1.3"
50+
}
51+
}

src/SignalR/clients/ts/signalr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/signalr",
3-
"version": "5.0.0-dev",
3+
"version": "10.0.0-dev",
44
"description": "ASP.NET Core SignalR Client",
55
"main": "./dist/cjs/index.js",
66
"module": "./dist/esm/index.js",
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "@microsoft/signalr",
3+
"version": "5.0.0-dev",
4+
"description": "ASP.NET Core SignalR Client",
5+
"main": "./dist/cjs/index.js",
6+
"module": "./dist/esm/index.js",
7+
"typings": "./dist/esm/index.d.ts",
8+
"umd": "./dist/browser/signalr.js",
9+
"umd_name": "signalR",
10+
"unpkg": "./dist/browser/signalr.js",
11+
"directories": {
12+
"test": "spec"
13+
},
14+
"sideEffects": false,
15+
"scripts": {
16+
"clean": "rimraf ./dist",
17+
"prebuild": "rimraf ./src/pkg-version.ts && node -e \"const fs = require('fs'); const packageJson = require('./package.json'); fs.writeFileSync('./src/pkg-version.ts', 'export const VERSION = \\'' + packageJson.version + '\\';');\"",
18+
"build": "npm run build:esm && npm run build:cjs && npm run build:browser && npm run build:webworker",
19+
"build:esm": "tsc --project ./tsconfig.json --module es2015 --outDir ./dist/esm -d",
20+
"build:cjs": "tsc --project ./tsconfig.json --module commonjs --outDir ./dist/cjs",
21+
"build:browser": "webpack-cli",
22+
"build:webworker": "webpack-cli --env platform=webworker",
23+
"get-version": "node -e \"const { name, version } = require('./package.json'); console.log(`${name};${version}`);\""
24+
},
25+
"keywords": [
26+
"signalr",
27+
"aspnetcore"
28+
],
29+
"repository": {
30+
"type": "git",
31+
"url": "git+https://github.com/dotnet/aspnetcore.git"
32+
},
33+
"author": "Microsoft",
34+
"license": "MIT",
35+
"bugs": {
36+
"url": "https://github.com/dotnet/aspnetcore/issues"
37+
},
38+
"homepage": "https://github.com/dotnet/aspnetcore/tree/main/src/SignalR#readme",
39+
"files": [
40+
"dist/**/*",
41+
"src/**/*"
42+
],
43+
"dependencies": {
44+
"abort-controller": "^3.0.0",
45+
"eventsource": "^2.0.2",
46+
"fetch-cookie": "^2.0.3",
47+
"node-fetch": "^2.6.7",
48+
"ws": "^7.5.10"
49+
},
50+
"overrides": {
51+
"ansi-regex": "5.0.1",
52+
"tough-cookie": ">=4.1.3"
53+
}
54+
}

0 commit comments

Comments
 (0)