From b51bc6d0d05f4dccaf1e46c295e4a46edd375a35 Mon Sep 17 00:00:00 2001 From: MagicCodingMan Date: Sat, 28 Nov 2026 16:37:44 -0500 Subject: [PATCH 1/4] Upgrade Magic IndexedDB, CLI, and validation to .NET 11 --- .../scripts/test-calculate-package-version.sh | 2 ++ .github/scripts/test-migration-cli.sh | 6 ++--- .github/scripts/test-numeric-wasm.mjs | 2 +- .github/workflows/publish-nuget.yml | 4 ++-- .github/workflows/validate-browsers.yml | 14 ++++++------ .github/workflows/validate-dotnet.yml | 4 ++-- .github/workflows/validate-migrations.yml | 22 +++++++++---------- E2eTest/E2eTest.csproj | 4 ++-- E2eTest/benchmarks/encryption-envelope.mjs | 2 +- E2eTest/benchmarks/encryption-wasm.mjs | 2 +- E2eTestWebApp/E2eTestWebApp.csproj | 2 +- IndexDb.Example/IndexDb.Example.csproj | 8 +++---- .../Magic.IndexedDb.Cli.csproj | 4 ++-- Magic.IndexedDb.Cli/README.md | 2 +- Magic.IndexedDb.Cli/SchemaSource.cs | 2 +- .../Magic.IndexedDb.UnitTests.csproj | 2 +- Magic.IndexedDb/Magic.IndexedDb.csproj | 12 +++++----- NumericWasmTest/NumericWasmTest.csproj | 4 ++-- README.md | 2 +- TestBase/TestBase.csproj | 2 +- .../TestServer.Client.csproj | 4 ++-- TestServer/TestServer/TestServer.csproj | 4 ++-- TestWasm/TestWasm.csproj | 6 ++--- docs/README.md | 2 +- docs/contributing/migration-testing.md | 10 ++++----- docs/contributing/testing.md | 4 ++-- docs/getting-started/installation.md | 2 +- docs/guides/migration-cli.md | 6 ++--- docs/guides/migration-schema.md | 2 +- global.json | 2 +- .../Magic.IndexedDb.Cli.ContractTests.csproj | 2 +- .../MigrationCliConsumer.csproj | 2 +- .../BrowserDriver/BrowserDriver.csproj | 2 +- tests/migrations/ProtectedWasm/App/App.csproj | 4 ++-- .../ProtectedWasm/Exporter/Exporter.csproj | 2 +- tests/migrations/RecoveryWasm/App/App.csproj | 4 ++-- .../RecoveryWasm/Exporter/Exporter.csproj | 2 +- .../migrations/ReleasedUpgrade/App/App.csproj | 4 ++-- .../ReleasedUpgrade/Exporter/Exporter.csproj | 2 +- tests/migrations/ReleasedUpgrade/run.mjs | 2 +- tests/migrations/run.mjs | 2 +- 41 files changed, 87 insertions(+), 85 deletions(-) diff --git a/.github/scripts/test-calculate-package-version.sh b/.github/scripts/test-calculate-package-version.sh index 2f7e80c6..d4c65801 100644 --- a/.github/scripts/test-calculate-package-version.sh +++ b/.github/scripts/test-calculate-package-version.sh @@ -51,6 +51,8 @@ assert_version "3.0.0" '{"versions":["3.0.0"]}' "3.0.1" assert_version "3.0.0" '{"versions":["3.0.2","3.1.0"]}' "3.0.3" assert_version "3.0.1" '{"versions":["3.0.0"]}' "3.0.1" assert_version "3.0.2" '{"versions":["3.0.0"]}' "3.0.2" +assert_version "4.0.0" '{"versions":["3.1.0","4.0.0-preview.1"]}' "4.0.0" +assert_version "4.0.0" '{"versions":["3.1.0","4.0.0"]}' "4.0.1" assert_version "3.0.1" '{"versions":["3.0.1"]}' "3.0.2" assert_failure "3.0.0-preview.1" '{"versions":["2.0.7"]}' assert_failure "2.0" '{"versions":["2.0.2"]}' diff --git a/.github/scripts/test-migration-cli.sh b/.github/scripts/test-migration-cli.sh index 80f02055..916dc181 100755 --- a/.github/scripts/test-migration-cli.sh +++ b/.github/scripts/test-migration-cli.sh @@ -76,9 +76,9 @@ node tests/migrations/author-protected-transition.mjs "$magicdb" "$scratch_root/ # Real installed-package -> MSBuild-selected project SDK -> isolated exporter -> # shared runtime schema resolver. No application assembly is loaded by the tool. "$magicdb" databases list --project tests/MigrationCliConsumer/MigrationCliConsumer.csproj \ - --framework net10.0 --configuration Release --json > "$artifact_root/consumer-list.json" + --framework net11.0 --configuration Release --json > "$artifact_root/consumer-list.json" "$magicdb" schema export --project tests/MigrationCliConsumer/MigrationCliConsumer.csproj \ - --framework net10.0 --configuration Release --output "$artifact_root/consumer-model.json" --json > "$artifact_root/consumer-export.json" + --framework net11.0 --configuration Release --output "$artifact_root/consumer-model.json" --json > "$artifact_root/consumer-export.json" "$magicdb" migrations add Initial --schema "$artifact_root/consumer-model.json" \ --directory "$artifact_root/consumer" --json > "$artifact_root/consumer-add.json" "$magicdb" migrations validate --project tests/MigrationCliConsumer/MigrationCliConsumer.csproj \ @@ -95,7 +95,7 @@ fi dotnet build tests/Magic.IndexedDb.Cli.ContractTests/Magic.IndexedDb.Cli.ContractTests.csproj \ --configuration Release > "$artifact_root/contract-build.log" 2>&1 -dotnet tests/Magic.IndexedDb.Cli.ContractTests/bin/Release/net10.0/Magic.IndexedDb.Cli.ContractTests.dll \ +dotnet tests/Magic.IndexedDb.Cli.ContractTests/bin/Release/net11.0/Magic.IndexedDb.Cli.ContractTests.dll \ > "$artifact_root/contract-results.json" node --input-type=module - "$artifact_root" <<'JS' diff --git a/.github/scripts/test-numeric-wasm.mjs b/.github/scripts/test-numeric-wasm.mjs index 0e0ceec1..d99438e3 100644 --- a/.github/scripts/test-numeric-wasm.mjs +++ b/.github/scripts/test-numeric-wasm.mjs @@ -4,7 +4,7 @@ import path from 'node:path'; import { pathToFileURL } from 'node:url'; const wwwroot = path.resolve(process.argv[2] ?? 'artifacts/numeric-wasm/wwwroot'); -const playwrightEntry = path.resolve(process.argv[3] ?? 'E2eTest/bin/Release/net10.0/.playwright/package/index.mjs'); +const playwrightEntry = path.resolve(process.argv[3] ?? 'E2eTest/bin/Release/net11.0/.playwright/package/index.mjs'); const outputDirectory = path.resolve(process.argv[4] ?? 'artifacts/numeric-wasm-results'); const expectedScenarios = [ 'RoundTripAndStream', diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index cbb4fb87..7824186c 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -52,10 +52,10 @@ jobs: with: persist-credentials: false - - name: Set up .NET 10 + - name: Set up .NET 11 uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6 with: - dotnet-version: 10.0.x + dotnet-version: 11.0.x - name: Calculate package version id: version diff --git a/.github/workflows/validate-browsers.yml b/.github/workflows/validate-browsers.yml index 418ebdf5..0204540a 100644 --- a/.github/workflows/validate-browsers.yml +++ b/.github/workflows/validate-browsers.yml @@ -47,10 +47,10 @@ jobs: with: persist-credentials: false - - name: Set up .NET 10 + - name: Set up .NET 11 uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6 with: - dotnet-version: 10.0.x + dotnet-version: 11.0.x - name: Restore browser tests run: dotnet restore E2eTest/E2eTest.csproj @@ -61,12 +61,12 @@ jobs: - name: Install browser and Linux dependencies if: ${{ runner.os == 'Linux' }} shell: pwsh - run: E2eTest/bin/Release/net10.0/playwright.ps1 install --with-deps ${{ matrix.browser }} + run: E2eTest/bin/Release/net11.0/playwright.ps1 install --with-deps ${{ matrix.browser }} - name: Install browser on macOS if: ${{ runner.os == 'macOS' }} shell: pwsh - run: E2eTest/bin/Release/net10.0/playwright.ps1 install ${{ matrix.browser }} + run: E2eTest/bin/Release/net11.0/playwright.ps1 install ${{ matrix.browser }} - name: Run browser integration tests if: ${{ runner.os == 'Linux' }} @@ -161,10 +161,10 @@ jobs: with: persist-credentials: false - - name: Set up .NET 10 + - name: Set up .NET 11 uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6 with: - dotnet-version: 10.0.x + dotnet-version: 11.0.x - name: Install WebAssembly compilation tools run: dotnet workload install wasm-tools @@ -180,7 +180,7 @@ jobs: run: dotnet build E2eTest/E2eTest.csproj --configuration Release - name: Install Chromium and dependencies - run: node E2eTest/bin/Release/net10.0/.playwright/package/cli.js install --with-deps chromium + run: node E2eTest/bin/Release/net11.0/.playwright/package/cli.js install --with-deps chromium - name: Run numeric scenarios and record benchmark run: node .github/scripts/test-numeric-wasm.mjs diff --git a/.github/workflows/validate-dotnet.yml b/.github/workflows/validate-dotnet.yml index f17a76de..363c355f 100644 --- a/.github/workflows/validate-dotnet.yml +++ b/.github/workflows/validate-dotnet.yml @@ -31,10 +31,10 @@ jobs: with: persist-credentials: false - - name: Set up .NET 10 + - name: Set up .NET 11 uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6 with: - dotnet-version: 10.0.x + dotnet-version: 11.0.x - name: Restore unit tests run: dotnet restore Magic.IndexedDb.UnitTests/Magic.IndexedDb.UnitTests.csproj diff --git a/.github/workflows/validate-migrations.yml b/.github/workflows/validate-migrations.yml index f880ca76..6ddf298b 100644 --- a/.github/workflows/validate-migrations.yml +++ b/.github/workflows/validate-migrations.yml @@ -48,10 +48,10 @@ jobs: with: persist-credentials: false - - name: Set up .NET 10 + - name: Set up .NET 11 uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6 with: - dotnet-version: 10.0.x + dotnet-version: 11.0.x - name: Set up Node.js 24 uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 @@ -105,10 +105,10 @@ jobs: with: persist-credentials: false - - name: Set up .NET 10 + - name: Set up .NET 11 uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6 with: - dotnet-version: 10.0.x + dotnet-version: 11.0.x - name: Set up Node.js 24 uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 @@ -126,11 +126,11 @@ jobs: - name: Install browser and Linux dependencies if: ${{ runner.os == 'Linux' }} - run: node tests/migrations/BrowserDriver/bin/Release/net10.0/.playwright/package/cli.js install --with-deps ${{ matrix.browser }} + run: node tests/migrations/BrowserDriver/bin/Release/net11.0/.playwright/package/cli.js install --with-deps ${{ matrix.browser }} - name: Install browser on macOS if: ${{ runner.os == 'macOS' }} - run: node tests/migrations/BrowserDriver/bin/Release/net10.0/.playwright/package/cli.js install ${{ matrix.browser }} + run: node tests/migrations/BrowserDriver/bin/Release/net11.0/.playwright/package/cli.js install ${{ matrix.browser }} - name: Verify the original MIT v1 compatibility engine working-directory: tests/migrations/fixtures/recovery-v1 @@ -143,7 +143,7 @@ jobs: run: >- node tests/migrations/run.mjs ${{ matrix.browser }} - tests/migrations/BrowserDriver/bin/Release/net10.0/.playwright/package/index.mjs + tests/migrations/BrowserDriver/bin/Release/net11.0/.playwright/package/index.mjs artifacts/migration-browser/${{ matrix.browser }}-${{ runner.os }} - name: Upload complete migration evidence @@ -166,7 +166,7 @@ jobs: persist-credentials: false - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6 with: - dotnet-version: 10.0.x + dotnet-version: 11.0.x - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 with: node-version: 24 @@ -219,7 +219,7 @@ jobs: persist-credentials: false - uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6 with: - dotnet-version: 10.0.x + dotnet-version: 11.0.x - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 with: node-version: 24 @@ -235,7 +235,7 @@ jobs: mkdir -p artifacts/released-upgrade tar -C artifacts/released-upgrade -xzf artifacts/released-upgrade.tar.gz dotnet build tests/migrations/BrowserDriver/BrowserDriver.csproj -c Release - driver=tests/migrations/BrowserDriver/bin/Release/net10.0/.playwright/package + driver=tests/migrations/BrowserDriver/bin/Release/net11.0/.playwright/package if [[ "$RUNNER_PLATFORM" == Linux ]]; then node "$driver/cli.js" install --with-deps "$BROWSER" else @@ -247,7 +247,7 @@ jobs: BROWSER: ${{ matrix.browser }} run: | set -o pipefail - driver=tests/migrations/BrowserDriver/bin/Release/net10.0/.playwright/package/index.mjs + driver=tests/migrations/BrowserDriver/bin/Release/net11.0/.playwright/package/index.mjs fixture=artifacts/released-upgrade status=0 for mode in trimmed aot; do diff --git a/E2eTest/E2eTest.csproj b/E2eTest/E2eTest.csproj index 5c745914..764a48e5 100644 --- a/E2eTest/E2eTest.csproj +++ b/E2eTest/E2eTest.csproj @@ -1,7 +1,7 @@  - net10.0 + net11.0 latest enable enable @@ -9,7 +9,7 @@ - + diff --git a/E2eTest/benchmarks/encryption-envelope.mjs b/E2eTest/benchmarks/encryption-envelope.mjs index 40451d1e..85457edf 100644 --- a/E2eTest/benchmarks/encryption-envelope.mjs +++ b/E2eTest/benchmarks/encryption-envelope.mjs @@ -2,7 +2,7 @@ // node E2eTest/benchmarks/encryption-envelope.mjs import { createServer } from "node:http"; import { readFile } from "node:fs/promises"; -import { chromium } from "../bin/Release/net10.0/.playwright/package/index.mjs"; +import { chromium } from "../bin/Release/net11.0/.playwright/package/index.mjs"; const moduleSource = await readFile(new URL( "../../Magic.IndexedDb/wwwroot/utilities/encryptionEnvelope.js", import.meta.url)); diff --git a/E2eTest/benchmarks/encryption-wasm.mjs b/E2eTest/benchmarks/encryption-wasm.mjs index 9d15f437..61c46da9 100644 --- a/E2eTest/benchmarks/encryption-wasm.mjs +++ b/E2eTest/benchmarks/encryption-wasm.mjs @@ -6,7 +6,7 @@ import { createServer } from "node:http"; import { createReadStream } from "node:fs"; import { stat } from "node:fs/promises"; import path from "node:path"; -import { chromium, firefox, webkit } from "../bin/Release/net10.0/.playwright/package/index.mjs"; +import { chromium, firefox, webkit } from "../bin/Release/net11.0/.playwright/package/index.mjs"; const root = path.resolve(process.argv[2]); const engine = process.argv[3] ?? "chromium"; diff --git a/E2eTestWebApp/E2eTestWebApp.csproj b/E2eTestWebApp/E2eTestWebApp.csproj index fdf12510..32248945 100644 --- a/E2eTestWebApp/E2eTestWebApp.csproj +++ b/E2eTestWebApp/E2eTestWebApp.csproj @@ -1,7 +1,7 @@ - net10.0 + net11.0 enable enable diff --git a/IndexDb.Example/IndexDb.Example.csproj b/IndexDb.Example/IndexDb.Example.csproj index 31293282..a57257d7 100644 --- a/IndexDb.Example/IndexDb.Example.csproj +++ b/IndexDb.Example/IndexDb.Example.csproj @@ -1,16 +1,16 @@  - net10.0 + net11.0 enable enable service-worker-assets.js - - - + + + diff --git a/Magic.IndexedDb.Cli/Magic.IndexedDb.Cli.csproj b/Magic.IndexedDb.Cli/Magic.IndexedDb.Cli.csproj index 18ffabeb..d29aac80 100644 --- a/Magic.IndexedDb.Cli/Magic.IndexedDb.Cli.csproj +++ b/Magic.IndexedDb.Cli/Magic.IndexedDb.Cli.csproj @@ -1,13 +1,13 @@ Exe - net10.0 + net11.0 enable enable true magicdb Magic.IndexedDb.Cli - 3.1.0 + 4.0.0 Magic Man Code-first, language-independent migration planning, validation, and static publishing for Magic IndexedDB. https://github.com/magiccodingman/Magic.IndexedDb diff --git a/Magic.IndexedDb.Cli/README.md b/Magic.IndexedDb.Cli/README.md index faac3183..a7a9431a 100644 --- a/Magic.IndexedDb.Cli/README.md +++ b/Magic.IndexedDb.Cli/README.md @@ -1,6 +1,6 @@ # Magic.IndexedDb.Cli -`magicdb` is the separately packaged .NET 10 tool for Magic IndexedDB 3.0. +`magicdb` is the separately packaged .NET 11 tool for Magic IndexedDB 4. It exports models, scaffolds reviewed migration history, validates it, and publishes static browser assets. It never connects to or rewrites customers' browser data. diff --git a/Magic.IndexedDb.Cli/SchemaSource.cs b/Magic.IndexedDb.Cli/SchemaSource.cs index c527a2f3..8e461be5 100644 --- a/Magic.IndexedDb.Cli/SchemaSource.cs +++ b/Magic.IndexedDb.Cli/SchemaSource.cs @@ -60,7 +60,7 @@ private static async Task ExportProjectAsync(string input, Arguments if (framework is null) { framework = properties["TargetFramework"]?.GetValue(); - if (string.IsNullOrWhiteSpace(framework)) throw new CliException("MAGDB4403", "The exporter multi-targets. Select one target with --framework (for example net10.0).", 4); + if (string.IsNullOrWhiteSpace(framework)) throw new CliException("MAGDB4403", "The exporter multi-targets. Select one target with --framework (for example net11.0).", 4); } var build = await RunProcessAsync(DotnetHost(), ["build", project, "--configuration", configuration, "--framework", framework, "--nologo", "--verbosity", "quiet", "-p:GeneratePackageOnBuild=false"], workingDirectory, cancellationToken); diff --git a/Magic.IndexedDb.UnitTests/Magic.IndexedDb.UnitTests.csproj b/Magic.IndexedDb.UnitTests/Magic.IndexedDb.UnitTests.csproj index d6273b58..1b14fc9b 100644 --- a/Magic.IndexedDb.UnitTests/Magic.IndexedDb.UnitTests.csproj +++ b/Magic.IndexedDb.UnitTests/Magic.IndexedDb.UnitTests.csproj @@ -1,6 +1,6 @@ - net10.0 + net11.0 enable enable false diff --git a/Magic.IndexedDb/Magic.IndexedDb.csproj b/Magic.IndexedDb/Magic.IndexedDb.csproj index 6de3b105..45dd9ac4 100644 --- a/Magic.IndexedDb/Magic.IndexedDb.csproj +++ b/Magic.IndexedDb/Magic.IndexedDb.csproj @@ -1,22 +1,22 @@  - net10.0 + net11.0 enable enable Magic.IndexedDb Magic Man - A LINQ-to-IndexedDB query engine and typed browser database library for Blazor and .NET 10, with indexed query planning, streaming results, C# schema definitions, and a static, language-independent browser migration protocol. + A LINQ-to-IndexedDB query engine and typed browser database library for Blazor and .NET 11, with indexed query planning, streaming results, C# schema definitions, and a static, language-independent browser migration protocol. https://github.com/magiccodingman/Magic.IndexedDb https://github.com/magiccodingman/Magic.IndexedDb IndexedDB;Blazor;Blazor WebAssembly;LINQ;offline-first;client-side database;browser storage;PWA;Dexie wizardHatIcon.png True - 3.1.0.0 + 4.0.0.0 README.md LICENSE.txt - 3.1.0.0 - 3.1.0 + 4.0.0.0 + 4.0.0 @@ -45,7 +45,7 @@ - + diff --git a/NumericWasmTest/NumericWasmTest.csproj b/NumericWasmTest/NumericWasmTest.csproj index 89672841..7bceddd2 100644 --- a/NumericWasmTest/NumericWasmTest.csproj +++ b/NumericWasmTest/NumericWasmTest.csproj @@ -1,12 +1,12 @@ - net10.0 + net11.0 enable enable - + diff --git a/README.md b/README.md index 9a427c55..36f700ea 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ This feels familiar to LINQ users without pretending IndexedDB behaves like SQL ## Requirements -The current codebase targets .NET 10. Managed migrations require IndexedDB, Web Crypto, and the Web Locks API in a secure browser context. +Magic IndexedDB 4 targets .NET 11. For .NET 10 applications, use version 3.1.0 of both packages. Managed migrations require IndexedDB, Web Crypto, and the Web Locks API in a secure browser context. The current package supports Blazor WebAssembly and Blazor applications using JavaScript interop over SignalR. Browser storage behavior and quota remain controlled by the user's browser. diff --git a/TestBase/TestBase.csproj b/TestBase/TestBase.csproj index 5f163d7d..71bd6c73 100644 --- a/TestBase/TestBase.csproj +++ b/TestBase/TestBase.csproj @@ -1,7 +1,7 @@  - net10.0 + net11.0 enable enable diff --git a/TestServer/TestServer.Client/TestServer.Client.csproj b/TestServer/TestServer.Client/TestServer.Client.csproj index 352399a4..225682ef 100644 --- a/TestServer/TestServer.Client/TestServer.Client.csproj +++ b/TestServer/TestServer.Client/TestServer.Client.csproj @@ -1,7 +1,7 @@ - net10.0 + net11.0 enable enable true @@ -9,7 +9,7 @@ - + diff --git a/TestServer/TestServer/TestServer.csproj b/TestServer/TestServer/TestServer.csproj index f3cb2a83..ef1c4436 100644 --- a/TestServer/TestServer/TestServer.csproj +++ b/TestServer/TestServer/TestServer.csproj @@ -1,7 +1,7 @@ - net10.0 + net11.0 enable enable @@ -10,7 +10,7 @@ - + diff --git a/TestWasm/TestWasm.csproj b/TestWasm/TestWasm.csproj index a0ef26f3..81f40876 100644 --- a/TestWasm/TestWasm.csproj +++ b/TestWasm/TestWasm.csproj @@ -1,14 +1,14 @@ - net10.0 + net11.0 enable enable - - + + diff --git a/docs/README.md b/docs/README.md index 575ebacc..e2fd1fe1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,7 +2,7 @@ Magic IndexedDB is a typed IndexedDB library for Blazor with a LINQ-style query API. It translates supported C# predicates into browser queries, uses indexes when possible, and falls back to cursor filtering when necessary. -The current version targets .NET 10. If your application still targets .NET 8, use an earlier compatible package. +Magic IndexedDB 4 targets .NET 11. For .NET 10, use version 3.1.0. Magic does not load an entire table into .NET just to apply a filter. Query planning and filtering happen in the browser, close to IndexedDB. This is especially useful for compound indexes, larger datasets, pagination, and predicates that combine `&&` and `||`. diff --git a/docs/contributing/migration-testing.md b/docs/contributing/migration-testing.md index 03cfc20e..3ba9a285 100644 --- a/docs/contributing/migration-testing.md +++ b/docs/contributing/migration-testing.md @@ -12,8 +12,8 @@ repository root: ```bash dotnet build tests/migrations/BrowserDriver/BrowserDriver.csproj --configuration Release -node tests/migrations/BrowserDriver/bin/Release/net10.0/.playwright/package/cli.js install --with-deps chromium -node tests/migrations/run.mjs chromium tests/migrations/BrowserDriver/bin/Release/net10.0/.playwright/package/index.mjs +node tests/migrations/BrowserDriver/bin/Release/net11.0/.playwright/package/cli.js install --with-deps chromium +node tests/migrations/run.mjs chromium tests/migrations/BrowserDriver/bin/Release/net11.0/.playwright/package/index.mjs ``` Use `firefox` or `webkit` in both commands for another engine. macOS does not need @@ -61,7 +61,7 @@ browser behavior. ```bash bash .github/scripts/test-migration-cli.sh MAGIC_CLI_FIXTURE=artifacts/migration-cli/published/cli-fixture/manifest.json \ - node tests/migrations/run.mjs chromium tests/migrations/BrowserDriver/bin/Release/net10.0/.playwright/package/index.mjs + node tests/migrations/run.mjs chromium tests/migrations/BrowserDriver/bin/Release/net11.0/.playwright/package/index.mjs ``` The script packs and installs the actual `Magic.IndexedDb.Cli` nupkg into a clean @@ -86,12 +86,12 @@ repository root. Choose a new output directory for each build. MAGIC_UPGRADE_AOT=both bash tests/migrations/ReleasedUpgrade/build.sh artifacts/released-upgrade for mode in trimmed aot; do MAGIC_UPGRADE_REQUIRE_ALL=1 node tests/migrations/ReleasedUpgrade/run.mjs artifacts/released-upgrade \ - tests/migrations/BrowserDriver/bin/Release/net10.0/.playwright/package/index.mjs chromium "$mode" + tests/migrations/BrowserDriver/bin/Release/net11.0/.playwright/package/index.mjs chromium "$mode" done ``` Use `firefox` or `webkit` on supported platforms. The historical binaries run -in a .NET 10 fixture host. Build both modes with `MAGIC_UPGRADE_AOT=both`, or +in a .NET 11 fixture host. Build both modes with `MAGIC_UPGRADE_AOT=both`, or select `false` for trimmed and `true` for AOT. For a short local probe, supply specific historical versions after the output path and omit `MAGIC_UPGRADE_REQUIRE_ALL`. The package versions for the locally packed runtime diff --git a/docs/contributing/testing.md b/docs/contributing/testing.md index 47ba9475..76119eb2 100644 --- a/docs/contributing/testing.md +++ b/docs/contributing/testing.md @@ -24,7 +24,7 @@ Build the test project before installing Playwright: ```bash dotnet build E2eTest/E2eTest.csproj --configuration Release -pwsh E2eTest/bin/Release/net10.0/playwright.ps1 install --with-deps chromium firefox webkit +pwsh E2eTest/bin/Release/net11.0/playwright.ps1 install --with-deps chromium firefox webkit ``` Then run the suite in any browser you need: @@ -90,7 +90,7 @@ To reproduce with .NET's `wasm-tools` workload and Python 3 installed: ```bash dotnet publish NumericWasmTest/NumericWasmTest.csproj -c Release -p:RunAOTCompilation=true -o artifacts/numeric-wasm dotnet build E2eTest/E2eTest.csproj -c Release -node E2eTest/bin/Release/net10.0/.playwright/package/cli.js install --with-deps chromium +node E2eTest/bin/Release/net11.0/.playwright/package/cli.js install --with-deps chromium node .github/scripts/test-numeric-wasm.mjs ``` diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index f7f07f9f..df656899 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -1,6 +1,6 @@ # Installation -Magic IndexedDB 2 targets .NET 10 and runs in Blazor applications in the browser. If your application still targets .NET 8, use an earlier compatible package. +Magic IndexedDB 4 targets .NET 11 and runs in Blazor applications in the browser. For .NET 10, use version 3.1.0. ## Install the package diff --git a/docs/guides/migration-cli.md b/docs/guides/migration-cli.md index becbc132..f3310a4b 100644 --- a/docs/guides/migration-cli.md +++ b/docs/guides/migration-cli.md @@ -12,7 +12,7 @@ a NuGet package does not increment a database revision. ## Installation and the first schema -The tool requires the .NET 10 runtime. Building a C# exporter also requires its +The tool requires the .NET 11 runtime. Building a C# exporter also requires its selected SDK and target framework. After the package is published to your feed, pin the version in a repository tool manifest: @@ -62,7 +62,7 @@ runtime package. It must be executable and opt in with this property: Exe - net10.0 + net11.0 enable enable true @@ -104,7 +104,7 @@ Use `--framework` when the exporter multi-targets, and `--configuration` when conditional compilation changes the model: ```sh -magicdb schema export --project tools/App.Schema/App.Schema.csproj --framework net10.0 --configuration Release --output artifacts/current-schema.json +magicdb schema export --project tools/App.Schema/App.Schema.csproj --framework net11.0 --configuration Release --output artifacts/current-schema.json ``` A directory is accepted only when it contains exactly one `.csproj`. Solutions and diff --git a/docs/guides/migration-schema.md b/docs/guides/migration-schema.md index 46f90d80..1c06811a 100644 --- a/docs/guides/migration-schema.md +++ b/docs/guides/migration-schema.md @@ -49,7 +49,7 @@ Create a small console project that references the shared model project and `Mag Exe - net10.0 + net11.0 enable enable true diff --git a/global.json b/global.json index d46d21e5..568ee5c9 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.100", + "version": "11.0.100", "rollForward": "latestFeature", "allowPrerelease": false } diff --git a/tests/Magic.IndexedDb.Cli.ContractTests/Magic.IndexedDb.Cli.ContractTests.csproj b/tests/Magic.IndexedDb.Cli.ContractTests/Magic.IndexedDb.Cli.ContractTests.csproj index 77377bd1..d03b62d7 100644 --- a/tests/Magic.IndexedDb.Cli.ContractTests/Magic.IndexedDb.Cli.ContractTests.csproj +++ b/tests/Magic.IndexedDb.Cli.ContractTests/Magic.IndexedDb.Cli.ContractTests.csproj @@ -1,7 +1,7 @@ Exe - net10.0 + net11.0 enable enable false diff --git a/tests/MigrationCliConsumer/MigrationCliConsumer.csproj b/tests/MigrationCliConsumer/MigrationCliConsumer.csproj index 19c5bdfe..9d36ab50 100644 --- a/tests/MigrationCliConsumer/MigrationCliConsumer.csproj +++ b/tests/MigrationCliConsumer/MigrationCliConsumer.csproj @@ -1,7 +1,7 @@ Exe - net10.0 + net11.0 enable enable true diff --git a/tests/migrations/BrowserDriver/BrowserDriver.csproj b/tests/migrations/BrowserDriver/BrowserDriver.csproj index 3d0bb72f..05872bd8 100644 --- a/tests/migrations/BrowserDriver/BrowserDriver.csproj +++ b/tests/migrations/BrowserDriver/BrowserDriver.csproj @@ -1,6 +1,6 @@ - net10.0 + net11.0 false diff --git a/tests/migrations/ProtectedWasm/App/App.csproj b/tests/migrations/ProtectedWasm/App/App.csproj index 1462eb23..74894942 100644 --- a/tests/migrations/ProtectedWasm/App/App.csproj +++ b/tests/migrations/ProtectedWasm/App/App.csproj @@ -1,11 +1,11 @@ - net10.0 + net11.0 enable enable - + diff --git a/tests/migrations/ProtectedWasm/Exporter/Exporter.csproj b/tests/migrations/ProtectedWasm/Exporter/Exporter.csproj index 71046eda..fcb84cec 100644 --- a/tests/migrations/ProtectedWasm/Exporter/Exporter.csproj +++ b/tests/migrations/ProtectedWasm/Exporter/Exporter.csproj @@ -1,7 +1,7 @@ Exe - net10.0 + net11.0 enable enable true diff --git a/tests/migrations/RecoveryWasm/App/App.csproj b/tests/migrations/RecoveryWasm/App/App.csproj index 48a9683b..43da826d 100644 --- a/tests/migrations/RecoveryWasm/App/App.csproj +++ b/tests/migrations/RecoveryWasm/App/App.csproj @@ -1,11 +1,11 @@ - net10.0 + net11.0 enable enable - + diff --git a/tests/migrations/RecoveryWasm/Exporter/Exporter.csproj b/tests/migrations/RecoveryWasm/Exporter/Exporter.csproj index 71046eda..fcb84cec 100644 --- a/tests/migrations/RecoveryWasm/Exporter/Exporter.csproj +++ b/tests/migrations/RecoveryWasm/Exporter/Exporter.csproj @@ -1,7 +1,7 @@ Exe - net10.0 + net11.0 enable enable true diff --git a/tests/migrations/ReleasedUpgrade/App/App.csproj b/tests/migrations/ReleasedUpgrade/App/App.csproj index 48a9683b..43da826d 100644 --- a/tests/migrations/ReleasedUpgrade/App/App.csproj +++ b/tests/migrations/ReleasedUpgrade/App/App.csproj @@ -1,11 +1,11 @@ - net10.0 + net11.0 enable enable - + diff --git a/tests/migrations/ReleasedUpgrade/Exporter/Exporter.csproj b/tests/migrations/ReleasedUpgrade/Exporter/Exporter.csproj index 71046eda..fcb84cec 100644 --- a/tests/migrations/ReleasedUpgrade/Exporter/Exporter.csproj +++ b/tests/migrations/ReleasedUpgrade/Exporter/Exporter.csproj @@ -1,7 +1,7 @@ Exe - net10.0 + net11.0 enable enable true diff --git a/tests/migrations/ReleasedUpgrade/run.mjs b/tests/migrations/ReleasedUpgrade/run.mjs index 924c50cf..3af2dcc1 100644 --- a/tests/migrations/ReleasedUpgrade/run.mjs +++ b/tests/migrations/ReleasedUpgrade/run.mjs @@ -9,7 +9,7 @@ import path from 'node:path'; import { pathToFileURL } from 'node:url'; const directory = path.resolve(process.argv[2] ?? 'artifacts/released-upgrade'); -const driver = path.resolve(process.argv[3] ?? 'tests/migrations/BrowserDriver/bin/Release/net10.0/.playwright/package/index.mjs'); +const driver = path.resolve(process.argv[3] ?? 'tests/migrations/BrowserDriver/bin/Release/net11.0/.playwright/package/index.mjs'); const browserName = process.argv[4] ?? 'chromium'; const build = JSON.parse(await readFile(path.join(directory, 'build.json'), 'utf8')); const buildMode = process.argv[5] ?? (build.modes.length === 1 ? build.modes[0] : 'trimmed'); diff --git a/tests/migrations/run.mjs b/tests/migrations/run.mjs index f776c8ca..b5b72f73 100644 --- a/tests/migrations/run.mjs +++ b/tests/migrations/run.mjs @@ -24,7 +24,7 @@ if (cliFixture !== null) { } } if (!['chromium', 'firefox', 'webkit'].includes(browserName)) throw new Error('Choose chromium, firefox, or webkit.'); -const playwrightEntry = path.resolve(process.argv[3] ?? 'E2eTest/bin/Release/net10.0/.playwright/package/index.mjs'); +const playwrightEntry = path.resolve(process.argv[3] ?? 'E2eTest/bin/Release/net11.0/.playwright/package/index.mjs'); const output = path.resolve(process.argv[4] ?? `artifacts/migration-browser/${browserName}`); const assets = new Map(); const requests = []; From f69e0ec3e02761ff70e40e21f3ac15872b5624e9 Mon Sep 17 00:00:00 2001 From: MagicCodingMan Date: Sat, 28 Nov 2026 16:38:10 -0500 Subject: [PATCH 2/4] Align CLI install examples with the .NET 11 package line --- Magic.IndexedDb.Cli/README.md | 2 +- docs/guides/migration-cli.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Magic.IndexedDb.Cli/README.md b/Magic.IndexedDb.Cli/README.md index a7a9431a..a365880e 100644 --- a/Magic.IndexedDb.Cli/README.md +++ b/Magic.IndexedDb.Cli/README.md @@ -6,7 +6,7 @@ static browser assets. It never connects to or rewrites customers' browser data. ```sh dotnet new tool-manifest -dotnet tool install --local Magic.IndexedDb.Cli --version 3.0.0 +dotnet tool install --local Magic.IndexedDb.Cli --version 4.0.0 dotnet tool run magicdb -- --help ``` diff --git a/docs/guides/migration-cli.md b/docs/guides/migration-cli.md index f3310a4b..c99d4efb 100644 --- a/docs/guides/migration-cli.md +++ b/docs/guides/migration-cli.md @@ -1,12 +1,12 @@ # Migration CLI `Magic.IndexedDb.Cli` is the independently packaged .NET tool for Magic IndexedDB -3.0. Its command is `magicdb`. The CLI discovers a persisted model, keeps reviewed +4. Its command is `magicdb`. The CLI discovers a persisted model, keeps reviewed migration source in Git, validates the complete retained history, and publishes a static migration package. The browser engine consumes that package without loading C# or contacting a migration API. -The package version starts at `3.0.0`. The portable document protocol is +The portable document protocol is version `1`; application schema revisions are separate positive integers. Updating a NuGet package does not increment a database revision. @@ -18,7 +18,7 @@ pin the version in a repository tool manifest: ```sh dotnet new tool-manifest -dotnet tool install Magic.IndexedDb.Cli --version 3.0.0 +dotnet tool install Magic.IndexedDb.Cli --version 4.0.0 dotnet tool run magicdb -- --help ``` @@ -26,7 +26,7 @@ For a local checkout, pack and install the actual tool without publishing it: ```sh dotnet pack Magic.IndexedDb.Cli/Magic.IndexedDb.Cli.csproj -c Release -o artifacts/packages -dotnet tool install Magic.IndexedDb.Cli --version 3.0.0 --add-source artifacts/packages +dotnet tool install Magic.IndexedDb.Cli --version 4.0.0 --add-source artifacts/packages ``` The examples below use `magicdb` as shorthand. With a local tool manifest, use @@ -69,7 +69,7 @@ runtime package. It must be executable and opt in with this property: - + ``` From 0888e31e7e34a68b8e400de862fb12279fefdffd Mon Sep 17 00:00:00 2001 From: MagicCodingMan Date: Sat, 28 Nov 2026 16:44:28 -0500 Subject: [PATCH 3/4] Inspect nullable properties via their underlying type when trimming --- .../ConstructorContractTests.cs | 10 ++++++++ .../Helpers/PropertyMappingCache.cs | 24 ++++++++----------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Magic.IndexedDb.UnitTests/ConstructorContractTests.cs b/Magic.IndexedDb.UnitTests/ConstructorContractTests.cs index c1b22136..73450849 100644 --- a/Magic.IndexedDb.UnitTests/ConstructorContractTests.cs +++ b/Magic.IndexedDb.UnitTests/ConstructorContractTests.cs @@ -57,6 +57,16 @@ public void NestedParameterizedType_DoesNotRequireAParameterlessConstructor() Assert.AreEqual("nested", result.Value.Code); } + [TestMethod] + public void NestedNullableQueryCondition_UsesUnderlyingMetadata() + { + var properties = typeof(Magic.IndexedDb.LinqTranslation.Models.FilterNode).GetProperties(); + var nested = PropertyMappingCache.GetAllNestedComplexTypes(properties).ToArray(); + + CollectionAssert.AreEquivalent( + new[] { typeof(Magic.IndexedDb.Models.UniversalOperations.FilterCondition) }, nested); + } + [TestMethod] public void MultipleMagicConstructors_FailWithAnActionableError() { diff --git a/Magic.IndexedDb/Helpers/PropertyMappingCache.cs b/Magic.IndexedDb/Helpers/PropertyMappingCache.cs index e9d99e8b..dc786f0d 100644 --- a/Magic.IndexedDb/Helpers/PropertyMappingCache.cs +++ b/Magic.IndexedDb/Helpers/PropertyMappingCache.cs @@ -256,16 +256,18 @@ public static IEnumerable GetAllNestedComplexTypes(IEnumerable complexTypes = new(); Stack typeStack = new(); - // Initial population of the stack - foreach (var property in properties) + void VisitProperty(PropertyInfo property) { - if (IsComplexType(property.PropertyType)) - { - typeStack.Push(property.PropertyType); - complexTypes.Add(property.PropertyType); - } + // A non-null nullable value boxes as its underlying type. Discovering + // the wrapper would require constructor metadata that trimming may omit. + var type = Nullable.GetUnderlyingType(property.PropertyType) ?? property.PropertyType; + if (IsComplexType(type) && complexTypes.Add(type)) + typeStack.Push(type); } + foreach (var property in properties) + VisitProperty(property); + // Process all nested complex types while (typeStack.Count > 0) { @@ -273,13 +275,7 @@ public static IEnumerable GetAllNestedComplexTypes(IEnumerable Date: Sat, 28 Nov 2026 16:47:51 -0500 Subject: [PATCH 4/4] Allow writing trimmed query DTOs without constructor parameter names --- Magic.IndexedDb/Helpers/PropertyMappingCache.cs | 5 ++++- Magic.IndexedDb/Models/MagicContractResolver.cs | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Magic.IndexedDb/Helpers/PropertyMappingCache.cs b/Magic.IndexedDb/Helpers/PropertyMappingCache.cs index dc786f0d..064fb1ab 100644 --- a/Magic.IndexedDb/Helpers/PropertyMappingCache.cs +++ b/Magic.IndexedDb/Helpers/PropertyMappingCache.cs @@ -43,7 +43,10 @@ public SearchPropEntry(Type type, Dictionary _proper var parameters = Constructor!.GetParameters(); for (int i = 0; i < parameters.Length; i++) { - ConstructorParameterMappings[parameters[i].Name!] = i; + // Serialization only needs the properties. Trimmed constructors + // can still be visible to reflection without parameter names. + if (parameters[i].Name is { } name) + ConstructorParameterMappings[name] = i; } } diff --git a/Magic.IndexedDb/Models/MagicContractResolver.cs b/Magic.IndexedDb/Models/MagicContractResolver.cs index 753adf5d..84c15bdd 100644 --- a/Magic.IndexedDb/Models/MagicContractResolver.cs +++ b/Magic.IndexedDb/Models/MagicContractResolver.cs @@ -69,10 +69,12 @@ private object CreateObjectFromDictionary(Type type, Dictionary for (var index = 0; index < parameters.Length; index++) { var parameter = parameters[index]; - if (parameter.Name != null && propertyValues.TryGetValue(parameter.Name, out var value)) + var name = parameter.Name ?? throw new MagicConstructorException( + $"Cannot materialize '{type.FullName}' because a constructor parameter name is unavailable. Preserve the constructor metadata or use a custom JSON converter."); + if (propertyValues.TryGetValue(name, out var value)) { constructorArgs[index] = value; - propertyValues.Remove(parameter.Name); + propertyValues.Remove(name); } else if (parameter.HasDefaultValue) {