Upgrade Stencil AdvancedSearch sample to .NET 8#36
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
Upgrade Stencil AdvancedSearch sample to .NET 8#36devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
- Bump TFM to net8.0 - Bump EF Core (Sqlite, SqlServer) and Microsoft.Data.Sqlite.Core to 8.0.26 - Replace VueCliMiddleware with Microsoft.AspNetCore.SpaProxy 8.0.26 + add SpaProxyServerUrl/SpaProxyLaunchCommand MSBuild properties - Remove Microsoft.AspNetCore.SpaServices.Extensions - Remove legacy System.Data.SqlClient, System.Net.Http, System.Text.RegularExpressions, System.Drawing.Common - Bump Microsoft.Data.SqlClient to 5.2.3 - Bump Microsoft.IdentityModel.JsonWebTokens and System.IdentityModel.Tokens.Jwt to 7.7.1 - Drop AddSpaStaticFiles/UseSpaStaticFiles/UseSpa from Startup.cs - Drop unused 'using System.Data.SqlClient;' Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Add endpoints.MapFallbackToFile("index.html") so SPA client-side
routes fall back to index.html in production (matches the .NET 8
SpaProxy pattern used in the sibling Angular sample at
AspNetCore/Angular/AdvancedSearch/Program.cs).
- Fix PublishRunWebpack target to copy Stencil's actual build output
($(SpaRoot)www\**, per stencil.config.ts outputTargets) into wwwroot
on publish so app.UseStaticFiles() can serve the prebuilt assets in
production. Prior path ($(SpaRoot)build\**) did not match Stencil's
output and would have left wwwroot empty.
Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the Stencil AdvancedSearch sample (
AspNetCore/Stencil/AdvancedSearch/) fromnet6.0tonet8.0, refreshes EF Core / Microsoft.Data.SqlClient / Microsoft.IdentityModel.* package versions, drops legacy BCL-shim packages, and replaces the deprecatedVueCliMiddleware+Microsoft.AspNetCore.SpaServices.ExtensionsSPA wiring withMicrosoft.AspNetCore.SpaProxy.This is a scoped change — only the files inside
AspNetCore/Stencil/AdvancedSearch/were touched. No.sln, no root files, no other projects in the repo were modified..csprojmodifiedAspNetCore/Stencil/AdvancedSearch/EqDemo.AspNetCoreStencil.AdvancedSearch.csprojnet6.0net8.0Microsoft.EntityFrameworkCore.Sqlite6.0.18.0.26Microsoft.EntityFrameworkCore.SqlServer6.0.18.0.26Microsoft.Data.Sqlite.Core6.0.18.0.26Microsoft.Data.SqlClient2.1.75.2.3Microsoft.IdentityModel.JsonWebTokens6.34.07.7.1System.IdentityModel.Tokens.Jwt6.34.07.7.1VueCliMiddleware6.0.0Microsoft.AspNetCore.SpaProxy 8.0.26Microsoft.AspNetCore.SpaServices.Extensions6.0.1System.Data.SqlClient4.8.6Microsoft.Data.SqlClientcovers this in net8)System.Net.Http4.3.4System.Text.RegularExpressions4.3.1System.Drawing.Common4.7.2Added MSBuild properties to support the new SpaProxy package:
SpaRootwas already present (ClientApp\). The proxy URL/port matches the Stencil dev server configured inClientApp/stencil.config.ts(devServer.port = 4444), andnpm startmatches thestartscript inClientApp/package.json(stencil build --dev --watch --serve). Untouched packages (Korzh / EasyData / EasyQuery) were left at their existing versions per the "do not bump unrelated dependencies" constraint.Also fixed the
PublishRunWebpackMSBuild target so the production fallback actually has assets to serve:$(SpaRoot)build\**(a path Stencil never produces) to$(SpaRoot)www\**, matchingClientApp/stencil.config.ts(outputTargets: [{ type: 'www' }]).<RelativePath>changed from%(DistFiles.Identity)towwwroot\%(RecursiveDir)%(FileName)%(Extension)so the prebuilt assets land underwwwroot/in the publish output, whereapp.UseStaticFiles()can serve them. This mirrors the pattern already in use inAspNetCore/Angular/AdvancedSearch/EqDemo.Angular.AdvancedSearch.csproj.Code changes
AspNetCore/Stencil/AdvancedSearch/Startup.cs:using System.Data.SqlClient;— the package was removed and the directive was unused in this file (noSqlConnection/SqlCommandreferences anywhere underAspNetCore/Stencil/AdvancedSearch/).services.AddSpaStaticFiles(...)fromConfigureServices—Microsoft.AspNetCore.SpaServices.Extensionsis gone.app.UseSpaStaticFiles();from the request pipeline.app.UseSpa(spa => { ... spa.UseProxyToSpaDevelopmentServer("http://localhost:4444/"); })block. WithMicrosoft.AspNetCore.SpaProxyand the new MSBuild properties, the dev-time proxy/launch is wired up automatically by the package'sHostingStartup; no explicit middleware call is needed inStartup.cs.endpoints.MapFallbackToFile("index.html");afterMapControllerRoute(...)to keep the SPA-style production fallback intact (client-side routes fall back to the prebuiltindex.htmlunderwwwroot/). This matches the .NET 8 SpaProxy pattern already in use in the sibling sample atAspNetCore/Angular/AdvancedSearch/Program.cs:84.app.UseStaticFiles();is retained so prebuilt static assets underwwwroot/are served in production.Program.cswas not modified — the existing host-builder bootstrap is fully compatible with .NET 8.No changes were made to anything under
ClientApp/, no other projects were touched, no.sln/global.json/Directory.Build.propswere added or edited.Build verification
Locally on the VM (Ubuntu, .NET SDK 8.0.420, installed via
dotnet-install.sh --channel 8.0):Result: Build succeeded — 0 Warning(s), 0 Error(s).
CI
AspNetCore/Stencil/AdvancedSearch/).Devin Review: the only blocking finding (missing SPA fallback / wrong publish path) was addressed in commit 6f50af3 and replied to inline.security/snykandlicense/snyk: failing on this PR. The same two checks are also failing on every parallel sibling .NET 8 upgrade PR in this repo (e.g. PR chore(net8): upgrade AspNetCore/Vue2/AdvancedSearch to .NET 8 #35), and the failures are flagging packages that are out of scope for this task (the explicit constraint in the parent prompt is "Do NOT bump unrelated dependencies just because newer versions exist. Only touch the packages explicitly listed."). The packages flagged here are pre-existingKorzh.*/EasyData.Exporters.*versions inherited frommaster. Worth a separate dedicated PR to triage.Review & Testing Checklist for Human
Risk: yellow (single-project package + SPA-middleware swap;
ClientApp/source untouched; build clean locally).dotnet run --project AspNetCore/Stencil/AdvancedSearch/EqDemo.AspNetCoreStencil.AdvancedSearch.csproj) withnpm installalready done inClientApp/. Confirm the Stencil dev server is auto-launched on:4444byMicrosoft.AspNetCore.SpaProxy(driven by the new<SpaProxyServerUrl>/<SpaProxyLaunchCommand>MSBuild properties) and the SPA loads end-to-end against the bundled SQLite NWind DB.dotnet publish -c ReleasefromAspNetCore/Stencil/AdvancedSearch/, then run the published output. Confirm the prebuilt Stencil assets (now copied towwwroot/by the updatedPublishRunWebpacktarget) are served byapp.UseStaticFiles(), and that an unknown SPA route falls back toindex.htmlviaMapFallbackToFile.Notes
ClientApp/source is untouched..slnedits were required; the existing solution file resolves the upgraded TFM correctly.AspNetCore/Stencil/AdvancedSearch/.Link to Devin session: https://app.devin.ai/sessions/c53cd3fab43e479fa381535eb6c8244e
Requested by: @tobydrinkall
Devin Review