7 ms·
Blazor – Build client web apps with C#
- TheRealWatson 7y agoBlazor is definitely not a shiny new technology. It's been around for years but still hasn't seen it's official release. Last significant bit of news from it was the "official preview" phase, back in April. If I understand it well, it WILL be released soon given that .NET Core 3 has just been released too.
- dgellow 7y agoApril announcement here https://devblogs.microsoft.com/aspnet/blazor-now-in-official-preview/ https://devblogs.microsoft.com/aspnet/blazor-now-in-official.... > With this newest Blazor release we’re pleased to announce that Blazor is now in official preview! Blazor is no longer experimental and we are committing to ship it as a supported web UI framework including support for running client-side in the browser on WebAssembly.
- perfectphase 7y agoBlazor has been split into two versions, there is a server side and a client side version, both that share the same component model. The server side version went GA a last week with .Net core 3.0, the client side is looking like it will GA in April 2020. The reason given is that their not happy with the size of the payloads required for now, the aim to have everything compiled to webAssembly by then, not just the mono runtime that's running as an IL interpreter at the moment. The server side version is interesting, it ships DOM updates to the client from the server over a websocket (musch like OOUI https://github.com/praeclarum/Ooui https://github.com/praeclarum/Ooui). Not something that I'd use for production, but for quick internal projects which have the feel of a client side SPA, but while not requiring you to build the API layer it's quite neat.
- untog 7y ago> The server side version is interesting, it ships DOM updates to the client from the server over a websocket WebForms 2020! Amazing.
- perfectphase 7y agoYep, that's pretty much the aim :)
- sebazzz 7y agoExcept it is much more intuitive. A repeater- like construct (a foreach) just works. Collections just work. No thinking about data binding at the correct time in the life cycle of the page. You can even call front-end javascript in a sync-like (using async) matter. You can just call a javascript confirm if you like. It is awesome.
- chusk3 7y agoI'd say more like Elm's Pheonix LiveView, to be honest.
- asdfman123 7y ago> The reason given is that their not happy with the size of the payloads required for now Question: how will they go about shrinking them? Will this happen in the near future? I've tried out Blazor before and the page doesn't load until you've downloaded everything. Will it always be that way, or will it be like JS eventually -- you see the page, and the JS loads in the background?
- untog 7y agoNot to diminish the achievement here, which is considerable, but I feel like a lot of these WebAssembly-based projects miss the forest for the trees. JavaScript isn't really that big of a problem or a performance killer. The DOM is. I don't know what the answer is (rendering to a canvas tag is awful for accessibility) but I'm hoping that in time we see the improvement that is to the DOM as WebAssembly is to JS.
- snarfy 7y agoJavaScript isn't a very good programming language. Just because I can develop in it doesn't mean I want to.
- untog 7y agoSure. Blazor scratches a developer itch. But end users aren't likely to feel a difference one way or the other. The same bottlenecks are still the same bottlenecks.
- belltaco 7y agoIt isn't just about scratching an itch. It results in fewer bugs, faster development, more features etc. which are useful to end users.
- untog 7y agoMy experience of tools/languages that sit on top of the actual native implementations (e.g. React Native or Xamarin on mobile) is that they often lead to much slower development, since when you're Googling around trying to find answers to an issue you're looking in a much smaller community for answers. Eventually the answer usually ends up being "just do it the native way". Hopefully Blazor will avoid such issues. In any case I'm probably speaking out of turn... it clearly isn't designed for wide-scale deployments - in house/intranet tools are a different beast anyway.
- 7y ago
- thrower123 7y agoI really hope this takes off and is practical. Every time I have to touch the mess that is front-end JS development, I want to torch the building and go live in a cave far away from any computers. Dynamic by default languages are a mistake. Languages where anyone can monkeypatch anything are a mistake. Languages that are so flakey and squishy that the best tooling in the world can't tell you reliably whether a symbol is or is not defined somewhere in scope, and jumping to definition relies on grep, are a mistake. I don't know if Blazor is the right answer - in particular the server-side version of it, using SignalR to send events and diffs back and forth gives me some chills and flashbacks to ASP.NET WebForms UpdatePanels... - but something better for WebAssembly will come soon, and we can finally be free of the sub-mediocre monopoly that JS has enjoyed.
- benbristow 7y ago> Dynamic by default languages are a mistake Have you met TypeScript? http://www.typescriptlang.org/ http://www.typescriptlang.org/
- pathartl 7y agoUnfortunately, TypeScript is still dynamic by default. You can still write messy JavaScript.
- nabdab 7y agoYou can write messy anything. C, C++, C#, I’ve seen tire fires in all three. Messy code is due to the programmer not the language. The idea that you can magically be a better programmer without spending time on learning and improving because you chose “a superior language” is silly. Also we should be having this discussion in Latin. English is messy, you can write messy messages in English.
- speedplane 7y ago> You can write messy anything. C, C++, C#, I’ve seen tire fires in all three. Come on, please. Of course you can write a steaming pile of trash in any programming language, but some languages allow you to do that more easily than others. Comparing languages based on their absolute worst examples isn’t really a comparison at all.
- Lapsa 7y agoReminds me of SilverLight.
- Roonerelli 7y agoSilverlight was proprietary tech . Web Assembly is based on Open Standards. This is just a framework to develop for Web Assembly
- belltaco 7y agoSilverlight was a client side plugin, like Flash, which needed to be installed separately from the browser.
- badsectoracula 7y agoI scrolled back and forth and even checked the linked github site but... any live demos? There should be a "Live demo" button right at the top.
- giulianob 7y agoThe official demo that uses wasm is here https://blazor-demo.github.io/ https://blazor-demo.github.io/
- perfectphase 7y agoThe component vendors are jumping on board as well https://demos.devexpress.com/blazor/ https://demos.devexpress.com/blazor/ https://www.telerik.com/blazor-ui https://www.telerik.com/blazor-ui https://www.syncfusion.com/blazor-components https://www.syncfusion.com/blazor-components https://www.matblazor.com/ https://www.matblazor.com/ There's some good demos on their sites. The 'official' one could do with an update!
- badsectoracula 7y agoHm, they all look kind of slow and Telerik's demos were broken on Firefox (the comboboxes wouldn't work). Only matblazor's demos looked responsive enough. Though they all seem to provide basic controls like checkboxes, sliders, date pickers, etc. Shouldn't those be part of the core Blazor toolkit?
- deleted 7y ago[deleted]
- jmkni 7y agoHas anybody used this in anger? It looks cool, but there is that obvious worry about investing the time to learn it, only to have it abandoned by MS.
- xeonoex 7y agoI tried it out for a side project and I loved it. I've written more C# than javascript, but I think that web development is a mess. I've used Angular, Vue, and React, and, to me, they all have the same problems. They're not bad, but they all depend on npm, tons of packages, and stuff like webpack, which I wish I didn't have to understand, but it sometimes breaks my project. I am also opposed to coding a backend in JS. I tried making a game using blazor. Think something like the Jackbox TV games. A room gets created, then people join, and then play together real time (not a 3d game, something that could be done with html/css). It was surprisingly easy. Lots of things I did that I didn't expect to work did. There was pretty much no boilerplate code. I wasn't creating models on the backend and on the frontend, and then writing an api so that they could communicate. I didn't have to use JSON anywhere. I haven't finished the game because I started working on something else though, using flutter. I don't expect people use JS on the backend to convert. Or people who have a ton of experience with something like React. But I think it is awesome. It removes everything I hate about web development. All of the other frameworks for web development that I have used have felt like putting makeup on a pig. Blazor felt like a step in the right direction. It seems like the support from MS is there for now. You have to be aware of the limitations depending on whether you pick server or client side Blazor. I think the limitations are pretty insignificant for the most part though. I doubt Blazor takes over the web, but I hope that something similar will one day.
- jmkni 7y agoLovely, will definitely check it out. I have a similar background to yourself, decent amount of frontend web dev experience but definitely more C#. Cheers
- bigtex 7y agoThe lack of having to write another $.ajax method is what draws me. We write internal use applications and actively avoid any SPA frameworks but like to enhance our applications to provide modal windows, etc. The fact I can do this with none to minimal js will be a game changer. Server side Blazor brings back the WebForms dev cycle without all the magic, postback and view state.
- swalsh 7y agoI wish browsers supported these languages natively. It seems like when the html standard was designed they thought about it. I know the script tag has a language attribute.
- DJHenk 7y agoWell, with the headaches that differences in HTML and CSS interpretation in browser engines already can cause, I would not look forward to having the same kind of problems with compiled languages. We could, of course, make the thing that compiles and executes the code a shared plugin, but then we would have reinvented ActiveX and Java applets.
- sk5t 7y agoThere was a time that VBScript was the other option there. Oooof.
- wokwokwok 7y ago> Blazor code executing on the server has the flexibility to do anything you would normally do on the server, such as connecting directly to a database. Frustrating to see even the splash page off in lalala land. Write once, deploy no where because surprise, the 3rd party package you were using requires a database connection, or some other server side feature. This kind of messaging is why Blazor code is a mess; its not a seamless change to run on WASM when its ready, its server side lock-in, making db calls from your code behind file. ..and for anyone who thinks this isn’t webforms back from the dead: > If you are a Web Forms developer and want to build a new application on .NET Core, we would recommend Blazor which provides the closest programming model. [1] The sad thing is, the WASM c# end-to-end, using real full dlls in the browser is actually really cool. ...but somehow that got lost along the way. [1] https://devblogs.microsoft.com/dotnet/net-core-is-the-future-of-net/ https://devblogs.microsoft.com/dotnet/net-core-is-the-future...
- genzoman 7y agoAlternatively, don't use third party packages you don't fully understand.
- wokwokwok 7y agoI take it you don’t use any 3rd party vue/angular/react components? There’s certainly a place for telerik—only UIs I suppose. /shrug
- asdfman123 7y agoI'm not sure if I could do much of anything as a developer if I didn't use third-party packages I didn't fully understand. I suppose I could spend much of my day carefully vetting dependencies... but what about dependencies of dependencies?
- gremlinsinc 7y agoSo you don't use 3rd party packages? Because the moment you use one you don't fully understand it --that comes with time. You can't magically know every nuance about a package before you start using it. I haven't looked at the code at all for momentjs or the internals of Vue, there's still a lot I don't know about their api's but doesn't mean I still don't get value out of using them.
- dodyg 7y agoI wrote over 300 samples for ASP.NET Core, including 80 samples for ASP.NET Core 3 techs. https://github.com/dodyg/practical-aspnetcore https://github.com/dodyg/practical-aspnetcore
- thrownaway954 7y agoI haven't looked over the samples (but I definitely will!!!). The biggest samples I think _any_ frontend framework need to demonstrate is form validation (showing errors) and file uploading. everything else is pretty simple.
- makkesk8 7y agoI like blazor, I can't, however, get over the idea of having to download several megabytes of DLL's to get it to run.
- xeonoex 7y agoThat's only client side blazor. Server side just streams DOM changes (efficiently). Even for client side, the actual amount downloaded is usually pretty small.