Skip to content

Commit 894a681

Browse files
committed
Fix test
1 parent 7820b1b commit 894a681

File tree

6 files changed

+156
-6
lines changed

6 files changed

+156
-6
lines changed

src/Components/Server/src/Circuits/CircuitHost.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System.Collections.ObjectModel;
54
using System.Diagnostics;
65
using System.Globalization;
76
using System.Linq;
@@ -162,7 +161,7 @@ public Task InitializeAsync(ProtectedPrerenderComponentApplicationStore store, A
162161
// web service, preventing UI updates.
163162
if (Descriptors.Count > 0)
164163
{
165-
store.ExistingState = ReadOnlyDictionary<string, byte[]>.Empty;
164+
store.ExistingState.Clear();
166165
}
167166

168167
// This variable is used to track that this is the first time we are updating components.
@@ -822,7 +821,7 @@ internal Task UpdateRootComponents(
822821
// At this point all components have successfully produced an initial render and we can clear the contents of the component
823822
// application state store. This ensures the memory that was not used during the initial render of these components gets
824823
// reclaimed since no-one else is holding on to it any longer.
825-
store.ExistingState = ReadOnlyDictionary<string, byte[]>.Empty;
824+
store.ExistingState.Clear();
826825
}
827826
}
828827
});

src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHost.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System.Collections.ObjectModel;
54
using System.Diagnostics.CodeAnalysis;
65
using System.Reflection.Metadata;
76
using Microsoft.AspNetCore.Components.Infrastructure;
@@ -205,7 +204,7 @@ internal async Task RunAsyncCore(CancellationToken cancellationToken, WebAssembl
205204
});
206205

207206
await initializationTcs.Task;
208-
store.ExistingState = ReadOnlyDictionary<string, byte[]>.Empty;
207+
store.ExistingState.Clear();
209208

210209
await tcs.Task;
211210
}
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/Shared/Components/PrerenderComponentApplicationStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected void DeserializeState(byte[] existingState)
4141
public string? PersistedState { get; private set; }
4242
#nullable disable
4343

44-
public IReadOnlyDictionary<string, byte[]> ExistingState { get; protected internal set; }
44+
public Dictionary<string, byte[]> ExistingState { get; protected set; }
4545

4646
public Task<IDictionary<string, byte[]>> GetPersistedStateAsync()
4747
{
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+
}
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)