Repository navigation
v5.0.0
Smidge 5 is a major release focused on simplifying the minification pipeline, modernizing the runtime, and hardening bundle handling against a class of intermittent production crashes.
Highlights
- NUglify is now the only minifier. The hand-rolled
JsMinifier/CssMinifier(JSMin/CSSMin) are gone, and the previously-optionalSmidge.Nuglifypackage is folded directly into the coreSmidgepackage.AddSmidge()/UseSmidge()now use NUglify out of the box, including the source-map (nmap) route. - Retargeted to .NET 10 and moved from MVC controllers to lightweight ASP.NET Core minimal API endpoints, dropping the MVC dependency entirely.
- Graceful 404s instead of 500s. The composite-file and source-map endpoints now use a non-throwing file lookup, so missing, stale, or spoofed cache entries return a clean
404rather than an unhandled exception. This closes a repeatable DoS vector (#199) and also fixes a source-map parsing crash (#176). - Merged
Smidge.CoreintoSmidgeto simplify the package layout for the major version.
Breaking changes
- The
Smidge.Coreassembly no longer exists; its types now live inSmidge. Smidge.Nuglifyis obsolete - referenceSmidgedirectly.AddSmidgeNuglify()/UseSmidgeNuglify()are gone.- Several previously-public MVC handler/filter types are now
internal, since they're no longer part of the supported API surface. Bundle.Filesis nowIReadOnlyList<IWebFile>instead of a mutableList<IWebFile>(see thread-safety fix below). UseBundle.AddFile(IWebFile)to add files.
Bug fixes
- Fixed a
NullReferenceExceptioncrash in bundle file-set generation (#156, #205) caused by a genuine race condition: concurrent requests registering files into the same bundle could corrupt its backingList<IWebFile>, silently dropping or nulling entries. Bundles now use an immutable, lock-free file list (ImmutableList<IWebFile>+ImmutableInterlocked.Update) so concurrent registration can no longer corrupt a bundle's file list, and a null entry is now defensively skipped with a warning rather than crashing the whole bundle response. - Fixed directory bundles pulling in wrong-type files (#225) - a bundle pointed at a bare folder (e.g.
~/Js/Bundle2) no longer accidentally includes generated artifacts like.js.gzor.mapfiles; matching is now constrained to the bundle's file type. - Fixed recursive glob patterns (
**.ext/**/*.ext) not matching correctly for non-physical file providers, satisfying the long-standing globbing request in #197. (Glob patterns already worked for the commonPhysicalFileProvidercase via .NET's built-in file globbing; this closes the gap for composite/embedded file providers.) - Fixed a source-map request crash (
Could not parse ... as a valid smidge path) that surfaced as an unhandled 500 (#176).
Improvements
- Cache-buster mismatch warnings now include the server's expected value alongside the rejected one, making it much easier to tell a benign stale-cache/post-deploy hiccup apart from an actual spoofing attempt (#219).
BundleManager.Create(...)now filters out null file entries at bundle-creation time (with a warning), in addition to the defensive handling already in place during file-set generation.- Dependencies bumped to their latest stable versions across the board (Microsoft.Extensions.*, xunit, Moq, Microsoft.NET.Test.Sdk, SourceLink, and the sample project's uglify-js).
- Switched the build/release versioning from GitVersion to MinVer.