Microsoft MVP성태의 닷넷 이야기
닷넷: 2161. .NET Conf 2023 - Day 1 Blazor 개요 정리 [링크 복사], [링크+제목 복사],
조회: 2779
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

(시리즈 글이 5개 있습니다.)
닷넷: 2161. .NET Conf 2023 - Day 1 Blazor 개요 정리
; https://www.sysnet.pe.kr/2/0/13446

닷넷: 2163. .NET 8 - Dynamic PGO를 결합한 성능 향상
; https://www.sysnet.pe.kr/2/0/13448

닷넷: 2178. C# - .NET 8부터 COM Interop에 대한 자동 소스 코드 생성 도입
; https://www.sysnet.pe.kr/2/0/13470

닷넷: 2180. .NET 8 - 함수 포인터에 대한 Reflection 정보 조회
; https://www.sysnet.pe.kr/2/0/13475

닷넷: 2181. C# - .NET 8 JsonStringEnumConverter의 AOT를 위한 개선
; https://www.sysnet.pe.kr/2/0/13476




.NET Conf 2023 - Day 1 Blazor 개요 정리

아래의 동영상에서,

.NET Conf 2023 - Day 1
; https://youtu.be/xEFO1sQ2bUc?t=5853

본 내용을 개인적인 흥미로 간략하게 정리한 것입니다.




.NET 8의 Blazor는 기존의 "Server", "WebAssembly" 모드에 이어 새롭게 "Static SSR" 모드를 지원한다고 합니다. 이 모드의 특징은,

* Scale (WebSocket을 사용하지 않으므로.)
* Presenting Information
* Navigation (links)
* Forms

등이 가능하고,

x Rich interactivity (all events handlers)
x Real-time updates

가 불가능합니다. 대신 위의 2가지 사항에 대해서는 부가적으로 기존의 Server, WebAssembly 모드를 섞어 해결할 수 있습니다.

net8_blazor_overview_1.png

설정도 단순히, @rendermode를 통해 가능합니다.

@rendermode InteractiveServer // by WebSocket
@rendermode InteractiveWebAssembly
@rendermode InteractiveAuto

그리고, 아래와 같은 특징의 "Streaming SSR" 모드를 지원하고,

Skip waiting for database/API calls

* Fast initial UI render/update
* Begin loading static resources in parallel
! Requires UI design to make sense
  * Use when data loading is likely to take multiple seconds

코드에서는 간략하게 "@attribute [StreamRendering]"를 추가하는 것으로 그 효과를 볼 수 있습니다.

@page "/timercounter"
@attribute [StreamRendering]

<p>
   The count is: @count
</p>

@code {
    int count;

    protected override async Task OnInitializedAsync()
    {
        for (var i = 0; i < 5; i ++)
        {
            await Task.Dealy(1000);
            count ++;
            StateHasChanged(); // Only needed to show intermediate states
        }
    }
}




"Enhanced navigation"과 함께,

 Get SPA-like responsiveness without needing a SPA

* Faster page loads with fewer HTTP requests
* Retain most DOM elements
* Enable/disable on any DOM subtree
  * On by default
  ! Consider disabling to reset JS state or navigating to non-Blazor pages

"Static SSR Forms"도 추가되었고,

Accept and validate input on static SSR pages

* All capabilities of  or EditForm
   * @onsubmit handlers
   * anti-forgery protection (CSRF)
   * server-side validation

* Same APIs as for interactive components
* Supports enhance and works with streaming SSR

Interactive components도 제공합니다.

Get full Blazor interactivity, arbitrary events, and real-time updates
 
* Mark any page/components as Server/WebAssembly/both
* Works with enhanced navigation / forms
  * Retain interactive state while navigating or refreshing static SSR content
  * Closes/reopens server circuit automatically
! Requires WebSocket connection or WebAssembly payload

마지막으로, 웹 소켓을 요구하는 "Server"와 "WebAssembly" 간에 고민을 해결할 수 있는 "Auto mode"가 나왔습니다.

Use WebAssembly without the first-download cost

* Uses Server while caching WebAssembly files
* ... then uses WebAssembly on the next visit
! Components must support WebAssembly
  * Must be in Client project and use API endpoints for data




기존 응용 프로그램 방식을 Blazor로 옮기는 경우 다음과 같이 대응할 수 있습니다.

