You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flowchart LR
A[새 TanStack 앱] --> B{주요 기능};
B --> C[파일 기반 라우팅];
B --> D[Vite Native Worker (Comlink)];
B --> E[서버 함수 & API 라우트];
B --> F[SSR 데모 (SPA, Data Only, Full)];
C --> G[Header 컴포넌트];
C --> H[다양한 데모 라우트];
E --> I[Todo 예제];
F --> J[Punk Songs 예제];
TypedWorker 클래스 내에서 워커가 에러를 발생시키거나 예기치 않게 종료될 경우, getData()나 heavyComputation()에서 반환된 Promise가 영원히 resolve되지 않거나 reject되지 않을 수 있어요. 워커의 에러 메시지를 처리하고 Promise를 reject하도록 로직을 추가하면 더 견고한 코드가 될 거예요! 🛡️
todos.json 파일을 사용하여 데이터를 관리하는 방식은 데모용으로는 아주 훌륭하지만, 실제 프로덕션 환경에서는 데이터 유실이나 동시성 문제 발생 가능성이 있어요. 주석으로 이미 명시되어 있지만, 실제 서비스에서는 적절한 데이터베이스 솔루션(예: PostgreSQL, MongoDB 등)을 사용하는 것이 중요하다고 다시 한번 강조하고 싶어요! 💾
// In a production environment, you should use a proper database.constTODOS_FILE='todos.json';asyncfunctionreadTodos(){returnJSON.parse(awaitfs.promises.readFile(TODOS_FILE,'utf-8').catch(()=>JSON.stringify([{id: 1,name: 'Get groceries'},{id: 2,name: 'Buy a new phone'},],null,2,),),);}constgetTodos=createServerFn({method: 'GET',}).handler(async()=>awaitreadTodos());constaddTodo=createServerFn({method: 'POST'}).inputValidator((d: string)=>d).handler(async({ data })=>{consttodos=awaitreadTodos();todos.push({id: todos.length+1,name: data});awaitfs.promises.writeFile(TODOS_FILE,JSON.stringify(todos,null,2));returntodos;});
Why: The suggestion correctly identifies that the page title should be a direct property of the head object, not nested within the meta array, aligning with HTML standards and the @tanstack/react-router API. This improves SEO and ensures proper title rendering.
Medium
nitro 종속성 버전을 고정합니다
package.json 파일에서 nitro 패키지의 버전이 "latest"로 지정되어 있습니다. 이는 새로운 버전이 출시될 때마다 예기치 않은 변경 사항이나 빌드 실패를 초래할 수 있습니다. 안정성과 재현성을 위해 특정 메이저 버전(예: ^2.x.x)을 지정하는 것이 좋습니다.
Why: Using "latest" for dependencies like nitro can lead to unstable builds and unexpected breaking changes. Pinning to a specific major version (e.g., ^2.x.x) improves stability and reproducibility, which is a good practice for project maintainability.
-todos.push({ id: todos.length + 1, name: data });+todos.push({ id: crypto.randomUUID(), name: data });
Suggestion importance[1-10]: 9
__
Why: Generating IDs with todos.length + 1 is prone to collisions and incorrect IDs, especially with deletions or concurrent requests. Using crypto.randomUUID() ensures unique identifiers and maintains data integrity.
High
General
모듈 구문 일치로 가져오기 문제 방지
tsconfig.json 파일에서 verbatimModuleSyntax를 false로 설정하면 TypeScript의 모듈 해석과 번들러의 실제 런타임 동작 간에 불일치가 발생하여 미묘한 가져오기 문제가 발생할 수 있습니다. 이를 true로 변경하여 더 엄격하고 예측 가능한 모듈 의미론을 적용하고 TypeScript의 동작을 최신 번들러와 일치시키는 것이 좋습니다.
Why: Setting verbatimModuleSyntax to true is a best practice in modern TypeScript projects, especially with bundlers, to ensure consistent module semantics and prevent subtle import issues. This improves build reliability.
Medium
파일 경로를 절대 경로로 지정하여 안정성 확보
서버 환경에서 todos.json 파일의 상대 경로 사용은 예측 불가능한 위치에 파일이 생성되거나 읽히는 문제를 유발할 수 있습니다. 애플리케이션의 루트 경로를 기준으로 하는 절대 경로를 사용하거나 환경 변수를 통해 경로를 구성하여 파일 접근의 견고성을 높이는 것이 좋습니다.
Why: Using a relative path like todos.json can lead to unpredictable file locations in a server environment. Configuring the path via an environment variable or an absolute path improves robustness.
Medium
의존성 버전 고정으로 안정성 확보
package.json 파일에서 nitro 의존성에 "latest" 태그를 사용하는 것은 빌드의 비결정성을 초래하고 예기치 않은 호환성 문제를 일으킬 수 있습니다. 특정 버전을 고정하거나 캐럿(^) 또는 틸드(~)와 같은 더 제한적인 버전 범위를 사용하여 안정성과 재현성을 보장하는 것이 좋습니다.
-"nitro": "latest",+"nitro": "^2.x.x", // 또는 특정 버전 (예: "2.9.0")
Suggestion importance[1-10]: 7
__
Why: Using "latest" for dependencies like nitro can lead to non-deterministic builds and potential compatibility issues. Pinning to a specific version or using a caret range (^) is a good practice for stability and reproducibility.
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
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.
PR Type
Enhancement
Description
새로운 TanStack Start 앱 및 데모 기능 추가.
타입 안전한 Vite Native Worker Comlink 데모 구현.
서버 함수, API 라우트 및 SSR 모드 데모 포함.
파일 기반 라우팅 및 Tailwind CSS 기반 UI 구성.
Diagram Walkthrough
flowchart LR A[새 TanStack 앱] --> B{주요 기능}; B --> C[파일 기반 라우팅]; B --> D[Vite Native Worker (Comlink)]; B --> E[서버 함수 & API 라우트]; B --> F[SSR 데모 (SPA, Data Only, Full)]; C --> G[Header 컴포넌트]; C --> H[다양한 데모 라우트]; E --> I[Todo 예제]; F --> J[Punk Songs 예제];File Walkthrough
9 files
TanStack Router 자동 생성 라우트 정의 추가TanStack 앱을 위한 Vite 빌드 및 개발 환경 설정 추가TanStack Router 인스턴스 생성 및 설정TanStack 앱의 TypeScript 컴파일러 설정 추가루트 `package.json`에 TanStack 앱 관련 스크립트 추가웹 앱 매니페스트 파일 추가Create TanStack App 설정 파일 추가VS Code 설정에 자동 생성 파일 제외 규칙 추가검색 엔진 크롤링 규칙을 위한 robots.txt 파일 추가13 files
새로운 TanStack 앱의 전역 헤더 및 탐색 메뉴 구현타입 안전한 Vite Native Worker를 사용한 Comlink 데모 페이지 추가TanStack Start 앱의 환영 페이지 및 주요 기능 소개 구현서버 함수를 활용한 Todo 목록 관리 데모 추가다양한 SSR 데모 페이지로 연결되는 인덱스 라우트 추가클라이언트 측 데이터 로딩을 보여주는 SPA 모드 SSR 데모 추가서버에서 데이터만 프리로드하는 Data Only SSR 데모 추가전체 페이지를 서버에서 렌더링하는 Full SSR 데모 추가API 라우트에서 데이터를 가져오는 데모 페이지 추가전역 헤더 및 개발 도구를 포함하는 루트 라우트 레이아웃 정의타입 안전한 메시지 프로토콜을 사용하는 Vite Native Worker 구현SSR 데모를 위한 서버 함수로 펑크 송 데이터 제공간단한 이름 목록을 반환하는 API 라우트 정의1 files
Tailwind CSS를 포함한 기본 전역 스타일 정의1 files
새로운 TanStack 앱에 대한 상세한 시작 가이드 및 기능 설명 추가1 files
TanStack 앱의 종속성 및 스크립트 정의3 files