breaking change - static files moved out of cloudscribe.Web.Common
Opened this issue · 1 comments
Recently all static files were moved out of the cloudscribe.Web.Common library as of version 3.0.6, those files now live in cloudscribe.Web.StaticFiles which is referenced by cloudscribe.Web.Common so the package will come in automatically.
However there is a breaking change if you upgrade to cloudscribe.Core.Web 3.1, the common static files middleware is no longer automatically wired up by cloudscribe.Core. So to solve that in your own project after upgrading to cloudscribe.Core.Web 3.1 or newer you need to add this on the Configure method of startup after other static files middleware:
app.UseCloudscribeCommonStaticFiles();
the reasons for this change are discussed here: cloudscribe/cloudscribe#434
The advantage of separating the static files and not opting into using them automatically from cloudscribe core is that now it is possible to leave that line out and instead copy all the static files into your own project and serve them from disk. In low budget hosting this can be beneficial because it will not load the assembly for the static files into memory and therefore will consume slightly less memory.
If you do want to host those files locally in your project file system instead of using them as embedded resources, you can do so as follows:
- create a folder named cr under wwwroot (this is needed as it is part of the path for the embedded files)
- copy the js, css, fonts, and images folders from the source code here into the cr folder
additional info
I plan to remove the static files dependency from cloudscribe.Web.Common so you should also add a direct reference in your project to the package cloudscribe.Web.StaticFiles.
That way those who choose to host the files locally can eliminate the package dependency for cloudscribe.Web.StaticFiles
However it should be noted that if you do choose to host the static files locally then you will not get updated static files automatically if we make changes to them. So periodically you should make sure you have the latest files locally hosted. Since they will all be under wwwroot/cr you could periodically remove that folder and re-create it using the latest files from the repository