Posts

Showing posts with the label Blazor

Blazor WASM hosted as Azure Static Web App and how to handle direct links

Long time no post! i have been busy trying to "lunch" my PWA app https://www.homeyummies.net , one of the challenges i faced was when i communicate direct links to the users like https://www.homeyummies.net/register that gave the user an Azure 404 page although it's a valid path on the Blazor WASM app, but as this is an SPA and routing is happening at client-side, when calling this directly the server looks for https://www.homeyummies.net/register/index.html and as it doesn't find it, it return 404. a couple of google searches and i did find some solutions out there for that, and when trying to implement them i got a major issue, handling this issue can only be really tested after deployment as part of the solution do relay on what are you hosting the Blazor app on, i did try a couple of them but nothing really worked without issues! but when i combined a couple of them together it did form a good solution for and i though to share it so the solution have 3 part...

Blazor and Square Payments

Another day of poking around and conquer challenges. For my project "HomeYummies.net" i was trying to figure out a solution to process payments using a payment provider but for others, as i wanted the funds to go directly to cooks accounts. after some research i settled on Square as such functionality was addressed more obviously there. But ... how can i get their magical box display on Blazor WASM app i have as a front end? after some decent effort i managed to do so and also have a way to submit and get a token to be used along with a cook OAuth token to process a payment for them! i though to turn this into an open source library, but not quite committed to that yet, but if you land here search for something slimier here you go :) https://github.com/UpwardInfo/BlazorPay/tree/dev

Visual Studio, Blazor WASM, and Docker

 So as usual my attempts to create something take to places where i find things do not work the way i wanted, then i find myself searching for a way to get things to work i want them, and in this case it might be the way a lot of people want to. last weekend i wanted to explore how easy or hard to containerize / Dockrize a .NET5 back-end, Blazor WASM front-end app. for the back-end things were super easy, just right click, add docker support, add containers orchestration and all was working, running, and debugging according to plan. Now when i tried to do the same for a Blazor WASM project things got a it ugly, seems like Visual Studio generate these according to project type, and i guess it saw the Blazor WASM as another .NET hosted web app, which is and is not quite! See Blazor WASM are entirely client side running, the server is there to just provide files but no process occur at the server, so technically you can host a Blazor WASM app on any web server (like Nginx) without the...

Blazor how to generate that SHA256 check

So ... I see that Balzor + .NET 5 (where did Core go?!!) is now do have what i want to get my things running but of course as always something was missing, see Blazor lazy loading is just the thing i was looking for but it doesn’t work unless i reference the module/razor component library on the main project, which i exactly what is don't want. Fortunately this time everything was kind of there, just a bit trouble to do myself. See if you create a client side Razor app, you get blazor.boot.json file generated and on that file you get lazyAssembly entry which supposed to make browsers only get these assemblies if needed (can't see this working on Firefox or Chrome but that's another story), and if you list your assembly there and follow instructions in here magic happen and the page you created on your razor component library works! But, first you need to be able to calculate that sha256 value for your assembly! Which at first i couldn’t figure out how, but then found this ...