samprof / embeddedblazorcontent Goto Github PK
View Code? Open in Web Editor NEWLibrary to load embedded content files (js and css) from Blazor libraries in server-side Blazor mode.
License: MIT License
Library to load embedded content files (js and css) from Blazor libraries in server-side Blazor mode.
License: MIT License
With client side hosting model, the resource path is _content/<AssemblyName>/<RecursivePath>
. But when using this library to fix the server side hosting, the path becomes EmbeddedBlazorFile/<RecursivePath>
.
If the component library only contains js and css files it would work properly (maybe not if there are some files with the same recursive path in different libraries) because the js and css is loaded with the _Host.cshtml that can use @Html.EmbeddedBlazorContent()
to reference the js and css files with the same default path.
But what if something like an image file is referenced within a blazor component? What would be the proper path for making it work for both client side and server side hosting?
Btw, what does the default path EmbeddedBlazorFile/<RecursivePath>
stand for rather than using _content/<AssemblyName>/<RecursivePath>
that client side hosting uses?
MatBlazor for server-side has got tons of cool functionality! ๐
Keep up the good work! ๐
ฐ๐
Sadly when we tried it out in a local project it added about 1MB to the size of the first load of resource, which is pretty beefy. If you can get the size down we prefer to use this library, but at such a large payload we will have to initially choose another library to improve site performance.
Looks like this is working only with .NET Standard 2.0 libraries ?
In the .NET Core 3.0 library, the resource names are returned (by function "GetManifestResourceNames") without expected a splitter character (":") and function always ignore it.
foreach (var resourceName in assembly.GetManifestResourceNames())
{
var parts = resourceName.Split(":");
if (parts.Length < 3)
{
continue;
}
We can add nocache parameter for server side Blazor to avoid this problem.
Originally posted by @SamProf in SamProf/MatBlazor#199 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.