diff --git a/.circleci/config.yml b/.circleci/config.yml index 7230e00401..e353b2565f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -263,11 +263,11 @@ jobs: root: "." paths: # Just enough for integration tests and deploy - - backend/Build/out/ApiServer/Release/net6.0/linux-x64/publish/ - - backend/Build/out/BwdServer/Release/net6.0/linux-x64/publish/ - - backend/Build/out/QueueWorker/Release/net6.0/linux-x64/publish/ - - backend/Build/out/CronChecker/Release/net6.0/linux-x64/publish/ - - backend/Build/out/ExecHost/Release/net6.0/linux-x64/publish/ + - backend/Build/out/ApiServer/Release/net7.0/linux-x64/publish/ + - backend/Build/out/BwdServer/Release/net7.0/linux-x64/publish/ + - backend/Build/out/QueueWorker/Release/net7.0/linux-x64/publish/ + - backend/Build/out/CronChecker/Release/net7.0/linux-x64/publish/ + - backend/Build/out/ExecHost/Release/net7.0/linux-x64/publish/ - show-large-files-and-directories - save_cache: paths: @@ -302,7 +302,7 @@ jobs: - run: ./scripts/build/_dotnet-wrapper paket restore - run: ./scripts/build/_dotnet-wrapper publish -c Release src/Wasm/Wasm.fsproj - run: cp -f backend/src/Wasm/static/BlazorWorker.js backend/static/ - - run: rsync -a backend/Build/out/Wasm/Release/net6.0/publish/wwwroot/_framework/ backend/static/blazor/ + - run: rsync -a backend/Build/out/Wasm/Release/net7.0/publish/wwwroot/_framework/ backend/static/blazor/ - assert-clean-worktree - persist_to_workspace: root: "." diff --git a/.vscode/launch.json b/.vscode/launch.json index ad15369cc1..9ddc6d587d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,7 @@ "name": "Attach to ApiServer", "type": "coreclr", "request": "attach", - "program": "/home/dark/app/backend/Build/out/ApiServer/Debug/net6.0/linux-x64/ApiServer", + "program": "/home/dark/app/backend/Build/out/ApiServer/Debug/net7.0/linux-x64/ApiServer", "stopAtEntry": true }, { @@ -16,7 +16,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build-apiserver", - "program": "/home/dark/app/backend/Build/out/ApiServer/Debug/net6.0/linux-x64/ApiServer", + "program": "/home/dark/app/backend/Build/out/ApiServer/Debug/net7.0/linux-x64/ApiServer", "args": [], "cwd": "${workspaceFolder}", "stopAtEntry": false, @@ -27,7 +27,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build-bwdserver", - "program": "/home/dark/app/backend/Build/out/BwdServer/Debug/net6.0/linux-x64/BwdServer", + "program": "/home/dark/app/backend/Build/out/BwdServer/Debug/net7.0/linux-x64/BwdServer", "args": [], "cwd": "${workspaceFolder}", "stopAtEntry": false, @@ -38,7 +38,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build-tests", - "program": "/home/dark/app/backend/Build/out/Tests/Debug/net6.0/linux-x64/Tests", + "program": "/home/dark/app/backend/Build/out/Tests/Debug/net7.0/linux-x64/Tests", //"args": ["--filter-test-list", "HttpClient"], "args": ["--filter-test-case", "response-string-text"], "cwd": "${workspaceFolder}/backend", @@ -58,7 +58,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build-benchmark", - "program": "/home/dark/app/backend/Build/out/Benchmark/Debug/net6.0/linux-x64/Benchmark", + "program": "/home/dark/app/backend/Build/out/Benchmark/Debug/net7.0/linux-x64/Benchmark", "args": ["fizzbuzz"], "cwd": "${workspaceFolder}/backend", "stopAtEntry": true, @@ -78,7 +78,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build-fuzztests", - "program": "/home/dark/app/backend/Build/out/FuzzTests/Debug/net6.0/linux-x64/FuzzTests", + "program": "/home/dark/app/backend/Build/out/FuzzTests/Debug/net7.0/linux-x64/FuzzTests", "args": ["--filter-test-list", "executePure"], "cwd": "${workspaceFolder}/backend", "stopAtEntry": false, diff --git a/Dockerfile b/Dockerfile index f0ee17e11d..4c74d8e85d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -431,7 +431,7 @@ RUN /home/dark/install-exe-file \ # (runtime-deps, runtime, and sdk), see # https://github.com/dotnet/dotnet-docker/blob/master/src -ENV DOTNET_SDK_VERSION=6.0.300 \ +ENV DOTNET_SDK_VERSION=7.0.102 \ # Skip extraction of XML docs - generally not useful within an # image/container - helps performance NUGET_XMLDOC_MODE=skip \ @@ -449,11 +449,11 @@ set -e case ${TARGETARCH} in arm64) ARCH=arm64 - CHECKSUM=67eb088ccad197a39f104af60f3e6d12ea9b17560e059c0f7c8e956005d919d00bf0f3e487b06280be63ad57aa8895f16ebc8c92107c5019c9cf47bd620ea925 + CHECKSUM=a98abed737214bd61266d1a5d5096ae34537c6bef04696670d88684e9783bab6f6d45823f775648d723c4e031b1bd341f771baa6b265d2b6e5f5158213721627 ;; amd64) ARCH=x64 - CHECKSUM=52d720e90cfb889a92d605d64e6d0e90b96209e1bd7eab00dab1d567017d7a5a4ff4adbc55aff4cffcea4b1bf92bb8d351859d00d8eb65059eec5e449886c938 + CHECKSUM=7667aae20a9e50d31d1fc004cdc5cb033d2682d3aa793dde28fa2869de5ac9114e8215a87447eb734e87073cfe9496c1c9b940133567f12b3a7dea31a813967f ;; *) exit 1;; esac diff --git a/backend/.config/dotnet-tools.json b/backend/.config/dotnet-tools.json index 88efe9a122..799c469959 100644 --- a/backend/.config/dotnet-tools.json +++ b/backend/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "paket": { - "version": "6.2.1", + "version": "7.2.0", "commands": ["paket"] }, "dotnet-trace": { diff --git a/backend/global.json b/backend/global.json index eb0ec5e298..d2e675f2c2 100644 --- a/backend/global.json +++ b/backend/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.300", + "version": "7.0.102", "rollForward": "disable" } } diff --git a/backend/paket.dependencies b/backend/paket.dependencies index 650d1e1d48..fdc5df89ba 100644 --- a/backend/paket.dependencies +++ b/backend/paket.dependencies @@ -1,7 +1,7 @@ -version 6.2.1 +version 7.2.0 source https://api.nuget.org/v3/index.json -framework: net6.0 +framework: net7.0 storage: none // Basics @@ -66,4 +66,4 @@ nuget Argu = 6.1.1 group Wasm source https://api.nuget.org/v3/index.json // Wasm - this is in its own group to avoid a clash with OpenTelemetry - nuget Microsoft.AspNetCore.Components.WebAssembly = 6.0.1 + nuget Microsoft.AspNetCore.Components.WebAssembly = 7.0.2 diff --git a/backend/paket.lock b/backend/paket.lock index b483362d25..2869cc4930 100644 --- a/backend/paket.lock +++ b/backend/paket.lock @@ -1,5 +1,5 @@ STORAGE: NONE -RESTRICTION: == net6.0 +RESTRICTION: == net7.0 NUGET remote: https://api.nuget.org/v3/index.json Argu (6.1.1) @@ -833,80 +833,72 @@ NUGET GROUP Wasm NUGET remote: https://api.nuget.org/v3/index.json - Microsoft.AspNetCore.Authorization (6.0.5) - restriction: >= net6.0 - Microsoft.AspNetCore.Metadata (>= 6.0.5) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Logging.Abstractions (>= 6.0.1) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Options (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.AspNetCore.Components (6.0.5) - restriction: >= net6.0 - Microsoft.AspNetCore.Authorization (>= 6.0.5) - restriction: >= net6.0 - Microsoft.AspNetCore.Components.Analyzers (>= 6.0.5) - restriction: >= net6.0 - Microsoft.AspNetCore.Components.Analyzers (6.0.5) - restriction: >= net6.0 - Microsoft.AspNetCore.Components.Forms (6.0.5) - restriction: >= net6.0 - Microsoft.AspNetCore.Components (>= 6.0.5) - restriction: >= net6.0 - Microsoft.AspNetCore.Components.Web (6.0.5) - restriction: >= net6.0 - Microsoft.AspNetCore.Components (>= 6.0.5) - restriction: >= net6.0 - Microsoft.AspNetCore.Components.Forms (>= 6.0.5) - restriction: >= net6.0 - Microsoft.Extensions.DependencyInjection (>= 6.0) - restriction: >= net6.0 - Microsoft.JSInterop (>= 6.0.5) - restriction: >= net6.0 - System.IO.Pipelines (>= 6.0.3) - restriction: >= net6.0 - Microsoft.AspNetCore.Components.WebAssembly (6.0.1) - Microsoft.AspNetCore.Components.Web (>= 6.0.1) - restriction: >= net6.0 - Microsoft.Extensions.Configuration.Binder (>= 6.0) - restriction: >= net6.0 - Microsoft.Extensions.Configuration.Json (>= 6.0) - restriction: >= net6.0 - Microsoft.Extensions.Logging (>= 6.0) - restriction: >= net6.0 - Microsoft.JSInterop.WebAssembly (>= 6.0.1) - restriction: >= net6.0 - Microsoft.AspNetCore.Metadata (6.0.5) - restriction: >= net6.0 - Microsoft.Extensions.Configuration (6.0.1) - restriction: >= net6.0 - Microsoft.Extensions.Configuration.Abstractions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Primitives (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Configuration.Abstractions (6.0) - restriction: >= net6.0 - Microsoft.Extensions.Primitives (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Configuration.Binder (6.0) - restriction: >= net6.0 - Microsoft.Extensions.Configuration.Abstractions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Configuration.FileExtensions (6.0) - restriction: >= net6.0 - Microsoft.Extensions.Configuration (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Configuration.Abstractions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.FileProviders.Abstractions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.FileProviders.Physical (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Primitives (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Configuration.Json (6.0) - restriction: >= net6.0 - Microsoft.Extensions.Configuration (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Configuration.Abstractions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Configuration.FileExtensions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.FileProviders.Abstractions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - System.Text.Json (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.DependencyInjection (6.0) - restriction: >= net6.0 - Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.DependencyInjection.Abstractions (6.0) - restriction: >= net6.0 - Microsoft.Extensions.FileProviders.Abstractions (6.0) - restriction: >= net6.0 - Microsoft.Extensions.Primitives (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.FileProviders.Physical (6.0) - restriction: >= net6.0 - Microsoft.Extensions.FileProviders.Abstractions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.FileSystemGlobbing (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Primitives (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.FileSystemGlobbing (6.0) - restriction: >= net6.0 - Microsoft.Extensions.Logging (6.0) - restriction: >= net6.0 - Microsoft.Extensions.DependencyInjection (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Logging.Abstractions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Options (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - System.Diagnostics.DiagnosticSource (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Logging.Abstractions (6.0.1) - restriction: >= net6.0 - Microsoft.Extensions.Options (6.0) - restriction: >= net6.0 - Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Primitives (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.Extensions.Primitives (6.0) - restriction: >= net6.0 - System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - Microsoft.JSInterop (6.0.5) - restriction: >= net6.0 - Microsoft.JSInterop.WebAssembly (6.0.5) - restriction: >= net6.0 - Microsoft.JSInterop (>= 6.0.5) - restriction: >= net6.0 - System.Diagnostics.DiagnosticSource (6.0) - restriction: >= net6.0 - System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - System.IO.Pipelines (6.0.3) - restriction: >= net6.0 - System.Runtime.CompilerServices.Unsafe (6.0) - restriction: >= net6.0 - System.Text.Encodings.Web (6.0) - restriction: >= net6.0 - System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - System.Text.Json (6.0.4) - restriction: >= net6.0 - System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) - System.Text.Encodings.Web (>= 6.0) - restriction: || (>= net461) (>= netstandard2.0) + Microsoft.AspNetCore.Authorization (7.0.2) - restriction: >= net7.0 + Microsoft.AspNetCore.Metadata (>= 7.0.2) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Logging.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Options (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.AspNetCore.Components (7.0.2) - restriction: >= net7.0 + Microsoft.AspNetCore.Authorization (>= 7.0.2) - restriction: >= net7.0 + Microsoft.AspNetCore.Components.Analyzers (>= 7.0.2) - restriction: >= net7.0 + Microsoft.AspNetCore.Components.Analyzers (7.0.2) - restriction: >= net7.0 + Microsoft.AspNetCore.Components.Forms (7.0.2) - restriction: >= net7.0 + Microsoft.AspNetCore.Components (>= 7.0.2) - restriction: >= net7.0 + Microsoft.AspNetCore.Components.Web (7.0.2) - restriction: >= net7.0 + Microsoft.AspNetCore.Components (>= 7.0.2) - restriction: >= net7.0 + Microsoft.AspNetCore.Components.Forms (>= 7.0.2) - restriction: >= net7.0 + Microsoft.Extensions.DependencyInjection (>= 7.0) - restriction: >= net7.0 + Microsoft.JSInterop (>= 7.0.2) - restriction: >= net7.0 + System.IO.Pipelines (>= 7.0) - restriction: >= net7.0 + Microsoft.AspNetCore.Components.WebAssembly (7.0.2) + Microsoft.AspNetCore.Components.Web (>= 7.0.2) - restriction: >= net7.0 + Microsoft.Extensions.Configuration.Binder (>= 7.0.2) - restriction: >= net7.0 + Microsoft.Extensions.Configuration.Json (>= 7.0) - restriction: >= net7.0 + Microsoft.Extensions.Logging (>= 7.0) - restriction: >= net7.0 + Microsoft.JSInterop.WebAssembly (>= 7.0.2) - restriction: >= net7.0 + Microsoft.AspNetCore.Metadata (7.0.2) - restriction: >= net7.0 + Microsoft.Extensions.Configuration (7.0) - restriction: >= net7.0 + Microsoft.Extensions.Configuration.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Primitives (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Configuration.Abstractions (7.0) - restriction: >= net7.0 + Microsoft.Extensions.Primitives (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Configuration.Binder (7.0.2) - restriction: >= net7.0 + Microsoft.Extensions.Configuration.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Configuration.FileExtensions (7.0) - restriction: >= net7.0 + Microsoft.Extensions.Configuration (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Configuration.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.FileProviders.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.FileProviders.Physical (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Primitives (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Configuration.Json (7.0) - restriction: >= net7.0 + Microsoft.Extensions.Configuration (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Configuration.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Configuration.FileExtensions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.FileProviders.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + System.Text.Json (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.DependencyInjection (7.0) - restriction: >= net7.0 + Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.DependencyInjection.Abstractions (7.0) - restriction: >= net7.0 + Microsoft.Extensions.FileProviders.Abstractions (7.0) - restriction: >= net7.0 + Microsoft.Extensions.Primitives (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.FileProviders.Physical (7.0) - restriction: >= net7.0 + Microsoft.Extensions.FileProviders.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.FileSystemGlobbing (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Primitives (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.FileSystemGlobbing (7.0) - restriction: >= net7.0 + Microsoft.Extensions.Logging (7.0) - restriction: >= net7.0 + Microsoft.Extensions.DependencyInjection (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Logging.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Options (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Logging.Abstractions (7.0) - restriction: >= net7.0 + Microsoft.Extensions.Options (7.0) - restriction: >= net7.0 + Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Primitives (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) + Microsoft.Extensions.Primitives (7.0) - restriction: >= net7.0 + Microsoft.JSInterop (7.0.2) - restriction: >= net7.0 + Microsoft.JSInterop.WebAssembly (7.0.2) - restriction: >= net7.0 + Microsoft.JSInterop (>= 7.0.2) - restriction: >= net7.0 + System.IO.Pipelines (7.0) - restriction: >= net7.0 + System.Text.Encodings.Web (7.0) - restriction: >= net7.0 + System.Text.Json (7.0.1) - restriction: >= net7.0 + System.Text.Encodings.Web (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0) diff --git a/backend/src/ApiServer/ApiServer.fsproj b/backend/src/ApiServer/ApiServer.fsproj index bbd5f04631..7321bc12d1 100644 --- a/backend/src/ApiServer/ApiServer.fsproj +++ b/backend/src/ApiServer/ApiServer.fsproj @@ -2,8 +2,8 @@ Exe - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror true diff --git a/backend/src/ApiServer/Templates/ui.html b/backend/src/ApiServer/Templates/ui.html index 853efc42d6..2b2661e50d 100644 --- a/backend/src/ApiServer/Templates/ui.html +++ b/backend/src/ApiServer/Templates/ui.html @@ -118,6 +118,74 @@ src="//{{STATIC}}/app.js" crossorigin="anonymous" > + + + diff --git a/backend/src/BackendOnlyStdLib/BackendOnlyStdLib.fsproj b/backend/src/BackendOnlyStdLib/BackendOnlyStdLib.fsproj index f3673e71f7..0b1e8cd3b1 100644 --- a/backend/src/BackendOnlyStdLib/BackendOnlyStdLib.fsproj +++ b/backend/src/BackendOnlyStdLib/BackendOnlyStdLib.fsproj @@ -2,8 +2,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/BackendOnlyStdLib/HttpClient.fs b/backend/src/BackendOnlyStdLib/HttpClient.fs index 1f66e3a4cf..7a2e0e77fe 100644 --- a/backend/src/BackendOnlyStdLib/HttpClient.fs +++ b/backend/src/BackendOnlyStdLib/HttpClient.fs @@ -69,7 +69,7 @@ type Content = // As of today (using .NET6) it seems we no longer need to worry about either socket // exhaustion or DNS issues. It appears that we can use either multiple HTTP clients // or just one, we use just one for efficiency. -// See https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-6.0#alternatives-to-ihttpclientfactory +// See https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-7.0#alternatives-to-ihttpclientfactory // // Note that I manually verified by hand the number of sockets, which you can do with // sudo netstat -apn | grep _WAIT diff --git a/backend/src/BackendOnlyStdLib/LegacyBaseHttpClient.fs b/backend/src/BackendOnlyStdLib/LegacyBaseHttpClient.fs index 000db14739..bed58c0d4d 100644 --- a/backend/src/BackendOnlyStdLib/LegacyBaseHttpClient.fs +++ b/backend/src/BackendOnlyStdLib/LegacyBaseHttpClient.fs @@ -149,7 +149,7 @@ type Content = // As of today (using .NET6) it seems we no longer need to worry about either socket // exhaustion or DNS issues. It appears that we can use either multiple HTTP clients // or just one, we use just one for efficiency. -// See https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-6.0#alternatives-to-ihttpclientfactory +// See https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-7.0#alternatives-to-ihttpclientfactory // // Note that I manually verified by hand the number of sockets, which you can do with // sudo netstat -apn | grep _WAIT diff --git a/backend/src/BackendOnlyStdLib/LibHttpBaseClient.fs b/backend/src/BackendOnlyStdLib/LibHttpBaseClient.fs index 81361dedcf..b182bc8b4e 100644 --- a/backend/src/BackendOnlyStdLib/LibHttpBaseClient.fs +++ b/backend/src/BackendOnlyStdLib/LibHttpBaseClient.fs @@ -28,7 +28,7 @@ module HttpBaseClient = // As of .NET 6 it seems we no longer need to worry about either socket // exhaustion or DNS issues. It appears that we can use either multiple HTTP // clients or just one, we use just one for efficiency. - // See https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-6.0#alternatives-to-ihttpclientfactory + // See https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-7.0#alternatives-to-ihttpclientfactory // // Note that the number of sockets was verified manually, with: // `sudo netstat -apn | grep _WAIT` @@ -114,7 +114,7 @@ module HttpBaseClient = |> List.iter (fun (k, v) -> // .NET handles "content headers" separately from other headers. // They're put into `req.Content.Headers` rather than `req.Headers` - // https://docs.microsoft.com/en-us/dotnet/api/system.net.http.headers.httpcontentheaders?view=net-6.0 + // https://docs.microsoft.com/en-us/dotnet/api/system.net.http.headers.httpcontentheaders?view=net-7.0 if String.equalsCaseInsensitive k "content-type" then try req.Content.Headers.ContentType <- diff --git a/backend/src/BwdServer/BwdServer.fsproj b/backend/src/BwdServer/BwdServer.fsproj index 30fce9819f..4f6fc2ad14 100644 --- a/backend/src/BwdServer/BwdServer.fsproj +++ b/backend/src/BwdServer/BwdServer.fsproj @@ -2,8 +2,8 @@ Exe - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror true diff --git a/backend/src/ClientTypes/ClientTypes.fsproj b/backend/src/ClientTypes/ClientTypes.fsproj index a44218034f..231b822e5d 100644 --- a/backend/src/ClientTypes/ClientTypes.fsproj +++ b/backend/src/ClientTypes/ClientTypes.fsproj @@ -1,8 +1,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/ClientTypes2BackendTypes/ClientTypes2BackendTypes.fsproj b/backend/src/ClientTypes2BackendTypes/ClientTypes2BackendTypes.fsproj index 6cd51b37f5..54b1720085 100644 --- a/backend/src/ClientTypes2BackendTypes/ClientTypes2BackendTypes.fsproj +++ b/backend/src/ClientTypes2BackendTypes/ClientTypes2BackendTypes.fsproj @@ -1,8 +1,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/ClientTypes2ExecutionTypes/ClientTypes2ExecutionTypes.fsproj b/backend/src/ClientTypes2ExecutionTypes/ClientTypes2ExecutionTypes.fsproj index 199d60e345..2ced92bf7c 100644 --- a/backend/src/ClientTypes2ExecutionTypes/ClientTypes2ExecutionTypes.fsproj +++ b/backend/src/ClientTypes2ExecutionTypes/ClientTypes2ExecutionTypes.fsproj @@ -1,8 +1,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/CronChecker/CronChecker.fsproj b/backend/src/CronChecker/CronChecker.fsproj index bed4a6e1f2..b6da91d324 100644 --- a/backend/src/CronChecker/CronChecker.fsproj +++ b/backend/src/CronChecker/CronChecker.fsproj @@ -2,8 +2,8 @@ Exe - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror true diff --git a/backend/src/ExecHost/ExecHost.fs b/backend/src/ExecHost/ExecHost.fs index 20cf376105..dc6205457b 100644 --- a/backend/src/ExecHost/ExecHost.fs +++ b/backend/src/ExecHost/ExecHost.fs @@ -20,6 +20,7 @@ module CTPusher = ClientTypes.Pusher let runMigrations () : unit = print $"Running migrations" LibBackend.Migrations.run () + print "Migrations have run" let listMigrations () : unit = print "Migrations needed:\n" @@ -222,7 +223,9 @@ let main (args : string []) : int = if usesDB options then (LibBackend.Init.init LibBackend.Init.WaitForDB name).Result let result = (run options).Result + print "trying to shut down LibService" LibService.Init.shutdown name + print "LibService has been shut down" result with | e -> diff --git a/backend/src/ExecHost/ExecHost.fsproj b/backend/src/ExecHost/ExecHost.fsproj index 89979980eb..e784657c69 100644 --- a/backend/src/ExecHost/ExecHost.fsproj +++ b/backend/src/ExecHost/ExecHost.fsproj @@ -2,8 +2,8 @@ Exe - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror true diff --git a/backend/src/HttpMiddleware/HttpMiddleware.fsproj b/backend/src/HttpMiddleware/HttpMiddleware.fsproj index 9873afc43a..40bb92fd48 100644 --- a/backend/src/HttpMiddleware/HttpMiddleware.fsproj +++ b/backend/src/HttpMiddleware/HttpMiddleware.fsproj @@ -2,8 +2,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/LibAnalysis/LibAnalysis.fsproj b/backend/src/LibAnalysis/LibAnalysis.fsproj index 9c4897cecb..33db5d895a 100644 --- a/backend/src/LibAnalysis/LibAnalysis.fsproj +++ b/backend/src/LibAnalysis/LibAnalysis.fsproj @@ -1,8 +1,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/LibBackend/LibBackend.fsproj b/backend/src/LibBackend/LibBackend.fsproj index 0daeb2de14..8b9a2de250 100644 --- a/backend/src/LibBackend/LibBackend.fsproj +++ b/backend/src/LibBackend/LibBackend.fsproj @@ -2,8 +2,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/LibBackend/Migrations.fs b/backend/src/LibBackend/Migrations.fs index bfe0b3ce4f..0d299a2ada 100644 --- a/backend/src/LibBackend/Migrations.fs +++ b/backend/src/LibBackend/Migrations.fs @@ -93,3 +93,4 @@ let run () : unit = |> List.iter (fun name -> let sql = File.readfile Config.Migrations name runSystemMigration name sql) + diff --git a/backend/src/LibBinarySerialization/LibBinarySerialization.fsproj b/backend/src/LibBinarySerialization/LibBinarySerialization.fsproj index 6962bd4eac..6a8556485f 100644 --- a/backend/src/LibBinarySerialization/LibBinarySerialization.fsproj +++ b/backend/src/LibBinarySerialization/LibBinarySerialization.fsproj @@ -2,8 +2,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/LibExecution/LibExecution.fsproj b/backend/src/LibExecution/LibExecution.fsproj index df8034a123..f1743a6830 100644 --- a/backend/src/LibExecution/LibExecution.fsproj +++ b/backend/src/LibExecution/LibExecution.fsproj @@ -1,8 +1,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/LibExecutionStdLib/LibExecutionStdLib.fsproj b/backend/src/LibExecutionStdLib/LibExecutionStdLib.fsproj index 76d19fc6eb..7f8846651b 100644 --- a/backend/src/LibExecutionStdLib/LibExecutionStdLib.fsproj +++ b/backend/src/LibExecutionStdLib/LibExecutionStdLib.fsproj @@ -1,8 +1,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/LibRealExecution/LibRealExecution.fsproj b/backend/src/LibRealExecution/LibRealExecution.fsproj index 5374e3b58e..9ee4298ae9 100644 --- a/backend/src/LibRealExecution/LibRealExecution.fsproj +++ b/backend/src/LibRealExecution/LibRealExecution.fsproj @@ -3,8 +3,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/LibService/LibService.fsproj b/backend/src/LibService/LibService.fsproj index c098d87484..baa4e659d9 100644 --- a/backend/src/LibService/LibService.fsproj +++ b/backend/src/LibService/LibService.fsproj @@ -1,8 +1,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/LibService/Telemetry.fs b/backend/src/LibService/Telemetry.fs index 5de5cbd4d9..9f0d69c8e4 100644 --- a/backend/src/LibService/Telemetry.fs +++ b/backend/src/LibService/Telemetry.fs @@ -339,7 +339,10 @@ let mutable tracerProvider : TracerProvider = null /// Flush all Telemetry. Used on shutdown let flush () : unit = - if tracerProvider <> null then tracerProvider.ForceFlush() |> ignore + // somehow, this 'flushing' done at the end of an ExecHost migration run + // is causing a runtime exception + () + //if tracerProvider <> null then tracerProvider.ForceFlush() |> ignore diff --git a/backend/src/Prelude/Prelude.fsproj b/backend/src/Prelude/Prelude.fsproj index 7a40db5908..ffdd0e1963 100644 --- a/backend/src/Prelude/Prelude.fsproj +++ b/backend/src/Prelude/Prelude.fsproj @@ -2,8 +2,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/src/QueueWorker/QueueWorker.fsproj b/backend/src/QueueWorker/QueueWorker.fsproj index 676e5013e8..f5c70f5275 100644 --- a/backend/src/QueueWorker/QueueWorker.fsproj +++ b/backend/src/QueueWorker/QueueWorker.fsproj @@ -2,8 +2,8 @@ Exe - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror true diff --git a/backend/src/Wasm/Analysis.fs b/backend/src/Wasm/Analysis.fs index c1742e306d..aa572e4372 100644 --- a/backend/src/Wasm/Analysis.fs +++ b/backend/src/Wasm/Analysis.fs @@ -8,6 +8,14 @@ open System.Reflection open Prelude open Tablecloth +open Microsoft.JSInterop + +open System.Threading.Tasks +open Microsoft.AspNetCore.Components +open Microsoft.AspNetCore.Components.Routing +open Microsoft.Extensions.Logging +open System.Runtime.InteropServices.JavaScript + #nowarn "988" type GetGlobalObjectDelegate = delegate of string -> obj @@ -18,41 +26,94 @@ type InvokeDelegate = delegate of m : string * [] ps : obj [] -> obj /// /// Exposes fns to be called to evaluate expressions, /// and results back to JS -type EvalWorker = +type EvalWorker() = + + [] + static member Log(message: string): unit = () + + [] + member val jsRuntime = Unchecked.defaultof with get, set + static member GetGlobalObject(_globalObjectName : string) : unit = () + [] static member InitializeDarkRuntime() : unit = Environment.SetEnvironmentVariable("TZ", "UTC") + EvalWorker.Log("testing") LibAnalysis.initSerializers () - static member selfDelegate = - let typ = - let sourceAssembly : Assembly = - Assembly.Load "System.Private.Runtime.InteropServices.JavaScript" - sourceAssembly.GetType "System.Runtime.InteropServices.JavaScript.Runtime" + // static member selfDelegate = + + + + // // I do not have any clue what this does + // let method = typ.GetMethod(nameof (EvalWorker.GetGlobalObject)) + // let delegate_ = method.CreateDelegate() + // let target = delegate_.Invoke("self") + + // let typ = target.GetType() + // let invokeMethod = typ.GetMethod("Invoke") + + // System.Delegate.CreateDelegate(typeof, target, invokeMethod) + // :?> InvokeDelegate - // I do not have any clue what this does - let method = typ.GetMethod(nameof (EvalWorker.GetGlobalObject)) - let delegate_ = method.CreateDelegate() - let target = delegate_.Invoke("self") - let typ = target.GetType() - let invokeMethod = typ.GetMethod("Invoke") - System.Delegate.CreateDelegate(typeof, target, invokeMethod) - :?> InvokeDelegate /// Call `self.postMessage` in JS land /// /// Used in order to send the results of an expression back to the JS host static member postMessage(message : string) : unit = - let (_ : obj) = EvalWorker.selfDelegate.Invoke("postMessage", message) + let typ : System.Type = + let sourceAssembly : Assembly = + Assembly.Load "Microsoft.AspNetCore.Components.WebAssembly" + sourceAssembly.GetType + "Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime" + + //let baseType = typ.BaseType + + typ.GetMethods(BindingFlags.NonPublic) + |> Seq.iter(fun meth -> System.Console.WriteLine($"- {meth}")) + + // "Microsoft.JSInterop.WebAssembly" / WebAssemblyJSRuntime + + // typ.GetMethods(BindingFlags.NonPublic) + // |> Seq.iter(fun meth -> System.Console.WriteLine($"- {meth}")) + + + let method = typ.GetMethod("Invoke") + let method = method.MakeGenericMethod(typ); + + System.Console.WriteLine($"type lol {typ}") + System.Console.WriteLine($"method lol {method}") + let args : obj array = [| "console.log"; "{test: 'foo'}" |] + let result = method.Invoke(method, args) + System.Console.WriteLine($"result {result}") + + + + + + // System.Console.WriteLine($"really trying to post response: {message}") + // let evalWorker = EvalWorker() + // //let _ = evalWorker.jsRuntime.InvokeAsync("maybeCallback", "testing"); + // //let (_ : obj) = EvalWorker.selfDelegate.Invoke("postMessage", message) + + // let allAssemblies = + // (Assembly.GetEntryAssembly()).GetReferencedAssemblies() + // |> List.ofSeq + // |> List.map (fun ass -> ass.FullName) + // allAssemblies |> List.iter (fun ass -> System.Console.WriteLine(ass)) + + + () /// Receive request from JS host to be evaluated /// /// Once evaluated, an async call to `self.postMessage` will be made + [] static member OnMessage(input : string) : Task = // Just here to ensure type-safety (serializers require known/allowed types) let postResponse (response : ClientTypes.Analysis.AnalysisResult) : unit = @@ -81,9 +142,11 @@ type EvalWorker = // post the result back to the JS world return postResponse (Ok result) with - | e -> return reportException "Error returning results" e + | e -> + System.Console.WriteLine($"YOLO: {e}") + return () //return reportException "Error returning results" e with - | e -> return reportException "Error running analysis" e + | e -> return ()//return reportException "Error running analysis" e } with | e -> Task.FromResult(reportException "Error parsing analysis request" e) diff --git a/backend/src/Wasm/Wasm.fsproj b/backend/src/Wasm/Wasm.fsproj index 282e451284..98dbd78890 100644 --- a/backend/src/Wasm/Wasm.fsproj +++ b/backend/src/Wasm/Wasm.fsproj @@ -2,8 +2,8 @@ - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror true @@ -21,6 +21,9 @@ + + true + diff --git a/backend/src/Wasm/static/BlazorWorker.js b/backend/src/Wasm/static/BlazorWorker.js index a0ee43a286..8ebc7ee759 100644 --- a/backend/src/Wasm/static/BlazorWorker.js +++ b/backend/src/Wasm/static/BlazorWorker.js @@ -1,953 +1,3219 @@ -// Adapted from github/dotnet/aspnetcore/src/Components/Web.JS/src/Platform -// https://github.com/dotnet/aspnetcore/tree/504c502b6b783cf3ebc48623e2099f09fe1af74d/src/Components/Web.JS/src/Platform -// MIT license - -// This file copied a number of Blazor files to adapt them for a non-blazor world. The primary differences are: -// - no Blazor object -// - no Window object (as this is run in a web worker) -// - not typescript - -// The files adapted are: -// - MonoPlatform.ts - does nearly all of the platform loading and initialization -// - WebAssemblyConfigLoader.ts - to load/cache config from the server -// - WebAssemblyResourceLoader.ts - to load/cache resouces (assemblies and such) from the server -// - BootConfig.ts - utility class around blazor.boot.json - -// I've made a number of notes to discuss when I changed thing: -// D-REMOVED: explains why something was removed -// D-ADDED: explains why something was added -// D-CHANGED: explains why something was changed -// Note that I didn't make notes when typescript types were removed - -// ======================= -// MonoPlatform.ts -// ======================= -// https://github.com/dotnet/aspnetcore/blob/9b1de73ab6a18cbb3efbcb129a0ef911da3c4b5b/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts - -// This file loads .NET in a webWorker, including the Dark LibExecution WASM. -// It creates and initializes the webworker, which then downloads all the -// WASM/Blazor code needed from the server. - -/* D-REMOVED -import { DotNet } from '@microsoft/dotnet-js-interop'; -import { attachDebuggerHotkey, hasDebuggingEnabled } from './MonoDebugger'; -import { showErrorNotification } from '../../BootErrors'; -import { WebAssemblyResourceLoader, LoadingResource } from '../WebAssemblyResourceLoader'; -import { Platform, System_Array, Pointer, System_Object, System_String, HeapLock } from '../Platform'; -import { WebAssemblyBootResourceType } from '../WebAssemblyStartOptions'; -import { BootJsonData, ICUDataMode } from '../BootConfig'; -import { Blazor } from '../../GlobalExports'; - -declare let Module: EmscriptenModule; - -let mono_wasm_add_assembly: (name: string, heapAddress: number, length: number) => void; -D-REMOVED */ -// D-MOVED: to inside monoPlatform -// const appBinDirName = "appBinDir"; -/* D-REMOVED -const uint64HighOrderShift = Math.pow(2, 32); -const maxSafeNumberHighPart = Math.pow(2, 21) - 1; // The high-order int32 from Number.MAX_SAFE_INTEGER +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +var __webpack_exports__ = {}; + +;// CONCATENATED MODULE: ../../../JSInterop/Microsoft.JSInterop.JS/src/dist/Microsoft.JSInterop.js +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// This is a single-file self-contained module to avoid the need for a Webpack build +var DotNet; +(function (DotNet) { + window.DotNet = DotNet; // Ensure reachable from anywhere + const jsonRevivers = []; + const byteArraysToBeRevived = new Map(); + const pendingDotNetToJSStreams = new Map(); + const jsObjectIdKey = "__jsObjectId"; + const dotNetObjectRefKey = "__dotNetObject"; + const byteArrayRefKey = "__byte[]"; + const dotNetStreamRefKey = "__dotNetStream"; + const jsStreamReferenceLengthKey = "__jsStreamReferenceLength"; + class JSObject { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + constructor(_jsObject) { + this._jsObject = _jsObject; + this._cachedFunctions = new Map(); + } + findFunction(identifier) { + const cachedFunction = this._cachedFunctions.get(identifier); + if (cachedFunction) { + return cachedFunction; + } + let result = this._jsObject; + let lastSegmentValue; + identifier.split(".").forEach(segment => { + if (segment in result) { + lastSegmentValue = result; + result = result[segment]; + } + else { + throw new Error(`Could not find '${identifier}' ('${segment}' was undefined).`); + } + }); + if (result instanceof Function) { + result = result.bind(lastSegmentValue); + this._cachedFunctions.set(identifier, result); + return result; + } + throw new Error(`The value '${identifier}' is not a function.`); + } + getWrappedObject() { + return this._jsObject; + } + } + const pendingAsyncCalls = {}; + const windowJSObjectId = 0; + const cachedJSObjectsById = { + [windowJSObjectId]: new JSObject(window) + }; + cachedJSObjectsById[windowJSObjectId]._cachedFunctions.set("import", (url) => { + // In most cases developers will want to resolve dynamic imports relative to the base HREF. + // However since we're the one calling the import keyword, they would be resolved relative to + // this framework bundle URL. Fix this by providing an absolute URL. + if (typeof url === "string" && url.startsWith("./")) { + url = document.baseURI + url.substr(2); + } + return import(/* webpackIgnore: true */ url); + }); + let nextAsyncCallId = 1; // Start at 1 because zero signals "no response needed" + let nextJsObjectId = 1; // Start at 1 because zero is reserved for "window" + let dotNetDispatcher = null; + /** + * Sets the specified .NET call dispatcher as the current instance so that it will be used + * for future invocations. + * + * @param dispatcher An object that can dispatch calls from JavaScript to a .NET runtime. + */ + function attachDispatcher(dispatcher) { + dotNetDispatcher = dispatcher; + } + DotNet.attachDispatcher = attachDispatcher; + /** + * Adds a JSON reviver callback that will be used when parsing arguments received from .NET. + * @param reviver The reviver to add. + */ + function attachReviver(reviver) { + jsonRevivers.push(reviver); + } + DotNet.attachReviver = attachReviver; + /** + * Invokes the specified .NET public method synchronously. Not all hosting scenarios support + * synchronous invocation, so if possible use invokeMethodAsync instead. + * + * @param assemblyName The short name (without key/version or .dll extension) of the .NET assembly containing the method. + * @param methodIdentifier The identifier of the method to invoke. The method must have a [JSInvokable] attribute specifying this identifier. + * @param args Arguments to pass to the method, each of which must be JSON-serializable. + * @returns The result of the operation. + */ + function invokeMethod(assemblyName, methodIdentifier, ...args) { + return invokePossibleInstanceMethod(assemblyName, methodIdentifier, null, args); + } + DotNet.invokeMethod = invokeMethod; + /** + * Invokes the specified .NET public method asynchronously. + * + * @param assemblyName The short name (without key/version or .dll extension) of the .NET assembly containing the method. + * @param methodIdentifier The identifier of the method to invoke. The method must have a [JSInvokable] attribute specifying this identifier. + * @param args Arguments to pass to the method, each of which must be JSON-serializable. + * @returns A promise representing the result of the operation. + */ + function invokeMethodAsync(assemblyName, methodIdentifier, ...args) { + return invokePossibleInstanceMethodAsync(assemblyName, methodIdentifier, null, args); + } + DotNet.invokeMethodAsync = invokeMethodAsync; + /** + * Creates a JavaScript object reference that can be passed to .NET via interop calls. + * + * @param jsObject The JavaScript Object used to create the JavaScript object reference. + * @returns The JavaScript object reference (this will be the same instance as the given object). + * @throws Error if the given value is not an Object. + */ + function createJSObjectReference(jsObject) { + if (jsObject && typeof jsObject === "object") { + cachedJSObjectsById[nextJsObjectId] = new JSObject(jsObject); + const result = { + [jsObjectIdKey]: nextJsObjectId + }; + nextJsObjectId++; + return result; + } + throw new Error(`Cannot create a JSObjectReference from the value '${jsObject}'.`); + } + DotNet.createJSObjectReference = createJSObjectReference; + /** + * Creates a JavaScript data reference that can be passed to .NET via interop calls. + * + * @param streamReference The ArrayBufferView or Blob used to create the JavaScript stream reference. + * @returns The JavaScript data reference (this will be the same instance as the given object). + * @throws Error if the given value is not an Object or doesn't have a valid byteLength. + */ + function createJSStreamReference(streamReference) { + let length = -1; + // If we're given a raw Array Buffer, we interpret it as a `Uint8Array` as + // ArrayBuffers' aren't directly readable. + if (streamReference instanceof ArrayBuffer) { + streamReference = new Uint8Array(streamReference); + } + if (streamReference instanceof Blob) { + length = streamReference.size; + } + else if (streamReference.buffer instanceof ArrayBuffer) { + if (streamReference.byteLength === undefined) { + throw new Error(`Cannot create a JSStreamReference from the value '${streamReference}' as it doesn't have a byteLength.`); + } + length = streamReference.byteLength; + } + else { + throw new Error("Supplied value is not a typed array or blob."); + } + const result = { + [jsStreamReferenceLengthKey]: length + }; + try { + const jsObjectReference = createJSObjectReference(streamReference); + result[jsObjectIdKey] = jsObjectReference[jsObjectIdKey]; + } + catch (error) { + throw new Error(`Cannot create a JSStreamReference from the value '${streamReference}'.`); + } + return result; + } + DotNet.createJSStreamReference = createJSStreamReference; + /** + * Disposes the given JavaScript object reference. + * + * @param jsObjectReference The JavaScript Object reference. + */ + function disposeJSObjectReference(jsObjectReference) { + const id = jsObjectReference && jsObjectReference[jsObjectIdKey]; + if (typeof id === "number") { + disposeJSObjectReferenceById(id); + } + } + DotNet.disposeJSObjectReference = disposeJSObjectReference; + /** + * Parses the given JSON string using revivers to restore args passed from .NET to JS. + * + * @param json The JSON stirng to parse. + */ + function parseJsonWithRevivers(json) { + return json ? JSON.parse(json, (key, initialValue) => { + // Invoke each reviver in order, passing the output from the previous reviver, + // so that each one gets a chance to transform the value + return jsonRevivers.reduce((latestValue, reviver) => reviver(key, latestValue), initialValue); + }) : null; + } + function invokePossibleInstanceMethod(assemblyName, methodIdentifier, dotNetObjectId, args) { + const dispatcher = getRequiredDispatcher(); + if (dispatcher.invokeDotNetFromJS) { + const argsJson = stringifyArgs(args); + const resultJson = dispatcher.invokeDotNetFromJS(assemblyName, methodIdentifier, dotNetObjectId, argsJson); + return resultJson ? parseJsonWithRevivers(resultJson) : null; + } + throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead."); + } + function invokePossibleInstanceMethodAsync(assemblyName, methodIdentifier, dotNetObjectId, args) { + if (assemblyName && dotNetObjectId) { + throw new Error(`For instance method calls, assemblyName should be null. Received '${assemblyName}'.`); + } + const asyncCallId = nextAsyncCallId++; + const resultPromise = new Promise((resolve, reject) => { + pendingAsyncCalls[asyncCallId] = { resolve, reject }; + }); + try { + const argsJson = stringifyArgs(args); + getRequiredDispatcher().beginInvokeDotNetFromJS(asyncCallId, assemblyName, methodIdentifier, dotNetObjectId, argsJson); + } + catch (ex) { + // Synchronous failure + completePendingCall(asyncCallId, false, ex); + } + return resultPromise; + } + function getRequiredDispatcher() { + if (dotNetDispatcher !== null) { + return dotNetDispatcher; + } + throw new Error("No .NET call dispatcher has been set."); + } + function completePendingCall(asyncCallId, success, resultOrError) { + if (!pendingAsyncCalls.hasOwnProperty(asyncCallId)) { + throw new Error(`There is no pending async call with ID ${asyncCallId}.`); + } + const asyncCall = pendingAsyncCalls[asyncCallId]; + delete pendingAsyncCalls[asyncCallId]; + if (success) { + asyncCall.resolve(resultOrError); + } + else { + asyncCall.reject(resultOrError); + } + } + /** + * Represents the type of result expected from a JS interop call. + */ + // eslint-disable-next-line no-shadow + let JSCallResultType; + (function (JSCallResultType) { + JSCallResultType[JSCallResultType["Default"] = 0] = "Default"; + JSCallResultType[JSCallResultType["JSObjectReference"] = 1] = "JSObjectReference"; + JSCallResultType[JSCallResultType["JSStreamReference"] = 2] = "JSStreamReference"; + JSCallResultType[JSCallResultType["JSVoidResult"] = 3] = "JSVoidResult"; + })(JSCallResultType = DotNet.JSCallResultType || (DotNet.JSCallResultType = {})); + /** + * Receives incoming calls from .NET and dispatches them to JavaScript. + */ + DotNet.jsCallDispatcher = { + /** + * Finds the JavaScript function matching the specified identifier. + * + * @param identifier Identifies the globally-reachable function to be returned. + * @param targetInstanceId The instance ID of the target JS object. + * @returns A Function instance. + */ + findJSFunction, + /** + * Disposes the JavaScript object reference with the specified object ID. + * + * @param id The ID of the JavaScript object reference. + */ + disposeJSObjectReferenceById, + /** + * Invokes the specified synchronous JavaScript function. + * + * @param identifier Identifies the globally-reachable function to invoke. + * @param argsJson JSON representation of arguments to be passed to the function. + * @param resultType The type of result expected from the JS interop call. + * @param targetInstanceId The instance ID of the target JS object. + * @returns JSON representation of the invocation result. + */ + invokeJSFromDotNet: (identifier, argsJson, resultType, targetInstanceId) => { + const returnValue = findJSFunction(identifier, targetInstanceId).apply(null, parseJsonWithRevivers(argsJson)); + const result = createJSCallResult(returnValue, resultType); + return result === null || result === undefined + ? null + : stringifyArgs(result); + }, + /** + * Invokes the specified synchronous or asynchronous JavaScript function. + * + * @param asyncHandle A value identifying the asynchronous operation. This value will be passed back in a later call to endInvokeJSFromDotNet. + * @param identifier Identifies the globally-reachable function to invoke. + * @param argsJson JSON representation of arguments to be passed to the function. + * @param resultType The type of result expected from the JS interop call. + * @param targetInstanceId The ID of the target JS object instance. + */ + beginInvokeJSFromDotNet: (asyncHandle, identifier, argsJson, resultType, targetInstanceId) => { + // Coerce synchronous functions into async ones, plus treat + // synchronous exceptions the same as async ones + const promise = new Promise(resolve => { + const synchronousResultOrPromise = findJSFunction(identifier, targetInstanceId).apply(null, parseJsonWithRevivers(argsJson)); + resolve(synchronousResultOrPromise); + }); + // We only listen for a result if the caller wants to be notified about it + if (asyncHandle) { + // On completion, dispatch result back to .NET + // Not using "await" because it codegens a lot of boilerplate + promise + .then(result => stringifyArgs([asyncHandle, true, createJSCallResult(result, resultType)])) + .then(result => getRequiredDispatcher().endInvokeJSFromDotNet(asyncHandle, true, result), error => getRequiredDispatcher().endInvokeJSFromDotNet(asyncHandle, false, JSON.stringify([ + asyncHandle, + false, + formatError(error) + ]))); + } + }, + /** + * Receives notification that an async call from JS to .NET has completed. + * @param asyncCallId The identifier supplied in an earlier call to beginInvokeDotNetFromJS. + * @param success A flag to indicate whether the operation completed successfully. + * @param resultJsonOrExceptionMessage Either the operation result as JSON, or an error message. + */ + endInvokeDotNetFromJS: (asyncCallId, success, resultJsonOrExceptionMessage) => { + const resultOrError = success + ? parseJsonWithRevivers(resultJsonOrExceptionMessage) + : new Error(resultJsonOrExceptionMessage); + completePendingCall(parseInt(asyncCallId, 10), success, resultOrError); + }, + /** + * Receives notification that a byte array is being transferred from .NET to JS. + * @param id The identifier for the byte array used during revival. + * @param data The byte array being transferred for eventual revival. + */ + receiveByteArray: (id, data) => { + byteArraysToBeRevived.set(id, data); + }, + /** + * Supplies a stream of data being sent from .NET. + * + * @param streamId The identifier previously passed to JSRuntime's BeginTransmittingStream in .NET code + * @param stream The stream data. + */ + supplyDotNetStream: (streamId, stream) => { + if (pendingDotNetToJSStreams.has(streamId)) { + // The receiver is already waiting, so we can resolve the promise now and stop tracking this + const pendingStream = pendingDotNetToJSStreams.get(streamId); + pendingDotNetToJSStreams.delete(streamId); + pendingStream.resolve(stream); + } + else { + // The receiver hasn't started waiting yet, so track a pre-completed entry it can attach to later + const pendingStream = new PendingStream(); + pendingStream.resolve(stream); + pendingDotNetToJSStreams.set(streamId, pendingStream); + } + } + }; + function formatError(error) { + if (error instanceof Error) { + return `${error.message}\n${error.stack}`; + } + return error ? error.toString() : "null"; + } + function findJSFunction(identifier, targetInstanceId) { + const targetInstance = cachedJSObjectsById[targetInstanceId]; + if (targetInstance) { + return targetInstance.findFunction(identifier); + } + throw new Error(`JS object instance with ID ${targetInstanceId} does not exist (has it been disposed?).`); + } + function disposeJSObjectReferenceById(id) { + delete cachedJSObjectsById[id]; + } + class DotNetObject { + // eslint-disable-next-line no-empty-function + constructor(_id) { + this._id = _id; + } + invokeMethod(methodIdentifier, ...args) { + return invokePossibleInstanceMethod(null, methodIdentifier, this._id, args); + } + invokeMethodAsync(methodIdentifier, ...args) { + return invokePossibleInstanceMethodAsync(null, methodIdentifier, this._id, args); + } + dispose() { + const promise = invokePossibleInstanceMethodAsync(null, "__Dispose", this._id, null); + promise.catch(error => console.error(error)); + } + serializeAsArg() { + return { __dotNetObject: this._id }; + } + } + DotNet.DotNetObject = DotNetObject; + attachReviver(function reviveReference(key, value) { + if (value && typeof value === "object") { + if (value.hasOwnProperty(dotNetObjectRefKey)) { + return new DotNetObject(value[dotNetObjectRefKey]); + } + else if (value.hasOwnProperty(jsObjectIdKey)) { + const id = value[jsObjectIdKey]; + const jsObject = cachedJSObjectsById[id]; + if (jsObject) { + return jsObject.getWrappedObject(); + } + throw new Error(`JS object instance with Id '${id}' does not exist. It may have been disposed.`); + } + else if (value.hasOwnProperty(byteArrayRefKey)) { + const index = value[byteArrayRefKey]; + const byteArray = byteArraysToBeRevived.get(index); + if (byteArray === undefined) { + throw new Error(`Byte array index '${index}' does not exist.`); + } + byteArraysToBeRevived.delete(index); + return byteArray; + } + else if (value.hasOwnProperty(dotNetStreamRefKey)) { + return new DotNetStream(value[dotNetStreamRefKey]); + } + } + // Unrecognized - let another reviver handle it + return value; + }); + class DotNetStream { + constructor(streamId) { + // This constructor runs when we're JSON-deserializing some value from the .NET side. + // At this point we might already have started receiving the stream, or maybe it will come later. + // We have to handle both possible orderings, but we can count on it coming eventually because + // it's not something the developer gets to control, and it would be an error if it doesn't. + if (pendingDotNetToJSStreams.has(streamId)) { + // We've already started receiving the stream, so no longer need to track it as pending + this._streamPromise = pendingDotNetToJSStreams.get(streamId).streamPromise; + pendingDotNetToJSStreams.delete(streamId); + } + else { + // We haven't started receiving it yet, so add an entry to track it as pending + const pendingStream = new PendingStream(); + pendingDotNetToJSStreams.set(streamId, pendingStream); + this._streamPromise = pendingStream.streamPromise; + } + } + /** + * Supplies a readable stream of data being sent from .NET. + */ + stream() { + return this._streamPromise; + } + /** + * Supplies a array buffer of data being sent from .NET. + * Note there is a JavaScript limit on the size of the ArrayBuffer equal to approximately 2GB. + */ + async arrayBuffer() { + return new Response(await this.stream()).arrayBuffer(); + } + } + class PendingStream { + constructor() { + this.streamPromise = new Promise((resolve, reject) => { + this.resolve = resolve; + this.reject = reject; + }); + } + } + function createJSCallResult(returnValue, resultType) { + switch (resultType) { + case JSCallResultType.Default: + return returnValue; + case JSCallResultType.JSObjectReference: + return createJSObjectReference(returnValue); + case JSCallResultType.JSStreamReference: + return createJSStreamReference(returnValue); + case JSCallResultType.JSVoidResult: + return null; + default: + throw new Error(`Invalid JS call result type '${resultType}'.`); + } + } + let nextByteArrayIndex = 0; + function stringifyArgs(args) { + nextByteArrayIndex = 0; + return JSON.stringify(args, argReplacer); + } + function argReplacer(key, value) { + if (value instanceof DotNetObject) { + return value.serializeAsArg(); + } + else if (value instanceof Uint8Array) { + dotNetDispatcher.sendByteArray(nextByteArrayIndex, value); + const jsonValue = { [byteArrayRefKey]: nextByteArrayIndex }; + nextByteArrayIndex++; + return jsonValue; + } + return value; + } +})(DotNet || (DotNet = {})); +//# sourceMappingURL=Microsoft.JSInterop.js.map +;// CONCATENATED MODULE: ./Rendering/Renderer.ts +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + + + + + +const browserRenderers = {}; +let shouldResetScrollAfterNextBatch = false; +function attachRootComponentToLogicalElement(browserRendererId, logicalElement, componentId, appendContent) { + let browserRenderer = browserRenderers[browserRendererId]; + if (!browserRenderer) { + browserRenderer = new BrowserRenderer(browserRendererId); + browserRenderers[browserRendererId] = browserRenderer; + } + browserRenderer.attachRootComponentToLogicalElement(componentId, logicalElement, appendContent); +} +function attachRootComponentToElement(elementSelector, componentId, browserRendererId) { + const afterElementSelector = '::after'; + const beforeElementSelector = '::before'; + let appendContent = false; + if (elementSelector.endsWith(afterElementSelector)) { + elementSelector = elementSelector.slice(0, -afterElementSelector.length); + appendContent = true; + } + else if (elementSelector.endsWith(beforeElementSelector)) { + throw new Error(`The '${beforeElementSelector}' selector is not supported.`); + } + const element = getAndRemovePendingRootComponentContainer(elementSelector) + || document.querySelector(elementSelector); + if (!element) { + throw new Error(`Could not find any element matching selector '${elementSelector}'.`); + } + // 'allowExistingContents' to keep any prerendered content until we do the first client-side render + // Only client-side Blazor supplies a browser renderer ID + attachRootComponentToLogicalElement(browserRendererId || 0, toLogicalElement(element, /* allow existing contents */ true), componentId, appendContent); +} +function getRendererer(browserRendererId) { + return browserRenderers[browserRendererId]; +} +function renderBatch(browserRendererId, batch) { + const browserRenderer = browserRenderers[browserRendererId]; + if (!browserRenderer) { + throw new Error(`There is no browser renderer with ID ${browserRendererId}.`); + } + const arrayRangeReader = batch.arrayRangeReader; + const updatedComponentsRange = batch.updatedComponents(); + const updatedComponentsValues = arrayRangeReader.values(updatedComponentsRange); + const updatedComponentsLength = arrayRangeReader.count(updatedComponentsRange); + const referenceFrames = batch.referenceFrames(); + const referenceFramesValues = arrayRangeReader.values(referenceFrames); + const diffReader = batch.diffReader; + for (let i = 0; i < updatedComponentsLength; i++) { + const diff = batch.updatedComponentsEntry(updatedComponentsValues, i); + const componentId = diffReader.componentId(diff); + const edits = diffReader.edits(diff); + browserRenderer.updateComponent(batch, componentId, edits, referenceFramesValues); + } + const disposedComponentIdsRange = batch.disposedComponentIds(); + const disposedComponentIdsValues = arrayRangeReader.values(disposedComponentIdsRange); + const disposedComponentIdsLength = arrayRangeReader.count(disposedComponentIdsRange); + for (let i = 0; i < disposedComponentIdsLength; i++) { + const componentId = batch.disposedComponentIdsEntry(disposedComponentIdsValues, i); + browserRenderer.disposeComponent(componentId); + } + const disposedEventHandlerIdsRange = batch.disposedEventHandlerIds(); + const disposedEventHandlerIdsValues = arrayRangeReader.values(disposedEventHandlerIdsRange); + const disposedEventHandlerIdsLength = arrayRangeReader.count(disposedEventHandlerIdsRange); + for (let i = 0; i < disposedEventHandlerIdsLength; i++) { + const eventHandlerId = batch.disposedEventHandlerIdsEntry(disposedEventHandlerIdsValues, i); + browserRenderer.disposeEventHandler(eventHandlerId); + } + resetScrollIfNeeded(); +} +function resetScrollAfterNextBatch() { + shouldResetScrollAfterNextBatch = true; +} +function resetScrollIfNeeded() { + if (shouldResetScrollAfterNextBatch) { + shouldResetScrollAfterNextBatch = false; + // This assumes the scroller is on the window itself. There isn't a general way to know + // if some other element is playing the role of the primary scroll region. + window.scrollTo && window.scrollTo(0, 0); + } +} + +;// CONCATENATED MODULE: ./Services/NavigationManager.ts +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + + +let hasEnabledNavigationInterception = false; +let hasRegisteredNavigationEventListeners = false; +let hasLocationChangingEventListeners = false; +let currentHistoryIndex = 0; +let currentLocationChangingCallId = 0; +// Will be initialized once someone registers +let notifyLocationChangedCallback = null; +let notifyLocationChangingCallback = null; +let popStateCallback = onBrowserInitiatedPopState; +let resolveCurrentNavigation = null; +// These are the functions we're making available for invocation from .NET +const internalFunctions = { + listenForNavigationEvents, + enableNavigationInterception, + setHasLocationChangingListeners, + endLocationChanging, + navigateTo: navigateToFromDotNet, + getBaseURI: () => document.baseURI, + getLocationHref: () => location.href, +}; +function listenForNavigationEvents(locationChangedCallback, locationChangingCallback) { + var _a, _b; + notifyLocationChangedCallback = locationChangedCallback; + notifyLocationChangingCallback = locationChangingCallback; + if (hasRegisteredNavigationEventListeners) { + return; + } + hasRegisteredNavigationEventListeners = true; + window.addEventListener('popstate', onPopState); + currentHistoryIndex = (_b = (_a = history.state) === null || _a === void 0 ? void 0 : _a._index) !== null && _b !== void 0 ? _b : 0; +} +function enableNavigationInterception() { + hasEnabledNavigationInterception = true; +} +function setHasLocationChangingListeners(hasListeners) { + hasLocationChangingEventListeners = hasListeners; +} +function attachToEventDelegator(eventDelegator) { + // We need to respond to clicks on elements *after* the EventDelegator has finished + // running its simulated bubbling process so that we can respect any preventDefault requests. + // So instead of registering our own native event, register using the EventDelegator. + eventDelegator.notifyAfterClick(event => { + if (!hasEnabledNavigationInterception) { + return; + } + if (event.button !== 0 || eventHasSpecialKey(event)) { + // Don't stop ctrl/meta-click (etc) from opening links in new tabs/windows + return; + } + if (event.defaultPrevented) { + return; + } + // Intercept clicks on all elements where the href is within the URI space + // We must explicitly check if it has an 'href' attribute, because if it doesn't, the result might be null or an empty string depending on the browser + const anchorTarget = findAnchorTarget(event); + if (anchorTarget && canProcessAnchor(anchorTarget)) { + const href = anchorTarget.getAttribute('href'); + const absoluteHref = toAbsoluteUri(href); + if (isWithinBaseUriSpace(absoluteHref)) { + event.preventDefault(); + performInternalNavigation(absoluteHref, /* interceptedLink */ true, /* replace */ false); + } + } + }); +} +function navigateTo(uri, forceLoadOrOptions, replaceIfUsingOldOverload = false) { + // Normalize the parameters to the newer overload (i.e., using NavigationOptions) + const options = forceLoadOrOptions instanceof Object + ? forceLoadOrOptions + : { forceLoad: forceLoadOrOptions, replaceHistoryEntry: replaceIfUsingOldOverload }; + navigateToCore(uri, options); +} +function navigateToFromDotNet(uri, options) { + // The location changing callback is called from .NET for programmatic navigations originating from .NET. + // In this case, we shouldn't invoke the callback again from the JS side. + navigateToCore(uri, options, /* skipLocationChangingCallback */ true); +} +function navigateToCore(uri, options, skipLocationChangingCallback = false) { + const absoluteUri = toAbsoluteUri(uri); + if (!options.forceLoad && isWithinBaseUriSpace(absoluteUri)) { + performInternalNavigation(absoluteUri, false, options.replaceHistoryEntry, options.historyEntryState, skipLocationChangingCallback); + } + else { + // For external navigation, we work in terms of the originally-supplied uri string, + // not the computed absoluteUri. This is in case there are some special URI formats + // we're unable to translate into absolute URIs. + performExternalNavigation(uri, options.replaceHistoryEntry); + } +} +function performExternalNavigation(uri, replace) { + if (location.href === uri) { + // If you're already on this URL, you can't append another copy of it to the history stack, + // so we can ignore the 'replace' flag. However, reloading the same URL you're already on + // requires special handling to avoid triggering browser-specific behavior issues. + // For details about what this fixes and why, see https://github.com/dotnet/aspnetcore/pull/10839 + const temporaryUri = uri + '?'; + history.replaceState(null, '', temporaryUri); + location.replace(uri); + } + else if (replace) { + location.replace(uri); + } + else { + location.href = uri; + } +} +async function performInternalNavigation(absoluteInternalHref, interceptedLink, replace, state = undefined, skipLocationChangingCallback = false) { + ignorePendingNavigation(); + if (!skipLocationChangingCallback && hasLocationChangingEventListeners) { + const shouldContinueNavigation = await notifyLocationChanging(absoluteInternalHref, state, interceptedLink); + if (!shouldContinueNavigation) { + return; + } + } + // Since this was *not* triggered by a back/forward gesture (that goes through a different + // code path starting with a popstate event), we don't want to preserve the current scroll + // position, so reset it. + // To avoid ugly flickering effects, we don't want to change the scroll position until + // we render the new page. As a best approximation, wait until the next batch. + resetScrollAfterNextBatch(); + if (!replace) { + currentHistoryIndex++; + history.pushState({ + userState: state, + _index: currentHistoryIndex, + }, /* ignored title */ '', absoluteInternalHref); + } + else { + history.replaceState({ + userState: state, + _index: currentHistoryIndex, + }, /* ignored title */ '', absoluteInternalHref); + } + await notifyLocationChanged(interceptedLink); +} +function navigateHistoryWithoutPopStateCallback(delta) { + return new Promise(resolve => { + const oldPopStateCallback = popStateCallback; + popStateCallback = () => { + popStateCallback = oldPopStateCallback; + resolve(); + }; + history.go(delta); + }); +} +function ignorePendingNavigation() { + if (resolveCurrentNavigation) { + resolveCurrentNavigation(false); + resolveCurrentNavigation = null; + } +} +function notifyLocationChanging(uri, state, intercepted) { + return new Promise(resolve => { + ignorePendingNavigation(); + if (!notifyLocationChangingCallback) { + resolve(false); + return; + } + currentLocationChangingCallId++; + resolveCurrentNavigation = resolve; + notifyLocationChangingCallback(currentLocationChangingCallId, uri, state, intercepted); + }); +} +function endLocationChanging(callId, shouldContinueNavigation) { + if (resolveCurrentNavigation && callId === currentLocationChangingCallId) { + resolveCurrentNavigation(shouldContinueNavigation); + resolveCurrentNavigation = null; + } +} +async function onBrowserInitiatedPopState(state) { + var _a, _b, _c; + ignorePendingNavigation(); + if (hasLocationChangingEventListeners) { + const index = (_b = (_a = state.state) === null || _a === void 0 ? void 0 : _a._index) !== null && _b !== void 0 ? _b : 0; + const userState = (_c = state.state) === null || _c === void 0 ? void 0 : _c.userState; + const delta = index - currentHistoryIndex; + const uri = location.href; + // Temporarily revert the navigation until we confirm if the navigation should continue. + await navigateHistoryWithoutPopStateCallback(-delta); + const shouldContinueNavigation = await notifyLocationChanging(uri, userState, false); + if (!shouldContinueNavigation) { + return; + } + await navigateHistoryWithoutPopStateCallback(delta); + } + await notifyLocationChanged(false); +} +async function notifyLocationChanged(interceptedLink) { + var _a; + if (notifyLocationChangedCallback) { + await notifyLocationChangedCallback(location.href, (_a = history.state) === null || _a === void 0 ? void 0 : _a.userState, interceptedLink); + } +} +async function onPopState(state) { + var _a, _b; + if (popStateCallback) { + await popStateCallback(state); + } + currentHistoryIndex = (_b = (_a = history.state) === null || _a === void 0 ? void 0 : _a._index) !== null && _b !== void 0 ? _b : 0; +} +let testAnchor; +function toAbsoluteUri(relativeUri) { + testAnchor = testAnchor || document.createElement('a'); + testAnchor.href = relativeUri; + return testAnchor.href; +} +function findAnchorTarget(event) { + // _blazorDisableComposedPath is a temporary escape hatch in case any problems are discovered + // in this logic. It can be removed in a later release, and should not be considered supported API. + const path = !window['_blazorDisableComposedPath'] && event.composedPath && event.composedPath(); + if (path) { + // This logic works with events that target elements within a shadow root, + // as long as the shadow mode is 'open'. For closed shadows, we can't possibly + // know what internal element was clicked. + for (let i = 0; i < path.length; i++) { + const candidate = path[i]; + if (candidate instanceof Element && candidate.tagName === 'A') { + return candidate; + } + } + return null; + } + else { + // Since we're adding use of composedPath in a patch, retain compatibility with any + // legacy browsers that don't support it by falling back on the older logic, even + // though it won't work properly with ShadowDOM. This can be removed in the next + // major release. + return findClosestAnchorAncestorLegacy(event.target, 'A'); + } +} +function findClosestAnchorAncestorLegacy(element, tagName) { + return !element + ? null + : element.tagName === tagName + ? element + : findClosestAnchorAncestorLegacy(element.parentElement, tagName); +} +function isWithinBaseUriSpace(href) { + const baseUriWithoutTrailingSlash = toBaseUriWithoutTrailingSlash(document.baseURI); + const nextChar = href.charAt(baseUriWithoutTrailingSlash.length); + return href.startsWith(baseUriWithoutTrailingSlash) + && (nextChar === '' || nextChar === '/' || nextChar === '?' || nextChar === '#'); +} +function toBaseUriWithoutTrailingSlash(baseUri) { + return baseUri.substring(0, baseUri.lastIndexOf('/')); +} +function eventHasSpecialKey(event) { + return event.ctrlKey || event.shiftKey || event.altKey || event.metaKey; +} +function canProcessAnchor(anchorTarget) { + const targetAttributeValue = anchorTarget.getAttribute('target'); + const opensInSameFrame = !targetAttributeValue || targetAttributeValue === '_self'; + return opensInSameFrame && anchorTarget.hasAttribute('href') && !anchorTarget.hasAttribute('download'); +} + +;// CONCATENATED MODULE: ./DomWrapper.ts +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +const domFunctions = { + focus: DomWrapper_focus, + focusBySelector, +}; +function DomWrapper_focus(element, preventScroll) { + if (element instanceof HTMLElement) { + element.focus({ preventScroll }); + } + else if (element instanceof SVGElement) { + if (element.hasAttribute('tabindex')) { + element.focus({ preventScroll }); + } + else { + throw new Error('Unable to focus an SVG element that does not have a tabindex.'); + } + } + else { + throw new Error('Unable to focus an invalid element.'); + } +} +function focusBySelector(selector) { + const element = document.querySelector(selector); + if (element) { + // If no explicit tabindex is defined, mark it as programmatically-focusable. + // This does actually add a new HTML attribute, but it shouldn't interfere with + // diffing because diffing only deals with the attributes you have in your code. + if (!element.hasAttribute('tabindex')) { + element.tabIndex = -1; + } + element.focus(); + } +} + +;// CONCATENATED MODULE: ./Virtualize.ts +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +const Virtualize = { + init, + dispose, +}; +const observersByDotNetId = {}; +function findClosestScrollContainer(element) { + // If we recurse up as far as body or the document root, return null so that the + // IntersectionObserver observes intersection with the top-level scroll viewport + // instead of the with body/documentElement which can be arbitrarily tall. + // See https://github.com/dotnet/aspnetcore/issues/37659 for more about what this fixes. + if (!element || element === document.body || element === document.documentElement) { + return null; + } + const style = getComputedStyle(element); + if (style.overflowY !== 'visible') { + return element; + } + return findClosestScrollContainer(element.parentElement); +} +function init(dotNetHelper, spacerBefore, spacerAfter, rootMargin = 50) { + // Overflow anchoring can cause an ongoing scroll loop, because when we resize the spacers, the browser + // would update the scroll position to compensate. Then the spacer would remain visible and we'd keep on + // trying to resize it. + const scrollContainer = findClosestScrollContainer(spacerBefore); + (scrollContainer || document.documentElement).style.overflowAnchor = 'none'; + const rangeBetweenSpacers = document.createRange(); + if (isValidTableElement(spacerAfter.parentElement)) { + spacerBefore.style.display = 'table-row'; + spacerAfter.style.display = 'table-row'; + } + const intersectionObserver = new IntersectionObserver(intersectionCallback, { + root: scrollContainer, + rootMargin: `${rootMargin}px`, + }); + intersectionObserver.observe(spacerBefore); + intersectionObserver.observe(spacerAfter); + const mutationObserverBefore = createSpacerMutationObserver(spacerBefore); + const mutationObserverAfter = createSpacerMutationObserver(spacerAfter); + observersByDotNetId[dotNetHelper._id] = { + intersectionObserver, + mutationObserverBefore, + mutationObserverAfter, + }; + function createSpacerMutationObserver(spacer) { + // Without the use of thresholds, IntersectionObserver only detects binary changes in visibility, + // so if a spacer gets resized but remains visible, no additional callbacks will occur. By unobserving + // and reobserving spacers when they get resized, the intersection callback will re-run if they remain visible. + const observerOptions = { attributes: true }; + const mutationObserver = new MutationObserver((mutations, observer) => { + if (isValidTableElement(spacer.parentElement)) { + observer.disconnect(); + spacer.style.display = 'table-row'; + observer.observe(spacer, observerOptions); + } + intersectionObserver.unobserve(spacer); + intersectionObserver.observe(spacer); + }); + mutationObserver.observe(spacer, observerOptions); + return mutationObserver; + } + function intersectionCallback(entries) { + entries.forEach((entry) => { + var _a; + if (!entry.isIntersecting) { + return; + } + // To compute the ItemSize, work out the separation between the two spacers. We can't just measure an individual element + // because each conceptual item could be made from multiple elements. Using getBoundingClientRect allows for the size to be + // a fractional value. It's important not to add or subtract any such fractional values (e.g., to subtract the 'top' of + // one item from the 'bottom' of another to get the distance between them) because floating point errors would cause + // scrolling glitches. + rangeBetweenSpacers.setStartAfter(spacerBefore); + rangeBetweenSpacers.setEndBefore(spacerAfter); + const spacerSeparation = rangeBetweenSpacers.getBoundingClientRect().height; + const containerSize = (_a = entry.rootBounds) === null || _a === void 0 ? void 0 : _a.height; + if (entry.target === spacerBefore) { + dotNetHelper.invokeMethodAsync('OnSpacerBeforeVisible', entry.intersectionRect.top - entry.boundingClientRect.top, spacerSeparation, containerSize); + } + else if (entry.target === spacerAfter && spacerAfter.offsetHeight > 0) { + // When we first start up, both the "before" and "after" spacers will be visible, but it's only relevant to raise a + // single event to load the initial data. To avoid raising two events, skip the one for the "after" spacer if we know + // it's meaningless to talk about any overlap into it. + dotNetHelper.invokeMethodAsync('OnSpacerAfterVisible', entry.boundingClientRect.bottom - entry.intersectionRect.bottom, spacerSeparation, containerSize); + } + }); + } + function isValidTableElement(element) { + if (element === null) { + return false; + } + return ((element instanceof HTMLTableElement && element.style.display === '') || element.style.display === 'table') + || ((element instanceof HTMLTableSectionElement && element.style.display === '') || element.style.display === 'table-row-group'); + } +} +function dispose(dotNetHelper) { + const observers = observersByDotNetId[dotNetHelper._id]; + if (observers) { + observers.intersectionObserver.disconnect(); + observers.mutationObserverBefore.disconnect(); + observers.mutationObserverAfter.disconnect(); + dotNetHelper.dispose(); + delete observersByDotNetId[dotNetHelper._id]; + } +} + +;// CONCATENATED MODULE: ./Rendering/LogicalElements.ts +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +/* + A LogicalElement plays the same role as an Element instance from the point of view of the + API consumer. Inserting and removing logical elements updates the browser DOM just the same. + + The difference is that, unlike regular DOM mutation APIs, the LogicalElement APIs don't use + the underlying DOM structure as the data storage for the element hierarchy. Instead, the + LogicalElement APIs take care of tracking hierarchical relationships separately. The point + of this is to permit a logical tree structure in which parent/child relationships don't + have to be materialized in terms of DOM element parent/child relationships. And the reason + why we want that is so that hierarchies of Razor components can be tracked even when those + components' render output need not be a single literal DOM element. + + Consumers of the API don't need to know about the implementation, but how it's done is: + - Each LogicalElement is materialized in the DOM as either: + - A Node instance, for actual Node instances inserted using 'insertLogicalChild' or + for Element instances promoted to LogicalElement via 'toLogicalElement' + - A Comment instance, for 'logical container' instances inserted using 'createAndInsertLogicalContainer' + - Then, on that instance (i.e., the Node or Comment), we store an array of 'logical children' + instances, e.g., + [firstChild, secondChild, thirdChild, ...] + ... plus we store a reference to the 'logical parent' (if any) + - The 'logical children' array means we can look up in O(1): + - The number of logical children (not currently implemented because not required, but trivial) + - The logical child at any given index + - Whenever a logical child is added or removed, we update the parent's array of logical children +*/ +const logicalChildrenPropname = createSymbolOrFallback('_blazorLogicalChildren'); +const logicalParentPropname = createSymbolOrFallback('_blazorLogicalParent'); +const logicalEndSiblingPropname = createSymbolOrFallback('_blazorLogicalEnd'); +function toLogicalRootCommentElement(start, end) { + // Now that we support start/end comments as component delimiters we are going to be setting up + // adding the components rendered output as siblings of the start/end tags (between). + // For that to work, we need to appropriately configure the parent element to be a logical element + // with all their children being the child elements. + // For example, imagine you have + // + //

