post(blog): TypeScript 비동기 제너레이터 포스트 추가 (#107) - #136
Merged
Conversation
- function* → async function* → for await...of 메커니즘과 AsyncGenerator 타입 정리 - SSE 스트림 파싱을 비동기 제너레이터로 분리하는 예시 (sse-exam 포스트 연계) - 태스크 경계 양보로 렌더링 블로킹 없는 무거운 계산 처리와 웹 워커 비교
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
- readSSE에 try/finally 연결 정리 추가, 스펙 단순화 명시, 원본 대비 개선점·콜백 대안 비교 서술 보강 - 렌더링 타이밍 규칙의 출처 정정(이벤트 루프 포스트 아님), pending/이행된 Promise await 구분 추가, scheduler.yield 지원 현황 구체화 - chunkSize 기본값 1,000→200(실측 50ms로 16ms 예산 초과), H1→H2 헤딩 통일, 조사·비문 등 문장 손질
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
Closes #107
이슈 #107(Typescript와 비동기 제너레이터 함수)을 다루는 새 포스트를 추가합니다.
apps/blog/src/app/(main)/posts/frontend/async-generator/page.mdx구성
function*→async function*단계적 도입,yield/next()/for await...of, 비동기 이터레이션 프로토콜(Symbol.asyncIterator),AsyncGenerator<T, TReturn, TNext>타입/posts/ai/sse-exam포스트와 내부 링크로 연계)await Promise.resolve()(마이크로태스크)로는 양보가 안 되는 함정,setTimeout(0)태스크 경계 양보 + 청크 처리 패턴 (기존/posts/frontend/event-loop포스트와 연계)검증
readSSE청크 분할·멀티바이트 포함,processInChunks결과 일치 및 매크로태스크 양보 여부 실측 — 마이크로태스크만으로는 양보되지 않음 확인)pnpm run build통과 (async-generator 라우트 생성 확인)pnpm run lint(--max-warnings 0) 통과pnpm test통과 (26 suites / 115 tests)