Giter Site home page Giter Site logo

samprof / embeddedblazorcontent Goto Github PK

View Code? Open in Web Editor NEW
39.0 39.0 16.0 248 KB

Library to load embedded content files (js and css) from Blazor libraries in server-side Blazor mode.

License: MIT License

C# 60.34% HTML 26.08% CSS 12.43% JavaScript 1.14%
asp-net-core blazor blazor-component blazor-server

embeddedblazorcontent's People

Contributors

samprof avatar sepppenner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

embeddedblazorcontent's Issues

How to reference files other than js and css?

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?

Heavy to include (around 1MB on first visit)

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.

Doesn't work with libraries written in .NET Core 3.0

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;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.