.Net Conf 2020 Day 3


 Summary

I learned my lesson from trying to attend too many sessions yesterday.  Today I am focusing on the Blazor sessions.


1. Application State in Blazor

  • Blazor Train on YouTube - Carl Franklin
    • It was nice to hear Carl again
    • Been a fan since early .Net Rocks
  • App State
    • Instances of objects stored in memory
    • SPAs are stateful
    • Scoped 
  • Create "State Bag" - User Scoped
    • 1 instance per user
    • Class for object reference
    • Use scope service
  • For application instance use Singleton
    • Web Assembly - not needed because there is 1 user
  • Class level
    • Transient
    • Multiple copies of the same data across pages
  • Implement a state bag
    • Cascading Component
    • Scoped Service
    • Hybrid Approach
      • Cascading Component with scope service
  • Add the Hybrid solution at the router level
    • It is like making an observable at the app level
  • In AppState service, he is handling events as opposed to just holding state
  • Saving Application-level state
    • Local Storage
      • 5 Meg limit
      • AppState Persistence Pattern
      • Do it in 1 location
    • On Server use the new function
      • Protected Local Storage (Server Side only)
    • You can check to see how much local storage you have left

2. Blazor Stability Testing Tool

  • Blazor is inherently testable because it is all C#
  • Tests
    • Unit
    • Integration
    • System
      • Ad for Telerik Test Studio
  • Unit test
    • Reg Green  Refactor
    • xUnit
  • bUnit
    • C# or Razor
    • Semantic HTML compare
    • How they find CSS classes it pretty cool
    • You can mock JSInterop
  • Telerik Test Studio
    • Has a test recorder for Blazor UI

3. Web Forms to Blazor

  • Making Blazor components from Win Form components
  • Current web forms only 4.8
  • Blazor Server-Side very similar to Web Forms 
    • Not the same
      • <%%>
      • View State
      • Postback
      • Only Windows
  • Used bUnit to validate that the markup was the same as a Web Form
  • Make sure your class libraries are .Net Standard
  • E-book
  • Look at CodeFactory to automate

4. Dynamic Applications with Blazor

  • Benefits
    • Extensibility
    • Parallel Development
    • Conventions
    • Encapsulation
    • Deployment
  • Difficult to create
    • Most use frameworks
      •  Batteries Included
        • Rails
        • Django
        • sprint
  • CMS => Dynamic system?  No
  • .Net Web frameworks
    • DNN
    • Orchard
    • Umbraco
  • Blazor - single-page application formwork
  • Oqtane
    • "Batteries included" Blazor framework
    • Includes
      • Multi-Tenant
      • Portal UI framework
      • Granular Permissions
      • Admin User Interface
      • Dynamic Routing
      • Modular Architecture
      • Customizable Themes
      • Headless API and repository
  • The session ended up being a demo of Oqtane.  I was hoping to see how to build dynamic pages

5. Building cross-platform apps with Electron.Net

  • Supports 
    • Windows
    • OSX
    • Linus
  • Electron.Net is a wrapper around normal Electron
    • CLI extension
    • Support .Net 5.0
  • Cool demo
    • Created ASp.Net COre web site
    • Add reference to Electronic .net NuGet
    • Have to install Electron.Net CLI
    • Run through command line in VS code
    • You have to attach to the running process to debug
    • You can even use 3rd party controls
  • Builds
    • Use Electronize
  • Should work with Blazor
  • GitHub Repro of demo

6. Build native and hybrid mobile apps with Mobile Blazor Bindings

  • This was a good overview of the mobile bindings
  • Definitely worth looking in to
  • Note that it is not ready for prime time
  • Mobile bindings
    • Author native UO using Blazor Engine
    • Host web content in a web view to run locally
    • Run natively on 
      • Android
      • iOS
      • macOS
      • Windows
    • Access all native functions on each platform


DotNetConf was a good set of sessions that cover a wide range of topics.  The 24 hour day was a little rough but some of the sessions were well worth it.  For day 3 I had to attend a smaller number of sessions but it did help me take in the information a lot better. 

     

                                            


Comments

Popular posts from this blog

Yes, Blazor Server can scale!

Blazor - Cool Blur Loading Page

Blazor new and improved Search Box