9148c358d0
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
5.3 KiB
5.3 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-jsx | JSX | 10_Wiki/Topics | verified | self |
|
none | A | 0.95 | applied |
|
2026-05-10 | pending |
|
JSX
매 한 줄
"매 syntactic sugar over
createElement— XML-like JS expression". React 의 발명, 매 declarative UI 의 핵심. 매<div>x</div>→jsx('div', null, 'x')로 transpile. 2026 default 는 automatic runtime (react/jsx-runtime) — 매import React의 불필요.
매 핵심
매 transpile model
- Classic runtime (legacy):
<div/>→React.createElement('div', null)— 매 file 마다import React필요. - Automatic runtime (2020+, default):
<div/>→_jsx('div', null), runtime 의 자동 import. - Preserve: TS
--jsx preserve— Babel 등 다른 tool 에 위임.
매 element types
- Lowercase (
div,span): 매 string tag, host component. - Uppercase (
Foo): 매 reference, component identifier. - Member access (
Lib.Btn): 매 namespaced component. - Fragment (
<>...</>): 매 wrapper-less group.
매 응용
- React / Preact / Solid / Qwik 의 매 component definition.
- MDX — Markdown + JSX.
- JSX as data (Astro, hyperscript variant).
💻 패턴
Automatic runtime (2026 default)
// tsconfig.json
{
"compilerOptions": {
"jsx": "react-jsx", // 매 automatic runtime
"jsxImportSource": "react" // or "preact", "@emotion/react"
}
}
// Component.tsx — 매 import React 의 X
export function Hello({ name }: { name: string }) {
return <h1>Hello, {name}</h1>;
}
Conditional rendering
function Status({ user }: { user?: User }) {
if (!user) return null;
return (
<>
{user.isAdmin && <AdminBadge />}
{user.posts.length > 0
? <PostList posts={user.posts} />
: <EmptyState />}
</>
);
}
Children pattern
type Props = { title: string; children: React.ReactNode };
function Card({ title, children }: Props) {
return (
<section className="card">
<h2>{title}</h2>
<div className="body">{children}</div>
</section>
);
}
Render prop / function-as-children
type DataLoaderProps<T> = {
url: string;
children: (data: T | undefined, loading: boolean) => React.ReactNode;
};
function DataLoader<T>({ url, children }: DataLoaderProps<T>) {
const [data, setData] = useState<T>();
const [loading, setLoading] = useState(true);
useEffect(() => {
fetch(url).then(r => r.json()).then(d => { setData(d); setLoading(false); });
}, [url]);
return <>{children(data, loading)}</>;
}
Polymorphic component (as prop)
type AsProp<C extends React.ElementType> = { as?: C };
type PolymorphicProps<C extends React.ElementType> =
AsProp<C> & React.ComponentPropsWithoutRef<C>;
function Box<C extends React.ElementType = 'div'>({
as, ...rest
}: PolymorphicProps<C>) {
const Comp = as ?? 'div';
return <Comp {...rest} />;
}
<Box as="a" href="/x" /> // 매 anchor props 의 typed
<Box as={MyButton} onClick={...} />
JSX spread + override
function PrimaryButton(props: React.ButtonHTMLAttributes<HTMLButtonElement>) {
return <button {...props} className={`btn-primary ${props.className ?? ''}`} />;
}
Fragment + key
function List({ items }: { items: Item[] }) {
return (
<dl>
{items.map(it => (
<React.Fragment key={it.id}>
<dt>{it.term}</dt>
<dd>{it.def}</dd>
</React.Fragment>
))}
</dl>
);
}
TypeScript — JSX.IntrinsicElements override
declare global {
namespace JSX {
interface IntrinsicElements {
'my-web-component': React.DetailedHTMLProps<
React.HTMLAttributes<HTMLElement> & { value?: string },
HTMLElement
>;
}
}
}
<my-web-component value="x" />
매 결정 기준
| 상황 | Approach |
|---|---|
| 새 React project | "jsx": "react-jsx" (automatic) |
| Preact / Solid | jsxImportSource 적절 설정 |
| Babel 사용 | "jsx": "preserve" + babel preset |
| Web component 통합 | JSX.IntrinsicElements 확장 |
| 매 server component | "jsx": "react-jsx" (RSC 호환) |
기본값: automatic runtime + TypeScript strict.
🔗 Graph
🤖 LLM 활용
언제: React/Preact/Solid component 작성, TS JSX 설정 디버깅, polymorphic API 설계.
언제 X: 매 plain HTML template (no transpile needed), 매 Vue SFC (<template> 별 syntax).
❌ 안티패턴
Reactimport 누락 (classic runtime): 매react-jsx로 migrate.- lowercase component name:
<myButton/>매 host element 로 처리됨 — 매 PascalCase 강제. key누락 in list: reconciliation 비용 폭증.- inline function child 의 남발: render 마다 새 reference — memoized child re-render 유발.
🧪 검증 / 중복
- Verified (react.dev JSX docs, TS Handbook JSX, React 19 RC notes).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — JSX automatic runtime + polymorphic patterns 정리 |