net8_blazor_overview_2.png

최종 기능 정리는 이렇게!

net8_blazor_overview_3.png

개인적으로, blazor를 거의 사용해 본 적이 없지만 처음 blazor를 접했던 2018년보다 확실히 많은 진전이 있음을 체감할 수 있었습니다.

흥미 있으신 분은 다음의 사이트에서. ^^

Build beautiful web apps with Blazor
; https://blazor.net




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 11/16/2023]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  [2]  3  4  5  6  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13595정성태4/13/20241115닷넷: 2237. C# - Audio 장치 열기 (Windows Multimedia, NAudio)파일 다운로드1
13594정성태4/12/20241138닷넷: 2236. C# - Audio 장치 열람 (Windows Multimedia, NAudio)파일 다운로드1
13593정성태4/8/20241432닷넷: 2235. MSBuild - AccelerateBuildsInVisualStudio 옵션
13592정성태4/2/20241629C/C++: 165. CLion으로 만든 Rust Win32 DLL을 C#과 연동 [1]
13591정성태4/2/20241540닷넷: 2234. C# - WPF 응용 프로그램에 Blazor App 통합파일 다운로드1
13590정성태3/31/20241406Linux: 70. Python - uwsgi 응용 프로그램이 k8s 환경에서 OOM 발생하는 문제
13589정성태3/29/20241506닷넷: 2233. C# - 프로세스 CPU 사용량을 나타내는 성능 카운터와 Win32 API파일 다운로드1
13588정성태3/28/20241875닷넷: 2232. C# - Unity + 닷넷 App(WinForms/WPF) 간의 Named Pipe 통신 [2]파일 다운로드1
13587정성태3/27/20241493오류 유형: 900. Windows Update 오류 - 8024402C, 80070643
13586정성태3/27/20241910Windows: 263. Windows - 복구 파티션(Recovery Partition) 용량을 늘리는 방법
13585정성태3/26/20241592Windows: 262. PerformanceCounter의 InstanceName에 pid를 추가한 "Process V2"
13584정성태3/26/20241550개발 환경 구성: 708. Unity3D - C# Windows Forms / WPF Application에 통합하는 방법파일 다운로드1
13583정성태3/25/20241585Windows: 261. CPU Utilization이 100% 넘는 경우를 성능 카운터로 확인하는 방법
13582정성태3/19/20241697Windows: 260. CPU 사용률을 나타내는 2가지 수치 - 사용량(Usage)과 활용률(Utilization)파일 다운로드1
13581정성태3/18/20241817개발 환경 구성: 707. 빌드한 Unity3D 프로그램을 C++ Windows Application에 통합하는 방법
13580정성태3/15/20241341닷넷: 2231. C# - ReceiveTimeout, SendTimeout이 적용되지 않는 Socket await 비동기 호출파일 다운로드1
13579정성태3/13/20241539오류 유형: 899. HTTP Error 500.32 - ANCM Failed to Load dll
13578정성태3/11/20241720닷넷: 2230. C# - 덮어쓰기 가능한 환형 큐 (Circular queue)파일 다운로드1
13577정성태3/9/20242411닷넷: 2229. C# - 닷넷을 위한 난독화 도구 소개 (예: ConfuserEx)
13576정성태3/8/20241887닷넷: 2228. .NET Profiler - IMetaDataEmit2::DefineMethodSpec 사용법
13575정성태3/7/20242038닷넷: 2227. 최신 C# 문법을 .NET Framework 프로젝트에 쓸 수 있을까요?
13574정성태3/6/20241959닷넷: 2226. C# - "Docker Desktop for Windows" Container 환경에서의 IPv6 DualMode 소켓
13573정성태3/5/20241847닷넷: 2225. Windbg - dumasync로 분석하는 async/await 호출
13572정성태3/4/20241835닷넷: 2224. C# - WPF의 Dispatcher Queue로 알아보는 await 호출의 hang 현상파일 다운로드1
13571정성태3/1/20241944닷넷: 2223. C# - await 호출과 WPF의 Dispatcher Queue 동작 확인파일 다운로드1
13570정성태2/29/20241895닷넷: 2222. C# - WPF의 Dispatcher Queue 동작 확인파일 다운로드1
1  [2]  3  4  5  6  7  8  9  10  11  12  13  14  15  ...