Static content

+ // false diff --git a/backend/tests/FuzzTests/FuzzTests.fsproj b/backend/tests/FuzzTests/FuzzTests.fsproj index ef1cf151b5..a734851759 100644 --- a/backend/tests/FuzzTests/FuzzTests.fsproj +++ b/backend/tests/FuzzTests/FuzzTests.fsproj @@ -1,8 +1,8 @@ Exe - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false diff --git a/backend/tests/TestUtils/TestUtils.fsproj b/backend/tests/TestUtils/TestUtils.fsproj index b2835807f6..c57f585c6a 100644 --- a/backend/tests/TestUtils/TestUtils.fsproj +++ b/backend/tests/TestUtils/TestUtils.fsproj @@ -1,8 +1,8 @@ Library - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror false false diff --git a/backend/tests/Tests/Tests.fsproj b/backend/tests/Tests/Tests.fsproj index a43ac2e704..10be474d3b 100644 --- a/backend/tests/Tests/Tests.fsproj +++ b/backend/tests/Tests/Tests.fsproj @@ -1,8 +1,8 @@ Exe - net6.0 - 6.0 + net7.0 + 7.0 --warnaserror true diff --git a/client/src/appsupport.js b/client/src/appsupport.js index 9019d4b724..7514637f92 100644 --- a/client/src/appsupport.js +++ b/client/src/appsupport.js @@ -550,7 +550,7 @@ setTimeout(function () { // --------------------------- // Initialize blazorworker // --------------------------- - window.Dark.analysis.initializeBlazorWorker(); + //window.Dark.analysis.initializeBlazorWorker(); // --------------------------- // Detect window focus change diff --git a/containers/fsharp-service-Dockerfile b/containers/fsharp-service-Dockerfile index bcdded391a..fdd3d5fb0a 100644 --- a/containers/fsharp-service-Dockerfile +++ b/containers/fsharp-service-Dockerfile @@ -1,12 +1,12 @@ # Base docker image for the FSharp containers we run in production on GCP # FSharp installer image -# Copied from https://github.com/dotnet/dotnet-docker/blob/main/src/runtime/6.0/focal/amd64/Dockerfile +# Copied from https://github.com/dotnet/dotnet-docker/blob/main/src/runtime/7.0/focal/amd64/Dockerfile FROM amd64/buildpack-deps:jammy-curl as installer # Retrieve .NET -RUN curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.300/dotnet-sdk-6.0.300-linux-x64.tar.gz \ - && dotnet_sha512='52d720e90cfb889a92d605d64e6d0e90b96209e1bd7eab00dab1d567017d7a5a4ff4adbc55aff4cffcea4b1bf92bb8d351859d00d8eb65059eec5e449886c938' \ +RUN curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.102/dotnet-sdk-7.0.102-linux-x64.tar.gz \ + && dotnet_sha512='aaa' \ && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ && mkdir -p /dotnet \ && tar -ozxf dotnet.tar.gz -C /dotnet \ @@ -30,7 +30,7 @@ RUN sudo apt-get update \ && sudo rm -rf /var/lib/apt/lists/* ENV \ - DOTNET_SDK_VERSION=6.0.300 \ + DOTNET_SDK_VERSION=7.0.102 \ DOTNET_RUNNING_IN_CONTAINER=true \ DOTNET_EnableDiagnostics=0 diff --git a/containers/gcp-exechost/Dockerfile b/containers/gcp-exechost/Dockerfile index 06edffe2e2..7aebbff69c 100644 --- a/containers/gcp-exechost/Dockerfile +++ b/containers/gcp-exechost/Dockerfile @@ -13,7 +13,7 @@ RUN mkdir app ENV DARK_CONFIG_RUNDIR=/home/dark/gcp-rundir RUN ./scripts/devcontainer/_create-app-directories -COPY --chown=dark:dark backend/Build/out/ExecHost/Release/net6.0/linux-x64/publish/* app/ +COPY --chown=dark:dark backend/Build/out/ExecHost/Release/net7.0/linux-x64/publish/* app/ RUN ./scripts/linting/_check-linked-libs app/ExecHost COPY --chown=dark:dark containers/gcp-exechost/sleep.sh . diff --git a/containers/gcp-fsharp-apiserver/Dockerfile b/containers/gcp-fsharp-apiserver/Dockerfile index 4cc522aefd..a6e106fb20 100644 --- a/containers/gcp-fsharp-apiserver/Dockerfile +++ b/containers/gcp-fsharp-apiserver/Dockerfile @@ -16,7 +16,7 @@ RUN mkdir app ENV DARK_CONFIG_RUNDIR=/home/dark/gcp-rundir RUN ./scripts/devcontainer/_create-app-directories -COPY --chown=dark:dark backend/Build/out/ApiServer/Release/net6.0/linux-x64/publish/* app/ +COPY --chown=dark:dark backend/Build/out/ApiServer/Release/net7.0/linux-x64/publish/* app/ RUN ./scripts/linting/_check-linked-libs app/ApiServer CMD ./app/ApiServer diff --git a/containers/gcp-fsharp-bwdserver/Dockerfile b/containers/gcp-fsharp-bwdserver/Dockerfile index 0ef2976fe2..156bdf5504 100644 --- a/containers/gcp-fsharp-bwdserver/Dockerfile +++ b/containers/gcp-fsharp-bwdserver/Dockerfile @@ -16,7 +16,7 @@ RUN mkdir app ENV DARK_CONFIG_RUNDIR=/home/dark/gcp-rundir RUN ./scripts/devcontainer/_create-app-directories -COPY --chown=dark:dark backend/Build/out/BwdServer/Release/net6.0/linux-x64/publish/* app/ +COPY --chown=dark:dark backend/Build/out/BwdServer/Release/net7.0/linux-x64/publish/* app/ RUN ./scripts/linting/_check-linked-libs app/BwdServer CMD ./app/BwdServer \ No newline at end of file diff --git a/containers/gcp-fsharp-cronchecker/Dockerfile b/containers/gcp-fsharp-cronchecker/Dockerfile index 0f616b85f4..10d606f2a8 100644 --- a/containers/gcp-fsharp-cronchecker/Dockerfile +++ b/containers/gcp-fsharp-cronchecker/Dockerfile @@ -9,7 +9,7 @@ COPY --chown=dark:dark containers/gcp-fsharp-cronchecker/gcp-run-fsharp-cronchec RUN mkdir app -COPY --chown=dark:dark backend/Build/out/CronChecker/Release/net6.0/linux-x64/publish/* app/ +COPY --chown=dark:dark backend/Build/out/CronChecker/Release/net7.0/linux-x64/publish/* app/ RUN ./scripts/linting/_check-linked-libs app/CronChecker diff --git a/containers/gcp-fsharp-queueworker/Dockerfile b/containers/gcp-fsharp-queueworker/Dockerfile index 525078a278..8bf15a40b0 100644 --- a/containers/gcp-fsharp-queueworker/Dockerfile +++ b/containers/gcp-fsharp-queueworker/Dockerfile @@ -12,7 +12,7 @@ RUN mkdir app ENV DARK_CONFIG_RUNDIR=/home/dark/gcp-rundir RUN ./scripts/devcontainer/_create-app-directories -COPY --chown=dark:dark backend/Build/out/QueueWorker/Release/net6.0/linux-x64/publish/* app/ +COPY --chown=dark:dark backend/Build/out/QueueWorker/Release/net7.0/linux-x64/publish/* app/ RUN ./scripts/linting/_check-linked-libs app/QueueWorker CMD ./app/QueueWorker diff --git a/package-lock.json b/package-lock.json index e213150f21..37b8a4d461 100644 --- a/package-lock.json +++ b/package-lock.json @@ -264,7 +264,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, "available-typed-arrays": { @@ -858,7 +858,7 @@ "decache": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/decache/-/decache-3.1.0.tgz", - "integrity": "sha512-p7D6wJ5EJFFq1CcF2lu1XeqKFLBob8jRQGNAvFLTsV3CbSKBl3VtliAVlUIGz2i9H6kEFnI2Amaft5ZopIG2Fw==", + "integrity": "sha1-T1A2+9ZYH8yXI3rDlUokS5U2wto=", "optional": true, "requires": { "find": "^0.2.4" @@ -894,7 +894,7 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, "dependency-graph": { @@ -1188,7 +1188,7 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, "fast-safe-stringify": { @@ -1218,7 +1218,7 @@ "find": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/find/-/find-0.2.9.tgz", - "integrity": "sha512-7a4/LCiInB9xYMnAUEjLilL9FKclwbwK7VlXw+h5jMvT2TDFeYFCHM24O1XdnC/on/hx8mxVO3FTQkyHZnOghQ==", + "integrity": "sha1-S3Px/55WrZG3bnFkB/5f/mVUu4w=", "optional": true, "requires": { "traverse-chain": "~0.1.0" @@ -1651,7 +1651,7 @@ "is_js": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/is_js/-/is_js-0.9.0.tgz", - "integrity": "sha512-8Y5EHSH+TonfUHX2g3pMJljdbGavg55q4jmHzghJCdqYDbdNROC8uw/YFQwIRCRqRJT1EY3pJefz+kglw+o7sg==" + "integrity": "sha1-CrlFQFArp6+iTIVqqYVWFmnpxS0=" }, "isarray": { "version": "1.0.0", @@ -1714,7 +1714,7 @@ "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "jsonfile": { "version": "6.1.0", @@ -1753,7 +1753,7 @@ "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { "prelude-ls": "~1.1.2", @@ -1775,7 +1775,7 @@ "lru-cache": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.2.4.tgz", - "integrity": "sha512-Q5pAgXs+WEAfoEdw2qKQhNFFhMoFMTYqRVKKUMnzuiR7oKFHS7fWo848cPcTKw+4j/IdN17NyzdhVKgabFV0EA==" + "integrity": "sha1-bGWGGb7PFAMdDQtZSxYELOTcBj0=" }, "md5.js": { "version": "1.3.5", @@ -2247,7 +2247,7 @@ "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "postcss": { @@ -2367,7 +2367,7 @@ "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, "pretty-hrtime": { @@ -2543,7 +2543,7 @@ "request-ip": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/request-ip/-/request-ip-2.0.2.tgz", - "integrity": "sha512-Y6LxqTmxLKKDk2I5tU2sxoCSKAnWJ42jmGqixNrH+oYoAyncpal7fFF5gqJ2bbgkRmb9qYNxdD6KFHfLS4dKBA==", + "integrity": "sha1-3urm1K8hdoSX24zQX6NxQ/jxJX4=", "requires": { "is_js": "^0.9.0" } @@ -2551,7 +2551,7 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, "requires-port": { @@ -3157,7 +3157,7 @@ "traverse-chain": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", - "integrity": "sha512-up6Yvai4PYKhpNp5PkYtx50m3KbwQrqDwbuZP/ItyL64YEWHAvH6Md83LFLV/GRSk/BoUVwwgUzX6SOQSbsfAg==", + "integrity": "sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE=", "optional": true }, "tty-browserify": { @@ -3174,7 +3174,7 @@ "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { "prelude-ls": "~1.1.2" diff --git a/scripts/build/compile b/scripts/build/compile index f98199fd8a..ca65499bb8 100755 --- a/scripts/build/compile +++ b/scripts/build/compile @@ -96,12 +96,12 @@ def copy_backend_static(): if optimize: wwwroot = run_backend( start, - "rsync -a backend/Build/out/Wasm/Release/net6.0/publish/wwwroot/_framework/ backend/static/blazor/" + "rsync -a backend/Build/out/Wasm/Release/net7.0/publish/wwwroot/_framework/ backend/static/blazor/" ) else: wwwroot = run_backend( start, - "rsync -a backend/Build/out/Wasm/Debug/net6.0/wwwroot/_framework/ backend/static/blazor/" + "rsync -a backend/Build/out/Wasm/Debug/net7.0/wwwroot/_framework/ backend/static/blazor/" ) return blazor and wwwroot diff --git a/scripts/build/dotnet-regen-fsi b/scripts/build/dotnet-regen-fsi index 6b663dacad..0c1f615bad 100755 --- a/scripts/build/dotnet-regen-fsi +++ b/scripts/build/dotnet-regen-fsi @@ -6,4 +6,4 @@ set -euo pipefail cd backend rm -f paket-files/paket.restore.cached dotnet restore fsdark.sln -dotnet paket generate-load-scripts --framework net6.0 +dotnet paket generate-load-scripts --framework net7.0 diff --git a/scripts/build/fsi-setup.fsx b/scripts/build/fsi-setup.fsx index d51a0aafe4..337cf953a4 100644 --- a/scripts/build/fsi-setup.fsx +++ b/scripts/build/fsi-setup.fsx @@ -8,26 +8,26 @@ printfn "Loading program; if something wrong run ./scripts/build/dotnet-regen-fs #I "../../backend/.paket/" #I "../../backend/Build/out" -#load ".paket/load/net6.0/main.group.fsx" -#r "Tablecloth/Debug/net6.0/Tablecloth.dll" -#r "Prelude/Debug/net6.0/Prelude.dll" -#r "LibService/Debug/net6.0/LibService.dll" -#r "LibExecution/Debug/net6.0/linux-x64/LibExecution.dll" -#r "LibBackend/Debug/net6.0/LibBackend.dll" -#r "ApiServer/Debug/net6.0/linux-x64/ApiServer.dll" -#r "BwdServer/Debug/net6.0/linux-x64/BwdServer.dll" -#r "TestUtils/Debug/net6.0/TestUtils.dll" -#r "Tests/Debug/net6.0/linux-x64/Tests.dll" -#r "FuzzTests/Debug/net6.0/FuzzTests.dll" -#r "Wasm/Debug/net6.0/Wasm.dll" -#r "BackendOnlyStdLib/Debug/net6.0/BackendOnlyStdLib.dll" -// #r "ExecHost/Debug/net6.0/ExecHost.dll" -#r "HttpMiddleware/Debug/net6.0/HttpMiddleware.dll" -#r "LibAnalysis/Debug/net6.0/linux-x64/LibAnalysis.dll" -#r "LibBinarySerialization/Debug/net6.0/LibBinarySerialization.dll" -#r "LibExecutionStdLib/Debug/net6.0/LibExecutionStdLib.dll" -#r "LibRealExecution/Debug/net6.0/LibRealExecution.dll" -// #r "QueueWorker/Debug/net6.0/QueueWorker.dll" +#load ".paket/load/net7.0/main.group.fsx" +#r "Tablecloth/Debug/net7.0/Tablecloth.dll" +#r "Prelude/Debug/net7.0/Prelude.dll" +#r "LibService/Debug/net7.0/LibService.dll" +#r "LibExecution/Debug/net7.0/linux-x64/LibExecution.dll" +#r "LibBackend/Debug/net7.0/LibBackend.dll" +#r "ApiServer/Debug/net7.0/linux-x64/ApiServer.dll" +#r "BwdServer/Debug/net7.0/linux-x64/BwdServer.dll" +#r "TestUtils/Debug/net7.0/TestUtils.dll" +#r "Tests/Debug/net7.0/linux-x64/Tests.dll" +#r "FuzzTests/Debug/net7.0/FuzzTests.dll" +#r "Wasm/Debug/net7.0/Wasm.dll" +#r "BackendOnlyStdLib/Debug/net7.0/BackendOnlyStdLib.dll" +// #r "ExecHost/Debug/net7.0/ExecHost.dll" +#r "HttpMiddleware/Debug/net7.0/HttpMiddleware.dll" +#r "LibAnalysis/Debug/net7.0/linux-x64/LibAnalysis.dll" +#r "LibBinarySerialization/Debug/net7.0/LibBinarySerialization.dll" +#r "LibExecutionStdLib/Debug/net7.0/LibExecutionStdLib.dll" +#r "LibRealExecution/Debug/net7.0/LibRealExecution.dll" +// #r "QueueWorker/Debug/net7.0/QueueWorker.dll" // Convenience shortcuts module RT = LibExecution.RuntimeTypes @@ -36,4 +36,4 @@ module PT = LibExecution.ProgramTypes open Prelude //open FSI -printfn "Loaded and ready to go" +printfn "Loaded and ready to go" \ No newline at end of file diff --git a/scripts/build/regenerate-test-files b/scripts/build/regenerate-test-files index 691d85725e..d464d17c86 100755 --- a/scripts/build/regenerate-test-files +++ b/scripts/build/regenerate-test-files @@ -13,7 +13,7 @@ sha1sum "$binfile" echo -e "\n\nRegenerating: " cd backend -Build/out/Tests/Debug/net6.0/linux-x64/Tests --regenerate-test-files +Build/out/Tests/Debug/net7.0/linux-x64/Tests --regenerate-test-files cd .. echo -e "\n\nAfter: " diff --git a/scripts/run-backend-datatests b/scripts/run-backend-datatests index a2042a1ebc..1cdd6651b8 100755 --- a/scripts/run-backend-datatests +++ b/scripts/run-backend-datatests @@ -12,7 +12,7 @@ function ctrl_c() { killall -9 Tests || true -EXE=Build/out/DataTests/Debug/net6.0/linux-x64/DataTests +EXE=Build/out/DataTests/Debug/net7.0/linux-x64/DataTests # No migrations diff --git a/scripts/run-backend-fuzzer b/scripts/run-backend-fuzzer index 4e304efd65..441bd1b642 100755 --- a/scripts/run-backend-fuzzer +++ b/scripts/run-backend-fuzzer @@ -12,7 +12,7 @@ function ctrl_c() { killall -9 FuzzTests || true -EXE=Build/out/FuzzTests/Debug/net6.0/FuzzTests +EXE=Build/out/FuzzTests/Debug/net7.0/FuzzTests # Expecto has a number of async bugs causing it to hang. It appears to be due # to the test framework though it's hard to tell. It's solved by disabling the diff --git a/scripts/run-backend-server b/scripts/run-backend-server index 1110f485e1..d03831c744 100755 --- a/scripts/run-backend-server +++ b/scripts/run-backend-server @@ -38,17 +38,17 @@ if [[ "${RUNNING}" == "true" && "${RESTART}" == "false" ]]; then fi if [[ "$PUBLISHED" == "true" ]]; then - APISERVER_BINPATH="backend/Build/out/ApiServer/Release/net6.0/linux-x64/publish/" - BWDSERVER_BINPATH="backend/Build/out/BwdServer/Release/net6.0/linux-x64/publish/" - CRONCHECKER_BINPATH="backend/Build/out/CronChecker/Release/net6.0/linux-x64/publish/" - QUEUEWORKER_BINPATH="backend/Build/out/QueueWorker/Release/net6.0/linux-x64/publish/" - EXECHOST_BINPATH="backend/Build/out/ExecHost/Release/net6.0/linux-x64/publish/" + APISERVER_BINPATH="backend/Build/out/ApiServer/Release/net7.0/linux-x64/publish/" + BWDSERVER_BINPATH="backend/Build/out/BwdServer/Release/net7.0/linux-x64/publish/" + CRONCHECKER_BINPATH="backend/Build/out/CronChecker/Release/net7.0/linux-x64/publish/" + QUEUEWORKER_BINPATH="backend/Build/out/QueueWorker/Release/net7.0/linux-x64/publish/" + EXECHOST_BINPATH="backend/Build/out/ExecHost/Release/net7.0/linux-x64/publish/" else - APISERVER_BINPATH="backend/Build/out/ApiServer/Debug/net6.0/linux-x64/" - BWDSERVER_BINPATH="backend/Build/out/BwdServer/Debug/net6.0/linux-x64/" - CRONCHECKER_BINPATH="backend/Build/out/CronChecker/Debug/net6.0/linux-x64/" - QUEUEWORKER_BINPATH="backend/Build/out/QueueWorker/Debug/net6.0/linux-x64/" - EXECHOST_BINPATH="backend/Build/out/ExecHost/Debug/net6.0/linux-x64/" + APISERVER_BINPATH="backend/Build/out/ApiServer/Debug/net7.0/linux-x64/" + BWDSERVER_BINPATH="backend/Build/out/BwdServer/Debug/net7.0/linux-x64/" + CRONCHECKER_BINPATH="backend/Build/out/CronChecker/Debug/net7.0/linux-x64/" + QUEUEWORKER_BINPATH="backend/Build/out/QueueWorker/Debug/net7.0/linux-x64/" + EXECHOST_BINPATH="backend/Build/out/ExecHost/Debug/net7.0/linux-x64/" fi APISERVER_EXE="${APISERVER_BINPATH}/ApiServer" diff --git a/scripts/run-backend-tests b/scripts/run-backend-tests index 96b4dc54c5..7a16aa7983 100755 --- a/scripts/run-backend-tests +++ b/scripts/run-backend-tests @@ -27,11 +27,11 @@ done killall -9 Tests || true if [[ "$PUBLISHED" == "true" ]]; then - EXE=Build/out/Tests/Release/net6.0/linux-x64/Tests - EXECHOST=Build/out/ExecHost/Release/net6.0/linux-x64/ExecHost + EXE=Build/out/Tests/Release/net7.0/linux-x64/Tests + EXECHOST=Build/out/ExecHost/Release/net7.0/linux-x64/ExecHost else - EXE=Build/out/Tests/Debug/net6.0/linux-x64/Tests - EXECHOST=Build/out/ExecHost/Debug/net6.0/linux-x64/ExecHost + EXE=Build/out/Tests/Debug/net7.0/linux-x64/Tests + EXECHOST=Build/out/ExecHost/Debug/net7.0/linux-x64/ExecHost fi echo "Dropping testdb database" diff --git a/scripts/run-exec-host b/scripts/run-exec-host index c9e044c097..1e869686fe 100755 --- a/scripts/run-exec-host +++ b/scripts/run-exec-host @@ -16,9 +16,9 @@ do done if [[ "$PUBLISHED" == "true" ]]; then - EXE="backend/Build/out/ExecHost/Release/net6.0/linux-x64/publish/ExecHost" + EXE="backend/Build/out/ExecHost/Release/net7.0/linux-x64/publish/ExecHost" else - EXE="backend/Build/out/ExecHost/Debug/net6.0/linux-x64/ExecHost" + EXE="backend/Build/out/ExecHost/Debug/net7.0/linux-x64/ExecHost" fi "${EXE}" "$@" diff --git a/scripts/run-prodclone-exec-host b/scripts/run-prodclone-exec-host index 735852858d..182a205ca6 100755 --- a/scripts/run-prodclone-exec-host +++ b/scripts/run-prodclone-exec-host @@ -17,9 +17,9 @@ done if [[ "$PUBLISHED" == "true" ]]; then - EXE="backend/Build/out/ExecHost/Release/net6.0/linux-x64/publish/ExecHost" + EXE="backend/Build/out/ExecHost/Release/net7.0/linux-x64/publish/ExecHost" else - EXE="backend/Build/out/ExecHost/Debug/net6.0/linux-x64/ExecHost" + EXE="backend/Build/out/ExecHost/Debug/net7.0/linux-x64/ExecHost" fi DARK_CONFIG_TELEMETRY_EXPORTER=none \ diff --git a/services/apiserver-deployment-darklang/nginx.conf b/services/apiserver-deployment-darklang/nginx.conf index 286c0d36c8..f2e4c69a21 100644 --- a/services/apiserver-deployment-darklang/nginx.conf +++ b/services/apiserver-deployment-darklang/nginx.conf @@ -93,7 +93,7 @@ server { # These prefixes are handled by the backend. location ~ (/a/|/api/|/login|/logout|/check-apiserver) { - # https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-6.0#configure-nginx + # https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-7.0#configure-nginx proxy_pass http://localhost:9001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade;