<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tina Kim on Medium]]></title>
        <description><![CDATA[Stories by Tina Kim on Medium]]></description>
        <link>https://medium.com/@valentinakim?source=rss-2dc1362b944f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VLlj9NocbXheT39t4LbkMw.jpeg</url>
            <title>Stories by Tina Kim on Medium</title>
            <link>https://medium.com/@valentinakim?source=rss-2dc1362b944f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 11:46:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@valentinakim/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[좋은 애플리케이션을 위한 플래닝 — 기능적 요구사항 접근 방식]]></title>
            <link>https://medium.com/@valentinakim/%EC%A2%8B%EC%9D%80-%EC%95%A0%ED%94%8C%EB%A6%AC%EC%BC%80%EC%9D%B4%EC%85%98%EC%9D%84-%EC%9C%84%ED%95%9C-%ED%94%8C%EB%9E%98%EB%8B%9D-%EA%B8%B0%EB%8A%A5%EC%A0%81-%EC%9A%94%EA%B5%AC%EC%82%AC%ED%95%AD-%EC%A0%91%EA%B7%BC-%EB%B0%A9%EC%8B%9D-81b541e8c959?source=rss-2dc1362b944f------2</link>
            <guid isPermaLink="false">https://medium.com/p/81b541e8c959</guid>
            <dc:creator><![CDATA[Tina Kim]]></dc:creator>
            <pubDate>Mon, 19 Jan 2026 21:47:44 GMT</pubDate>
            <atom:updated>2026-01-19T21:47:44.503Z</atom:updated>
            <content:encoded><![CDATA[<h3>좋은 애플리케이션을 위한 플래닝 — 기능적 요구사항 접근 방식</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SsJBDd2eD7WWHO1r5uUzWg.jpeg" /></figure><p>프론트엔드 개발을 하다 보면 “상태 관리”라는 말을 셀 수 없이 듣게 된다. useState 하나로 시작했던 간단한 프로젝트가 어느새 전역 상태, 서버 상태, URL 상태가 뒤엉킨 복잡한 애플리케이션으로 성장하고, 예상치 못한 리렌더링과 데이터 동기화 문제로 골머리를 앓은 경험이 있을 것이다. 지난 2024년 7월에 들은 ‘좋은 애플리케이션을 위한 플래닝 — 기능적 요구사항 접근방식’ 세션에서는 상태의 본질부터 실제 프로젝트 구성까지, 프론트엔드 개발의 핵심 의사결정 포인트들을 다뤘다.</p><h3>프론트엔드 개발에서의 ‘상태’란</h3><p>시간이 지남에 따라 변할 수 있는, UI를 결정하는 모든 데이터 즉, UI 렌더링의 기준이 되는 값으로 어떤 시점에 애플리케이션이 기억하고 있는 정보의 스냅샷이라고 볼 수 있다.</p><h3>상태의 특징</h3><ul><li><strong>동적(Dynamic):</strong> 사용자의 클릭, 타이핑, 또는 서버로부터의 응답에 의해 언제든지 변할 수 있다.</li><li><strong>반응형(Reactive):</strong> 사용자 인터랙션이나 외부 이벤트에 반응해서 상태가 변하면 그 상태를 참조하고 있는 화면(UI)이 <strong>즉시 다시 그려져야(Re-render)</strong> 한다.</li><li><strong>휘발성(Volatile):</strong> 일반적으로 페이지를 새로고침하면 초기화된다(로컬 스토리지 등에 저장하지 않는 한).</li></ul><h3>상태관리는 왜 필요한가?</h3><p>애플리케이션의 복잡도를 통제하기 위해, 즉 복잡해진 UI에서 데이터의 흐름을 통제하고 사용자에게 일관된 경험을 주기 위해서 필요하다.</p><h3>프론트엔드 상태의 5가지 유형</h3><h4>1. 전역 상태</h4><ul><li>로그인한 사용자 정보 (이름, 이메일, 권한 등)</li><li>여러 페이지에서 공유되는 장바구니 아이템 목록</li><li>다국어 설정 (한국어/영어)</li><li>다크모드/라이트모드 테마 설정</li></ul><h4>2. 서버 상태</h4><ul><li>게시글 목록 (GET /api/posts)</li><li>사용자 프로필 데이터 (GET /api/users/:id)</li><li>댓글 목록, 좋아요 수</li><li>제품 재고 정보</li></ul><h4>3. UI 상태</h4><ul><li>모달/다이얼로그 열림/닫힘 여부</li><li>드롭다운 메뉴 펼침/접힘 상태</li><li>로딩 스피너 표시 여부</li><li>현재 선택된 탭 인덱스</li><li>사이드바 확장/축소 상태</li></ul><h4>4. 브라우저 상태</h4><ul><li>localStorage에 저장된 최근 검색어</li><li>sessionStorage의 임시 폼 데이터</li><li>쿠키에 저장된 인증 토큰</li><li>IndexedDB의 오프라인 캐시 데이터</li></ul><h4>5. URL 상태</h4><ul><li>검색어 쿼리 파라미터 (?search=react&amp;page=2)</li><li>필터/정렬 옵션 (?category=frontend&amp;sort=latest)</li><li>현재 페이지 번호 (?page=3)</li><li>탭 선택 상태 (?tab=profile)</li></ul><p>참고 <a href="https://nuqs.dev/">nuqs — search params state manager</a></p><h3>상태라고 착각하기 쉬운 것은?</h3><ul><li>항상 같은 데이터</li><li>다른 곳에서 파생된 데이터</li><li>파생된 상태를 계산한 데이터</li><li>여러 상태를 조합한 데이터</li><li>props</li></ul><h3>상태 관리가 어려운 이유</h3><ul><li>React는 불변 상태를 요구하지만 상태 관리는 가변으로 하는 것이 편하다.</li><li>효과적인 로딩 상태 만들기 (낙관적 업데이트)</li><li>실패에 대한 사용자 시나리오 관리 (에러 핸들링)</li><li>백엔드와 상태를 얼마나 동기화할 것인가 (서버 상태) ex) cache, in-memory browser state. 계속 지속적으로 데이터를 풀링하고 가져오는것</li><li>데이터를 가져오는 페칭과 유저의 이벤트는 비동기인데 우리는 동기적으로 구현하기 위해 애를 쓴다.</li><li>서버에서 받아오는 데이터는 데이터 중심인데 우리는 컴포넌트 중심으로 만들기 위해 애를 쓴다.</li><li>무효화, 동기화, 업데이트, 파생 상태, 재요청 예상치 못한 리렌더링이 발생한다.</li></ul><h3>상태 잘 관리하는 방법</h3><ul><li>처음부터 불필요한 상태를 만들지 않는다</li><li>useEffect 남용하지 않기</li><li>컴포넌트에 의존적인 상태를 만든다. 즉 컴포넌트가 마운트되면 존재하고 언마운트되면 사라지는 상태</li></ul><h3>진화하는 컴포넌트 조합 방법</h3><ul><li>Presentational, Container + HOC 에 의존할 필요가 없다.</li><li>Hooks, Context API, useSyncExternalStore() 에 의해 강력해진 패턴</li><li>Compound Pattern, Render props, children이 핵심</li><li>Headless UI</li><li>아토믹 디자인 — 컴포넌트를 나누고 분류하고 관리하는 관점 학습하기 좋다.</li></ul><h3>진화하는 컴포넌트 관리 방법</h3><ul><li>Storybook의 무한 독주. 스냅샷 및 테스트까지 통합으로 가능</li><li>Figma를 기반으로 하는 통합 플러그인의 발전</li><li>Radix, Chakra, Shadcn, <a href="https://zagjs.com/">Zag.js</a>와 같은 생태계 발전</li></ul><h3>기능 요구 사항 도출하기</h3><h4>프로덕트의 종류</h4><ul><li>대시보드</li><li>SDK</li><li>디자인 시스템</li><li>데스크탑 애플리케이션</li><li>모바일 웹 애플리케이션</li><li>PC 웹 애플리케이션</li><li>웹뷰</li><li>React Native</li><li>커뮤니티</li><li>커머스</li><li>에디터</li><li>B2B? B2C?</li></ul><h4>프로젝트 및 아키텍처 구성 시 고려 요소들</h4><p><strong>프로젝트 선택 </strong><br>리믹스, next.js, cra, vite 기반, 모노레포, 워크스페이스(pnpm, npm), 폴리레포(하나의 거대한 프로젝트나 서비스를 구축할 때 기능이나 프로젝트 단위로 저장소(Repository)를 분리하여 관리하는 방식) 등</p><p><strong>프로젝트 표준 </strong><br>스타일 가이드, lint, biome 등</p><p><strong>디렉터리 구조 </strong><br>FSD, 헥사고날, 클린 아키텍처, 덕스 패턴(ducks pattern, 리덕스 디자인 패턴)</p><p><strong>상태관리</strong><br>- 탑다운 방식: store 같이 한 곳에 다 모아두고 위에서 필요한 곳에 내려받아서 사용 ex) Redux, Zustand<br>- 바텀업 방식: 범위별로, 국소적으로 필요한 상태부터 작은 단위로 올라가면서 사용. atom 기반의 상태를 만들고 그 상태를 ContextAPI로 컴포넌트마다 특정 레이어별로 묶어서 관리 가능 ex) Jotai, Recoil<br>- 가변적 상태 관리 ex) Mobx, Valtio<br>- URL 상태관리 ex) nuqs</p><p><strong>컴포넌트 관리 방법 </strong><br>구조를 정해야하고, 서드파티 라이브러리를 무엇을 쓰냐에 따라 달라짐. ex) Chakra, AntD, MUI, shadcn.</p><p><strong>스타일 관리 방법 </strong><br>css modules, css-in-js(emotion, styled), tailwindcss, zero runtime(PandaCSS, Vanilla extract),</p><p><strong>API 계층</strong><br>graphql, apollo client, tanstack router, next.js</p><p>라우팅은 어떻게 가져갈까?</p><p><strong>에러 핸들링</strong><br>어디서 throw 하고 어디서 catch 할지? 던질때 센트리 쓸지 데이터독 쓸지, 잡아서 어떻게 보여줄지</p><p><strong>에러 바운더리 범위</strong><br>axios 인터셉터</p><p><strong>CI/CD</strong></p><p><strong>테스트</strong><br>e2e, 스냅샷, 회귀테스트, 유닛 테스트 등등</p><p><strong>보안<br></strong>ex) html 서버에서 사용자 입력 받을때 dom sanitiation할 수 있는 <a href="https://github.com/cure53/DOMPurify">DOMPurify</a>. 인프런과 같은 비디오플레이어가 서비스의 주 기능이라면 파일암호화 중요.</p><p><strong>성능</strong></p><h3>체크리스트로 기준 만들기</h3><ul><li>어떤 마크업 방법을 사용할 것인가?</li><li>어떤 싱태 관리를 사용할 것인가?</li><li>어떤 데이터 페치 방법을 사용할 것인가?</li><li>어떤 프로젝트 구조를 사용할 것인가?</li><li>어떤 렌더링 전략을 사용할 것인가?</li><li>어떤 인증 &amp; 인가 방법을 사용할 것인가?</li><li>어떤 테스트 전략을 사용할 것인가?</li><li>어떤 Mocking 방법을 활용할 것인가?</li></ul><h3>도구</h3><ul><li>에디터는 무엇을 쓸까?<br>.vscode 파일 — 팀프로젝트에서 팀원들과 공유해서 IDE 컨벤션 공유하면 좋다</li><li>Next.js?, Remix?</li><li>Expo? React Native CLI?</li><li>TypeScript는 기본?</li><li>ESLint? Prettier …Other?<br>- lint와 formatter 구분하기! formatter는 코드스타일 변경, lint 잠재적인 오류를 정적 테스트하듯이 잡아주는 도구<br>- ESLint의 포맷팅 규칙 제거 (<a href="https://eslint.org/blog/2023/10/deprecating-formatting-rules/">https://eslint.org/blog/2023/10/deprecating-formatting-rules/</a>)</li><li>Husky, lint-staged …Other?<br>참고 — <a href="https://github.com/evilmartians/lefthook">Lefthook (githook manager written in GO)</a></li></ul><h4>&lt;번외&gt; 폴더 구조 잡을 시 신경쓰면 좋을 점</h4><ol><li>flat vs nested</li><li>colocation vs global</li><li>utils vs business<br>utils → 어느 프로젝트에서든 사용할 수 있는 로직<br>business → 현재 프로젝트에서만 사용되는거<br>어느정도의 utils을 분리하고 나면 핵심 비즈니스 로직만 남게 되고 자연스럽게 나머지는 utils로 분리하면 된다.</li><li>deep depth<br>리액트 커뮤니티에서는 depth를 최대 3–4 정도만 권장</li><li>dot naming</li></ol><pre>// dot naming 예시<br>// components/Button/Button.styled.ts<br>// components/Button/Button.types.ts<br>// components/Button/Button.tsx</pre><p>앞에 도메인, 동일한 관심사를 묶어버리고 뒤에 기능적인 카테고리, 소분류를 묶어서 dot naming을 함</p><p>결국 좋은 프론트엔드 애플리케이션을 만들기 위해서는 상태를 제대로 이해하고 관리하는 것에서 출발해야 한다. 전역, 서버, UI, 브라우저, URL이라는 5가지 상태 유형을 명확히 구분하고, 처음부터 불필요한 상태를 만들지 않으며, 컴포넌트 생명주기에 맞춰 상태를 설계하는 것이 중요하다. 하지만 상태 관리만큼이나 중요한 것은 프로젝트의 성격에 맞는 아키텍처와 도구를 선택하는 것이다. Redux를 쓸지 Jotai를 쓸지, CSR을 할지 SSR을 할지, 어떤 디렉터리 구조를 가져갈지는 정답이 없으며, 우리가 만드는 프로덕트의 종류와 팀의 상황에 따라 달라진다. 체크리스트를 만들고 기준을 세워가며, 각 선택이 가져올 트레이드오프를 이해하는 것이 성공적인 플래닝의 시작이다.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81b541e8c959" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[좋은 애플리케이션을 위한 플래닝 — 비기능적인 요구사항 접근방식]]></title>
            <link>https://medium.com/@valentinakim/%EC%A2%8B%EC%9D%80-%EC%95%A0%ED%94%8C%EB%A6%AC%EC%BC%80%EC%9D%B4%EC%85%98%EC%9D%84-%EC%9C%84%ED%95%9C-%ED%94%8C%EB%9E%98%EB%8B%9D-%EB%B9%84%EA%B8%B0%EB%8A%A5%EC%A0%81%EC%9D%B8-%EC%9A%94%EA%B5%AC%EC%82%AC%ED%95%AD-%EC%A0%91%EA%B7%BC%EB%B0%A9%EC%8B%9D-35d153e9ea35?source=rss-2dc1362b944f------2</link>
            <guid isPermaLink="false">https://medium.com/p/35d153e9ea35</guid>
            <dc:creator><![CDATA[Tina Kim]]></dc:creator>
            <pubDate>Mon, 19 Jan 2026 13:45:51 GMT</pubDate>
            <atom:updated>2026-01-19T13:45:51.566Z</atom:updated>
            <content:encoded><![CDATA[<h3>좋은 애플리케이션을 위한 플래닝 — 비기능적인 요구사항 접근방식</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SsJBDd2eD7WWHO1r5uUzWg.jpeg" /></figure><p>“왜 코끼리를 냉장고에 넣으려고 하는가?” 최신 기술 스택이 핫하다고 해서, 다른 회사에서 쓴다고 해서 우리 프로젝트에도 무조건 도입하려고 한 적이 있는가? 좋은 애플리케이션을 만들기 위해서는 기술 선택 이전에, 우리가 어디에 있고 무엇이 필요한지부터 파악하는 플래닝이 필요하다. 지난 2024년 7월 원티드 프리온보딩 ‘좋은 애플리케이션을 위한 플래닝’ 세션에서 배운 내용을 정리해본다.</p><h4>왜 코끼리를 냉장고에 넣으려고 하는가?</h4><ul><li>요즘 핫한 기술이라고 해서 회사 프로젝트에 도입하려고 하는경우</li><li>현재 프로젝트 잘 돌아가고 있는데 억지로 무언가를 도입하려고 하는 경우. 예를 들어, 디자인시스템이 굳이 필요하지 않은데 굳이 만들어서 억지로 도입해서 하는 경우</li></ul><h4>ROI(Return on Investment) 투자시간 대비 어떤 이득이 있나?</h4><p>신기술을 위한 ROI가 비즈니스 측면에서 늘 이득일까? 사용자는 신기술의 사용여부를 신경쓰지 않는다. 예를 들어, Kream이 React를 안쓴다고해서 사용자가 앱을 사용하지 않거나 하지 않음..</p><h4>냉장고의 사이즈 구하기</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IZrzOmqjg6MuRR3I-nozCQ.png" /></figure><p>회사의 각 성장 단계, 투자 시리즈 단계에 맞는 개발 형태로 진행해야한다. 예를 들어 아직 프로토타입 개발 단계인데 벌써 다국어지원 개발을 하는건 맞지 않다.</p><p>프로토타입 개발 단계에 있는 회사라면 빠르게 개발해서 시장 검증을 하고 다시 iteration 돌리고 이 루프를 빨리 하는 개발자가 뽑힐 것이고, 정식 서비스가 있고 확장 개발 하는 회사라면 굉장히 어려운 채용 프로세스를 뚫고 들어간 개발자. 그만큼 성과를 내는 실력 있는 개발자가 뽑힐 것이다.</p><ul><li>나는 어디에? 회사는 어디에?</li><li>내가 원하는 기술은 어디에 어울리는가?</li></ul><p><strong>TPO Time, Place, Occasion</strong></p><p>시간, 장소, 상황을 고려해야 한다. 같은 코드 같은 기술이더라도 상황에 따라 코드가 달라질 수 있다.</p><h3>애플리케이션 플래닝에서 흔히 마주하는 난관</h3><h4>모든것을 미리 예측하기는 어렵다.</h4><ul><li>회사에서 중요하게 생각하는 프로덕트의 최소 가치가 무엇인가?</li><li>최소한의 출시 가능한 마지노선 퀄리티가 어떠한가?</li><li>일정이 어떠한가?</li></ul><h4>모든 애플리케이션은 요구 사항 변경이 잦다.</h4><ul><li>내부 디자인, 요구사항, 정책 : 다양한 의견과 생각들 데이터가 아닌 감으로 진행하는 의사 결정과 논의</li><li>웹, 애플리케이션, 플랫폼 호환 : 웹, 앱 버전 호환 대응이나 플랫폼 지침 대응</li><li>경쟁사 대응</li><li>서비스 주요 타겟층의 변화 : 인구 감소, 고령화, 법적 대응, 정부 이슈</li><li>조직의 변화 : 결정권이 많거나 변화가 많을수록 더욱 큰 변화</li><li>시대적인 변화 : Paper → PC → WEB → Mobile → AI</li></ul><h3>좋은 애플리케이션은 무엇일까?</h3><h4>MVP (Minimum Viable Product)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*nem47YVO-EtbgbAP1mGGsA.png" /></figure><p>최소 기능을 갖춘 제품 또는 서비스. 핵심 기능이나 아이디어의 구현 필요하며 이후 반응을 통해 시장 반응 학습하고 지속적으로 제품을 개선해나가는 방식</p><p>핵심 기능만 작게 만들어서 출시해서 시장 반응 보고, 좋으면은 좀더 개선해서 출시하고 이러한 패턴을 반복한다.</p><h4>프로토타이핑</h4><p>서비스의 초기 버전 혹은 시제품. 시스템의 미완성 버전 또는 중요 기능이 포함되어 있는 시스템의 초기 모델</p><p>프로토타입을 통해 최초의 아이디어를 미리 테스트 → 최종 제품을 더욱 완성도 있게 개발할 수 있다.</p><h4>프리토타이핑</h4><p>제품이나 서비스인척하는(pre) 무언가를 만들어 시장에 내놓고 반응을 테스트하는 방법</p><p>새로운 제품, 서비스의 80% 이상은 실패한다. 제대로 만들기 전에 ‘될 놈’ 만들기</p><p>아이디어가 가치있는지 빠르게 검증할 수 있는 설계</p><h4>비 기능적인 요구사항 도출하기</h4><p>ISO 25000 STANDARDS</p><ul><li>성능</li><li>상호운용성</li><li>사용성</li><li>유효성</li><li>보안</li><li>가용성</li><li>수정 가능</li><li>유지보수성</li><li>테스트</li><li>확장성</li><li>재사용성</li><li>지원</li></ul><p>사용자를 위한 앱이 아니고 개발자를 위한 서비스라면 더더욱 ISO 표준을 준수해야한다. 기술 의존적이 아니라 비 기능적인 면을 test할 것이 굉장히 많음</p><p>서비스 예시) 센트리, 스토리북, Vercel SWC 등등</p><p>결국 좋은 애플리케이션 플래닝의 핵심은 ‘맥락’에 있다. 최신 기술이나 트렌디한 아키텍처가 중요한 것이 아니라, 우리 회사가 어느 성장 단계에 있는지, 사용자에게 어떤 가치를 전달해야 하는지, 그리고 얼마나 빠르게 시장의 반응을 확인하고 개선할 수 있는지가 더 중요하다. 코끼리를 냉장고에 억지로 넣으려 하기보다는, 지금 우리에게 맞는 냉장고의 크기를 먼저 파악하고, MVP와 프로토타이핑을 통해 빠르게 검증하며, 성능과 보안 같은 비기능적 요구사항까지 고려한 균형잡힌 개발을 해야 한다. 기술은 목적이 아닌 수단이며, TPO에 맞는 현명한 선택이 지속 가능한 서비스를 만드는 출발점이다.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35d153e9ea35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Structure, Architecture, System Design 그 차이가 무엇일까 (feat. 추상화와 단어장)]]></title>
            <link>https://medium.com/@valentinakim/structure-architecture-system-design-%EA%B7%B8-%EC%B0%A8%EC%9D%B4%EA%B0%80-%EB%AC%B4%EC%97%87%EC%9D%BC%EA%B9%8C-feat-%EC%B6%94%EC%83%81%ED%99%94%EC%99%80-%EB%8B%A8%EC%96%B4%EC%9E%A5-69ee650447b6?source=rss-2dc1362b944f------2</link>
            <guid isPermaLink="false">https://medium.com/p/69ee650447b6</guid>
            <category><![CDATA[아키텍처]]></category>
            <category><![CDATA[설계]]></category>
            <category><![CDATA[디자인시스템]]></category>
            <dc:creator><![CDATA[Tina Kim]]></dc:creator>
            <pubDate>Sun, 11 Jan 2026 00:36:57 GMT</pubDate>
            <atom:updated>2026-01-11T00:40:27.465Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SsJBDd2eD7WWHO1r5uUzWg.jpeg" /></figure><p>지난 2024년 7월 원티드 프리온보딩 온라인 세션 내용을 요약정리해보았다.</p><p>세션 시작 전 사전과제로 소프트웨어 개발 업계에서 자주 사용하는 <em>구조, 아키텍처, 설계</em>라는 개념에 대해서 한번 생각해보는 과제가 있었다. 내가 생각하는 구조, 아키텍처 및 설계란 다음과 같다.</p><h4>구조 Structure</h4><p>IT 업계에서 지칭하는 구조라고 함은, 프로젝트의 뼈대 혹은 청사진과 같은 거라고 생각한다. 구조를 봤을 때 이 프로젝트가 어떻게 구성되어있을지가 한눈에 보일 수 있어야 한다고 생각.</p><h4>아키텍처 Architecture</h4><p>구조 보다 한단계 넓은 범위의 개념이라고 생각. 여러 개의 구조(프론트엔드, 백엔드, 데이터베이스, 인프라 등)가 모여서 하나의 서비스 아키텍처를 구성</p><h4>설계 System Design</h4><p>요구사항을 바탕으로 유지보수성,확장성을 고려하여 서비스 구조나 아키텍처를 견고하게 만들기 위한 과정</p><p>강사님이 정리해주신 정의는 다음과 같다.</p><h4>구조 Structure</h4><ul><li>소프트웨어를 이루는 모듈이나 집합체의 관계나 그 형태</li><li>계층으로 나뉠 수 있다. 수직적 혹은 수평적으로 구성 가능</li><li>예시: Directory Structure</li></ul><h4>아키텍처 Architecture</h4><ul><li>시스템의 구조를 정의한다.</li><li>IT에서의 아키텍처는 넓은 범위의 시스템 주요 구성 요소 연결하고 구성한다.</li></ul><p><strong>좋은 아키텍처란</strong></p><ul><li>최고의 설계보다는 트레이드오프</li><li>ROI (Return on Investment) 고려<br>- 우리의 모든 시간은 리소스. 투자 대비 반환되는 효과가 어떤 것일까?</li><li>No Silver bullet</li></ul><h4>설계 System Design</h4><ul><li>시스템 혹은 프로젝트의 전반적인 구조나 흐름을 계획하고 정의하는 과정을 생각해볼 수 있다.</li><li>설계는 비-개발적인 면도 포함될 수 있다.</li><li>A to Z로 흐르는 프로덕트와 프로젝트의 모든 전반적인 흐름을 담아내기도 한다.</li></ul><p>이렇게 구조, 아키텍처, 설계 라는 용어만 해도 사람들이 각자가 정의내리는 바가 모두 다 다른데 하물며 개발업계에서 자주 사용하는 다른 수많은 다른 단어들은 어떠한가..</p><h3>단어장 만들기 — 추상화의 함정에서 벗어나기</h3><p>개발업계에서 유독 알아듣기 어려운 용어들이 많은데 아마 추상화를 많이 해서 그런 걸 수 있다.</p><p>이로 인한 문제로는,</p><h4>학습에 어려움을 야기</h4><p>소프트웨어 개발 서적이나 문서에서의 번역투와 추상적인 의미론을 단번에 이해하지 못하면 학습에 어려움이 있다.</p><p>예시)<br>- MDN 한국어 번역 페이지 — 다소 어색한 번역이 종종 있음<br>- p 태그 — paragraph 라는 의미를 가진 태그이나 비개발자가 봤을때 p가 무슨 뜻인지 무슨 역할을 하는 태그인지 단번에 알기 어려울 수 있다.</p><h4>직군마다 동일한 용어를 다르게 해석함으로서 나타나는 커뮤니케이션 비용</h4><p>예시) 얼라인 (Align) — 직군마다 다 다르게 알아들을 수 있음</p><ul><li>PM: 우리 결정 사항을 정렬하자</li><li>PO: 우리 내용을 정리해서 정렬하자</li><li>개발자: 우리 평균을 정의하자</li></ul><p><em>→ 모르면 그냥 무지를 드러내자(!)</em></p><h4>추상화의 더 큰 문제 — 고유명사화</h4><p>고유명사화의 예시)</p><ul><li><strong>당근</strong>하자</li><li>시간되면 <strong>카톡</strong>해</li><li>데일밴드</li><li>호치키스</li></ul><p>인터페이스화가 안 되었을때 문제가 됨. 특히 협업의 관점에서 커뮤니케이션 비용이 증가될 수 있음</p><blockquote>팀원 A: “이거 axios로 처리했어요”<br>팀원 B: (axios가 뭐지? HTTP 클라이언트? fetch wrapper?)</blockquote><blockquote>vs</blockquote><blockquote>팀원 A: “HTTP 요청을 axios 라이브러리로 처리했어요”<br>팀원 B: (아, HTTP 요청이구나. 다른 라이브러리도 가능하겠네)</blockquote><p>신입이나 다른 기술 스택에서 온 사람은 맥락 없이 고유명사만 던져지면 이해하기 어렵다. “왜 그걸 썼는지”를 공유하지 않으면 같은 도구를 다르게 이해하고 사용하게 될 가능성이 있다.</p><p>따라서 이를 명확하게 하기 위한 단어장/용어집을 만듦으로써 협업을 원활하게 할 수 있다.</p><p>예시) 라인의 사내 용어사전</p><p><a href="https://engineering.linecorp.com/ko/blog/glossary-project-line-words-open">사내 용어 사전, LINE Words 오픈 여정기</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fnkAMCr7HAsxlg0wZ_cmQ.png" /></figure><p>(살짝 TMI지만, 강사님의 단어장 정리 방식이 너무 좋은거 같다. 마치 개인 위키피디아 느낌. 옵시디언을 활용해서 단어 정의나 예시 등을 쓰고 거기에서 사용된 용어가 있으면 그 용어를 링크를 걸어서 그 용어의 정의 페이지로 이동하게끔 단어장을 정리하셨던데 매우 좋은 방법인듯하다. 나도 개발 공부할때 해당 방식으로 메모를 정리해야겠다.)</p><p>추상화 된 개념이든 무엇이든 어려운 것을 공부할 때 <em>해부를 해야한다</em>.</p><ul><li>추상화된 것을 하나하나 해부해서 그 내부를 이해하기 (Under the hood)</li><li>코드 레벨에서 해부하기보다 직접 비슷하게 만들어보기</li></ul><h3>멘토 개발자 분들의 Q&amp;A</h3><h4>Q. 구조 혹은 아키텍처란</h4><p><strong>A</strong> : MFA, 모노레포 CI/CD, SSR 등 모두 리액트 아키텍처라고 할 수 있다. 해당 프레임워크에서 원하는 혹은 의도하고 있는 여러가지 주체들이 있을 건데 그걸 어느정도로 중요하게 생각하게 만드는 구조를 가져갈 것이냐가 관건</p><p>리액트 아키텍처 범주 — 전체적인 시스템 구조</p><p>평소에 구조와 아키텍처를 명확히 구분하려고 함</p><p>프론트엔드 상태에서만 일어나는 것은 Structure, 프론트 외적으로 백엔드나 서버, 인프라 쪽과 협업해야하는 코드 혹은 프로젝트 전체적인 구조들은 아키텍처라고 생각.</p><p>어떤 프로젝트를 시작할때, IDE로 코드 뭉치를 열때, 폴더링을 하고 파일을 만드는 이 작은 스코프들은 <em>구조</em><br>프로젝트를 포괄하거나 혹은 프로젝트에 포함되지 않은 외부의 영역까지 어떤 식으로 청사진을 그릴 건지를 얘기하는 것이 <em>아키텍처</em></p><p>개발을 글쓰기에 비유</p><ul><li>글쓰기 : 주인공은 누군지, 플롯은 어떻게, 어떤식으로 스토리를 전개해나갈 것인가를 생각</li><li>개발 : 어떤 기술 스택을 사용해서 어떻게 데이터페칭을 해오고 페칭해온 데이터를 어떤식으로 전개할지 생각. 이런 전체적인 맥락을 구체화 시켜가는 것이 설계.</li></ul><p>다른 사람이 이 설계를 보고 나서 여기서 이렇게 되니 다음에는 이렇게 되겠네 하고 예상했는데 실제로도 그렇게 작동되고 있을때가 좋은 설계라고 생각</p><h4>Q: 회사에서 FSD 시도해보고 싶을 때</h4><p><strong>A</strong> : FSD 해보고 싶으면 적용할 범위를 좁혀서 적용해볼 수 있다. 기능 하나, 페이지 하나 혹은 서비스 하나 이런 식으로 쪼개서 작은 단위로 적용해볼 수 있다.</p><p>작게나마 시도해보고 분명한 장점을 느꼈으면, 팀원들이나 상사에게 어떻게 전파하면 이 사람들이 같이 FSD를 써볼 수 있게 할 수 있는지를 생각해본다.</p><h4>Q: 같이 일하고 싶은 주니어 개발자 혹은 취업 조언</h4><p><strong>A</strong> : 뭐 하나에 꽂혀서 열심히 파본 경험 있는 사람</p><p>이런 경험을 해봤네 이런 코드도 짜봤네 를 이력서나 자소서에서 보인 경우 다음 스텝으로 넘길 수 있다(서류통과). 지원하고 빠르게 수정해서 다시 지원하고, 회복탄력성 중요</p><p>성장가능성. 내가 가진 역량이나 가능성을 가지고 내가 가고자 하는 조직에 얼마나 기여할 수 있는가, 내가 가진 소프트스킬을 얼마나 잘 활용하는지, 내 주변의 리소스를 얼마나 잘 활용할 수 있는가, 활용해서 문제를 어떻게 해결할 수 있는가</p><p>내 상황을 객관적으로 잘 인지하는지, 소프트스킬이나 하드 스킬을 이용해서 그 회사에 어떻게 기여할 수 있는지, 나의 강점을 잘 찾아보기, 내가 어떤 환경에 잘 몰입하는지, 주변사람들에게 얘기하기 — 내가 어떤 환경에 몰입한다든지를 알리면 팀장님이 그런 동료를 붙여주거나 업무를 줄 수 있다.</p><p>나만이 가진 강점으로 회사에 어떻게 기여할 수 있는지를 이력서에 잘 녹여서 써야함</p><h4>함께하기 일하기 좋은 주니어나 신입</h4><p>긍정적이고 적극적인 태도를 가진 주도적인 개발자</p><p>개선할게 보이거나 아이디어가 떠오른다 하는 경우, 기술적으로 토론하고 함께 고민하고 적극적으로 해보고자 하는 의지가 있는 개발자. 이렇게 저렇게 한번 해보는게 어떨지, 한번 해보는게 어떨까, 한번 부딪혀보는 긍정적인 태도를 가진 주도적인 개발자</p><p>면접시 강사님은 know와 how를 같이 물어본다고 하심. ‘회사 프로젝트에서 이 기술을 썼는데 어땠나요?’ 라는 질문에 ‘그냥 회사에서 써서요, 사수가 써서요’ 라는 답보다 좀더 능동적인 대답할것</p><p>know, how 둘다 잘 아는 사람이라면 어느 회사든 갈 수 있다.</p><p>강사님이 면접에서 물어봤던 질문 예시) tanstack query에서 staletime이 어떻게 동작할까요?</p><h4>물경력에 대한 걱정</h4><p>회사에서 프론트 개발도, 백엔드 개발도 조금씩 해본 경우, 이도저도 아닌 실력이라고 생각하는 개발자들이 많다. 풀스택을 할 줄 안다는 것 자체는 좋은건데, 프론트랑 백엔드를 같이 하면서 어떤 식의 이점을 얻었는지, 이 경험을 통해서 실무를 어떻게 풀었는지를 설명할 수 있는 이력서를 써야한다.</p><p>풀스택은 2명 분을 1명이 하는 것이다. 즉 서비스가 만들어지는 속도의 차이를 만들어냄. (여기서 완성도는 고려대상에서 제외) 따라서 ‘빠르게 실행할 수 있는 풀스택 개발을 진행했었습니다’ 라고 이력서를 시작할 수 있다.</p><p>내가 생각하는 나의 부족한 부분이나 내가 물경력이라는 걱정을 하기보다 내가 가진 강점에 좀더 초점을 맞추고 어떻게 자소서나 이력서에 잘 녹여낼지를 고민 하는게 더 좋다.</p><p>야근, 트러블슈팅 등 회사 일하면서 많이 겪었던 일들, 노력의 흔적, 문제를 해결하기까지의 과정 등을 잘 정리해서 이력서에 녹여내기</p><h4>Q: 웹개발자 면접 — 뷰 경력자가 리액트 개발자 면접에 들어온다면</h4><p><strong>A</strong> : 자바스크립트나 웹개발에 대한 질문을 한다. 리액트 개발자, 뷰 개발자가 아니라 웹서비스를 개발하는 프론트엔드 개발자임을 생각하자. 자바스크립트, 브라우저, 웹페이지 성능 등 프론트엔드 개발하는데에 있어서 프레임워크를 우선적으로 알아야하는게 아니다. 일하면서도 충분히 배울 수 있음. 프레임워크에 얽매이지 말고 웹개발자라면 알아야하는게 무엇인지를 알고 공부하기.</p><p>면접에서 질문 답할때 내가 가진 자원들을 가지고 어떻게 문제를 해결했나를 생각해보고 답 준비하기</p><p>경력직 이직시, 내가 겪고 있는 문제상황이 있고 어떻게 접근해서 어떻게 해결했고 그 결과를 사람들에게 어떻게 알렸고 다른 사람들도 내가 가진 문제를 똑같이 해결할 수 있게 만들었고 이런 경험 얘기하기</p><h4>Q: 기술 공부</h4><p><strong>A</strong> : 일단 그냥 공부해보라. 이거 공부하면 득이될까 저거 공부하면 득이될까 간만 보다가 공부 안하는 사람 많다. 뭐 공부할지 고민하다가 시간만 날리고 결국 공부를 안함.. 간만 보다가 공부 안하지 말고 일단 그냥 해보라.</p><p>무엇이든 배워놓으면 도움이 된다. 강사님의 국비학원 시절 자바스프링 배웠던 경험 예시. 나중에 취업해서 백엔드분들과 일할때 도움이 많이 됐다고 함. (나도 마찬가지.. 국비학원에서 오라클 배운게 나중에 DB 관련 업무할때 매우 큰 도움이 됐다)</p><h4>Q: 사이드프로젝트 1인 개발할때나 혼자 공부할때 맞는 방향으로 가고있는지 잘 모를때</h4><p><strong>A</strong> : 맞는지 틀리는지 아무도 답을 내릴 수 없는 경우가 많기 때문에 그냥 일단 해봐라. 맞는지 안맞는지는 계속 해보다 보면은 방향이 잡히게 된다. 나중에 지나서 보면은 그때 깨닫게 된다. 결국은 일단 해봐야 그게 내 경험이 됨. 이 프레임워크를 쓰는게 맞는지, 이렇게 개발 하는게 맞는지 고민할 시간에 그냥 개발해보라. 이렇게 하다보면은 언제가 깨달음을 얻는 순간이 오지 않을까 라고 생각하기.</p><p>멘토님의 경험 예시) 블로그 글 쓸 때 이렇게 쓰는게 정답이 아닐 수 있지만 내가 이때는 이런 문제를 이렇게 해결했지 그냥 계속 반복하다보니 어느순간 내가 어떤 것을 잘못했고 어떤것이 효율적이었고를 깨닫게 되는 순간이 있었다고 하심</p><p>너무 외롭게 내가 정답을 모른채 헤매고 있다고 생각하지 말고 어차피 사용자들은 리액트를 썼는지 뷰를 썼는지 eval 코드를 썼는지 모른다, 매순간 최선의 답을 스스로 고민해보고 계속 도전해보는걸 추천</p><p>면접 공부 방법 → 면접을 많이 봄으로써 면접 공부 (상황에 나를 내던지기)</p><p>현실세계 문제를 해결하는 거나 내가 쓰고 싶은거 만들기</p><p>그냥 단순히 용어를 들어보기만 했지 실제로 깊이 생각해보지 않은 개념들에 대해서 한번 생각해보고, 단어장/용어집 만들기와 같이 개인 혹은 이해관계에 있는 사람들과 서로 추상화된 개념들을 명확히 정의 혹은 약속함으로서 소프트웨어 설계 과정에서 발생할 수 있는 커뮤니케이션 비용을 줄일 수 있음을 배운 유익한 세션이었다.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69ee650447b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner’s Guide to Obsidian Templater (with step-by-step screenshots): Save Time with Smart…]]></title>
            <link>https://medium.com/@valentinakim/a-beginners-guide-to-obsidian-templater-with-step-by-step-screenshots-save-time-with-smart-b001636ba202?source=rss-2dc1362b944f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b001636ba202</guid>
            <category><![CDATA[obsidian-plugins]]></category>
            <category><![CDATA[obsidian-templater]]></category>
            <category><![CDATA[obsidian]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[obsidiantips]]></category>
            <dc:creator><![CDATA[Tina Kim]]></dc:creator>
            <pubDate>Wed, 21 May 2025 14:31:25 GMT</pubDate>
            <atom:updated>2025-05-21T14:42:21.971Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Beginner’s Guide to Obsidian Templater (with step-by-step screenshots): Save Time with Smart Templates</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*ARI9-c9fCKGKhYMZneXSYA.png" /></figure><p>Tired of copying the same note structure over and over again in Obsidian? Templater is a powerful plugin that lets you automate repetitive tasks with simple scripting. In this post, I’ll walk you through how to use Templater to save time and make your notes smarter.</p><ol><li>Install Templater plugin</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oajr4mMuiA1SY0goQiRDww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z8_52mGjU0JduYXGTJGpSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Au5bo_7u2eutUp3xzTnJRw.png" /></figure><p>2. Enable Templater plugin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wmqgKElCqxVRZ-FKe382A.png" /></figure><p>3. Add your custom template</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OJ6zwO78SeUqH-8wt298UA.png" /></figure><p>4. Configure Templater setup</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqZud1dfcgvK41NR0tR7zA.png" /></figure><p>Add the template folder location and enable <strong>Trigger Templater on new file creation</strong> option</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IFp-SeM_WM6z0ppz1YXlZA.png" /></figure><p>Enable the <strong>Enable folder templates</strong> option and add a folder template. You need to add two things for the folder template:</p><ul><li>The path of the folder where new files will be created using a template</li><li>The template file path</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MdoR8I0KQFJVNJa4U3TfjQ.png" /></figure><p>If you have set the template folder path correctly, an autocomplete dropdown should appear.</p><p>Congrats! Now you are all set!</p><p>Try creating a new file in the folder. A new file will be generated in that folder using the template you selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*IKXwrtpnK3wiX00nKnKKbw.gif" /></figure><p>Hope this guide gave you a solid start with Templater in Obsidian. With a bit of automation, taking notes can feel way more organized and productive. Have fun templating!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b001636ba202" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Common Pitfalls When Using HTML Script Tags (And How to Fix Them)]]></title>
            <link>https://medium.com/@valentinakim/common-pitfalls-when-using-html-script-tags-and-how-to-fix-them-e1f7ca0e404a?source=rss-2dc1362b944f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1f7ca0e404a</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Tina Kim]]></dc:creator>
            <pubDate>Sat, 03 May 2025 00:56:37 GMT</pubDate>
            <atom:updated>2025-05-03T00:56:37.867Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Close-up view of colorful JavaScript code on a dark background, highlighting syntax such as functions, variables, and strings in red, green, blue, and yellow" src="https://cdn-images-1.medium.com/max/1023/1*QMMkBNRWB4IwaUcAtOE0JQ.png" /></figure><h3>TL;DR</h3><p>Incorrect use of &lt;script&gt; tags can cause broken functionality, performance issues, and hard-to-debug errors. This guide covers the top 5 pitfalls — like dependency order problems, misuse of async and defer, mixing inline with external scripts, and module compatibility — and shows how to fix each one with practical, reliable solutions.</p><h3>Pitfall #1: Dependency Order Issues</h3><p>One of the most common mistakes is loading scripts in the wrong order. When one script depends on another, the dependency must be loaded first.</p><p>Here’s what <strong>not</strong> to do:</p><pre>&lt;!-- 🚫 PROBLEM: app.js depends on jQuery but loads first --&gt;<br>&lt;script src=&quot;app.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;&lt;https://code.jquery.com/jquery-3.6.0.min.js&gt;&quot;&gt;&lt;/script&gt;</pre><p>If your app.js uses jQuery functions like $(), you&#39;ll encounter the dreaded $ is not defined error in your console.</p><p><strong>✅ The fix:</strong> Always load dependencies before the scripts that need them:</p><pre>&lt;!-- ✅ SOLUTION: jQuery loads before the code that needs it --&gt;<br>&lt;script src=&quot;&lt;https://code.jquery.com/jquery-3.6.0.min.js&gt;&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;app.js&quot;&gt;&lt;/script&gt;</pre><h3>Pitfall #2: Misusing async and defer Attributes</h3><p>The async and defer attributes can dramatically improve page loading, but they&#39;re often misused.</p><p>Here’s a problematic implementation:</p><pre>&lt;!-- 🚫 PROBLEM: Using async with dependent scripts --&gt;<br>&lt;script src=&quot;utilities.js&quot; async&gt;&lt;/script&gt;<br>&lt;script src=&quot;app.js&quot; async&gt;&lt;/script&gt; &lt;!-- depends on utilities.js --&gt;</pre><p>With both scripts marked as async, they&#39;ll load in parallel and execute as soon as they&#39;re available. Since loading times vary, app.js might execute before utilities.js is ready, causing errors.</p><p><strong>✅ The fix:</strong> Use defer for scripts that have dependencies:</p><pre>&lt;!-- ✅ SOLUTION: defer maintains execution order --&gt;<br>&lt;script src=&quot;utilities.js&quot; defer&gt;&lt;/script&gt;<br>&lt;script src=&quot;app.js&quot; defer&gt;&lt;/script&gt;</pre><p>The defer attribute ensures scripts download in parallel but execute in the order they appear in the document, after the HTML is fully parsed.</p><h3>Pitfall #3: Mixing Inline and External Scripts</h3><p>Another common issue arises when inline scripts try to use functions from external scripts that haven’t finished loading.</p><p>Consider this problematic code:</p><pre>&lt;!-- 🚫 PROBLEM: Inline script runs before external script loads --&gt;<br>&lt;script src=&quot;utilities.js&quot;&gt;&lt;/script&gt;<br>&lt;script&gt;<br>  // Attempting to use a function from utilities.js<br>  formatDate(new Date()); // Uncaught ReferenceError: formatDate is not defined<br>&lt;/script&gt;</pre><p>Even though utilities.js appears first, the browser doesn&#39;t guarantee it will finish loading before the inline script executes.</p><p><strong>✅ The fix:</strong> Use event listeners to ensure your code runs at the right time:</p><pre>&lt;!-- ✅ SOLUTION: Wait for the DOM to load --&gt;<br>&lt;script src=&quot;utilities.js&quot;&gt;&lt;/script&gt;<br>&lt;script&gt;<br>  document.addEventListener(&#39;DOMContentLoaded&#39;, function() {<br>    formatDate(new Date()); // Now this works!<br>  });<br>&lt;/script&gt;</pre><p>For more certainty with external scripts, you could also use:</p><pre>&lt;script src=&quot;utilities.js&quot; onload=&quot;initializeApp()&quot;&gt;&lt;/script&gt;<br>&lt;script&gt;<br>  function initializeApp() {<br>    formatDate(new Date());<br>  }<br>&lt;/script&gt;</pre><h3>Pitfall #4: Module and Regular Script Compatibility Issues</h3><p>JavaScript modules have their own scope, which can cause problems when mixing with traditional scripts.</p><p>Here’s what causes issues:</p><pre>&lt;!-- 🚫 PROBLEM: Variables aren&#39;t shared between script types --&gt;<br>&lt;script&gt;<br>  const apiKey = &quot;abc123&quot;;<br>  // Set as a global variable (but not accessible to modules)<br>&lt;/script&gt;<br>&lt;script type=&quot;module&quot; src=&quot;api-client.js&quot;&gt;&lt;/script&gt;<br>&lt;!-- api-client.js cannot access apiKey --&gt;</pre><p><strong>✅ The fix:</strong> Explicitly attach values to the global window object:</p><pre>&lt;!-- ✅ SOLUTION: Use the window object for global access --&gt;<br>&lt;script&gt;<br>  window.apiKey = &quot;abc123&quot;; // Explicitly global<br>&lt;/script&gt;<br>&lt;script type=&quot;module&quot; src=&quot;api-client.js&quot;&gt;&lt;/script&gt;<br>&lt;!-- Now api-client.js can access window.apiKey --&gt;</pre><h3>Pitfall #5: Cross-Origin Resource Handling</h3><p>When loading scripts from other domains, proper CORS (Cross-Origin Resource Sharing) attributes improve security and error handling.</p><p>The problematic approach:</p><pre>&lt;!-- 🚫 PROBLEM: Limited error information --&gt;<br>&lt;script src=&quot;&lt;https://third-party-cdn.com/script.js&gt;&quot;&gt;&lt;/script&gt;</pre><p>Without proper attributes, you’ll receive limited error information if the external script fails.</p><p><strong>✅ The fix:</strong> Add the crossoriginattribute:</p><pre>&lt;!-- ✅ SOLUTION: Enable detailed error reporting --&gt;<br>&lt;script<br>  src=&quot;&lt;https://third-party-cdn.com/script.js&gt;&quot;<br>  crossorigin=&quot;anonymous&quot;<br>&gt;&lt;/script&gt;</pre><p>For additional security with CDN resources, include the integrityattribute:</p><pre>&lt;script<br>  src=&quot;&lt;https://third-party-cdn.com/script.js&gt;&quot;<br>  crossorigin=&quot;anonymous&quot;<br>  integrity=&quot;sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC&quot;<br>&gt;&lt;/script&gt;</pre><h3>Key Takeaways</h3><p>The &lt;script&gt; tag may seem simple, but using it incorrectly can lead to frustrating bugs and performance issues. To ensure your scripts load efficiently and error-free:</p><ol><li><strong>📋 Mind your script order</strong>: Load dependencies before the scripts that need them</li><li><strong>⏱️ Use async/defer strategically</strong>:</li></ol><ul><li>async for independent scripts</li><li>defer for scripts that need DOM access or have specific execution order</li></ul><p>3.<strong> 🔒 Enhance security</strong> with integrity and crossorigin attributes for third-party resources</p><p>4. <strong>📦 Embrace modularity</strong> with type=&quot;module&quot; where appropriate</p><p>5. <strong>🔄 Manage dependencies</strong> carefully, especially when mixing different script types</p><p>By following these principles, you’ll create web applications that load faster and encounter fewer unexpected errors. When refactoring legacy code, pay special attention to script tag implementation — it’s often an easy win for both performance and reliability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1f7ca0e404a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Complete Guide to HTML Script Tags: Part 2]]></title>
            <link>https://medium.com/@valentinakim/the-complete-guide-to-html-script-tags-part-2-38427692ac6f?source=rss-2dc1362b944f------2</link>
            <guid isPermaLink="false">https://medium.com/p/38427692ac6f</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Tina Kim]]></dc:creator>
            <pubDate>Sat, 03 May 2025 00:40:48 GMT</pubDate>
            <atom:updated>2025-05-03T01:18:57.709Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Complete Guide to HTML Script Tags: Part 2 — Script Positioning</h3><figure><img alt="Close-up view of colorful JavaScript code on a dark background, highlighting syntax such as functions, variables, and strings in red, green, blue, and yellow." src="https://cdn-images-1.medium.com/max/1023/1*QMMkBNRWB4IwaUcAtOE0JQ.png" /></figure><h3>TL;DR</h3><p>Script positioning in HTML is not just about organization — it’s a critical performance factor. Scripts in the &lt;head&gt; block rendering unless managed properly. Use techniques like defer, DOMContentLoaded, ES6 type=”module”, and dynamic injection to optimize loading, preserve order, and keep your UI fast and responsive. This guide walks through each method with real-world examples and best practices.</p><h3>Script Positioning: Where You Place It Matters</h3><p>The location of your &lt;script&gt; tags isn&#39;t just a matter of code organization—it fundamentally affects how quickly your users see and interact with your content.</p><h3>Head vs. Body</h3><h4>When scripts are placed in the &lt;head&gt;:</h4><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;script src=&quot;app.js&quot;&gt;&lt;/script&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;!-- Content appears after script loads --&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>⚠️ <strong>The issue:</strong> The browser pauses HTML parsing until it downloads and executes the script, delaying the rendering of any content below. Your users might see a blank page while waiting for scripts to load!</p><h4>When scripts are placed at the end of &lt;body&gt;:</h4><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;!-- No blocking scripts here --&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;!-- Content loads first --&gt;<br>  &lt;div id=&quot;content&quot;&gt;Hello world!&lt;/div&gt;<br>  &lt;!-- Scripts load last --&gt;<br>  &lt;script src=&quot;app.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>✅ <strong>The benefit:</strong> HTML content renders first, giving users something to see while scripts load in the background.</p><p>This explains why many performance optimization guides recommend placing scripts at the bottom of your HTML — but this approach has its own drawbacks, including potentially visible “jumps” as scripts modify the DOM after content is displayed.</p><h3>Smart Script Loading: The Best of Both Worlds</h3><p>What if we could keep our scripts organized in the &lt;head&gt; (where they logically belong) without blocking page rendering? Here are five powerful techniques to achieve exactly that:</p><h4>#1: The defer Attribute</h4><p>The defer attribute is the simplest and most effective solution for external scripts:</p><pre>&lt;head&gt;<br>  &lt;script src=&quot;script.js&quot; defer&gt;&lt;/script&gt;<br>&lt;/head&gt;</pre><p><strong>How it works:</strong></p><ol><li>The browser downloads the script in parallel with HTML parsing</li><li>HTML parsing continues uninterrupted (no blocking!)</li><li>The script executes after the DOM is fully constructed</li><li>Multiple deferred scripts execute in their original document order</li></ol><p><em>The defer attribute allows parallel downloading without blocking HTML parsing</em></p><blockquote><em>💡 Pro tip: defer is perfect for your main application code that needs access to DOM elements.</em></blockquote><h4>#2: DOM Event Listeners</h4><p>Event listeners ensure your code executes at the right moment in the page lifecycle:</p><pre>&lt;head&gt;<br>  &lt;script&gt;<br>    document.addEventListener(&#39;DOMContentLoaded&#39;, function() {<br>      // This code runs after DOM is ready but before images and stylesheets finish<br>      console.log(&#39;DOM is ready for manipulation&#39;);<br>      initializeApp();<br>    });<br>  &lt;/script&gt;<br>&lt;/head&gt;</pre><p>For even more certainty, you can wait for the complete page load:</p><pre>&lt;head&gt;<br>  &lt;script&gt;<br>    window.addEventListener(&#39;load&#39;, function() {<br>      // This runs after ALL resources (images, CSS, iframes) have loaded<br>      console.log(&#39;Page is fully loaded&#39;);<br>      initializeAnalytics();<br>    });<br>  &lt;/script&gt;<br>&lt;/head&gt;</pre><h4>#3: Dynamic Script Injection</h4><p>This technique gives you programmatic control over when scripts load:</p><pre>&lt;head&gt;<br>  &lt;script&gt;<br>    document.addEventListener(&#39;DOMContentLoaded&#39;, function() {<br>      // Create the script element<br>      const script = document.createElement(&#39;script&#39;);<br>      script.src = &#39;heavy-functionality.js&#39;;<br>      // Add it to the document<br>      document.head.appendChild(script);<br>    });<br>  &lt;/script&gt;<br>&lt;/head&gt;<br></pre><p><strong>The advantage:</strong> You can load scripts conditionally based on user interactions or other triggers, perfect for performance optimization patterns like lazy loading.</p><h4>#4: ES6 Modules</h4><p>Modern JavaScript modules automatically defer execution:</p><pre>&lt;head&gt;<br>  &lt;script type=&quot;module&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;<br>&lt;/head&gt;</pre><p><strong>What makes modules special:</strong></p><ul><li>They’re automatically deferred (even inline module scripts!)</li><li>They maintain proper execution order</li><li>They have their own scope, preventing global namespace pollution</li><li>They enable a cleaner import/export architecture</li></ul><pre>// Inside app.js (module)<br>import { UserProfile } from &#39;./components/user-profile.js&#39;;<br>import { api } from &#39;./services/api.js&#39;;<br>// Initialize application<br>document.addEventListener(&#39;DOMContentLoaded&#39;, () =&gt; {<br>  const user = new UserProfile(api.getCurrentUser());<br>  user.render(&#39;#profile-container&#39;);<br>});</pre><h4>#5: Async Scripts with Self-Checking</h4><p>For scripts that need to run as soon as possible but still need the DOM:</p><pre>&lt;head&gt;<br>  &lt;script src=&quot;critical-feature.js&quot; async&gt;&lt;/script&gt;<br>&lt;/head&gt;</pre><p>With this pattern in your JavaScript file:</p><pre>// critical-feature.js<br>(function() {<br>  // Check if DOM is already available<br>  if (document.readyState === &#39;loading&#39;) {<br>    // If not, wait for it<br>    document.addEventListener(&#39;DOMContentLoaded&#39;, initialize);<br>  } else {<br>    // DOM is ready, run immediately<br>    initialize();<br>  }<br> function initialize() {<br>    console.log(&#39;Ready to initialize!&#39;);<br>    // Your application logic here<br>  }<br>})();</pre><h3>Which Approach Should You Choose?</h3><p>Each technique has its place in your web development toolkit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PTw_IB6qITU7t4UnynV7og.png" /></figure><p><strong>My recommendation:</strong></p><ol><li><strong>For organized codebases:</strong> Use defer for your main scripts in the &lt;head&gt;</li><li><strong>For inline code:</strong> Use DOMContentLoaded listeners</li><li><strong>For modern applications:</strong> Embrace ES6 modules with type=&quot;module&quot;</li></ol><h3>Real-World Examples</h3><p>Let’s look at some practical implementations of script loading patterns:</p><h4>Loading Libraries from CDNs</h4><pre>&lt;!-- jQuery with SRI (Subresource Integrity) --&gt;<br>&lt;script<br>  src=&quot;&lt;https://code.jquery.com/jquery-3.6.0.min.js&gt;&quot;<br>  integrity=&quot;sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=&quot;<br>  crossorigin=&quot;anonymous&quot;<br>  defer&gt;&lt;/script&gt;<br>&lt;!-- Bootstrap with proper attributes --&gt;<br>&lt;script<br>  src=&quot;&lt;https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js&gt;&quot;<br>  integrity=&quot;sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p&quot;<br>  crossorigin=&quot;anonymous&quot;<br>  defer&gt;&lt;/script&gt;<br>&lt;!-- React production build --&gt;<br>&lt;script<br>  src=&quot;&lt;https://unpkg.com/react@17/umd/react.production.min.js&gt;&quot;<br>  crossorigin<br>  defer&gt;&lt;/script&gt;<br>&lt;script<br>  src=&quot;&lt;https://unpkg.com/react-dom@17/umd/react-dom.production.min.js&gt;&quot;<br>  crossorigin<br>  defer&gt;&lt;/script&gt;</pre><blockquote><em>🔒 Security note: Always use the integrity attribute with third-party CDNs to protect against compromised scripts.</em></blockquote><h4>Managing Multiple Script Dependencies</h4><p>When scripts depend on each other, proper loading order becomes crucial:</p><pre>&lt;!-- Core utility functions needed by other scripts --&gt;<br>&lt;script src=&quot;utilities.js&quot; defer&gt;&lt;/script&gt;<br>&lt;!-- Component library that depends on utilities --&gt;<br>&lt;script src=&quot;components.js&quot; defer&gt;&lt;/script&gt;<br>&lt;!-- Main application that uses both utilities and components --&gt;<br>&lt;script src=&quot;app.js&quot; defer&gt;&lt;/script&gt;</pre><p>The defer attribute guarantees these scripts will execute in the exact order specified, even though they download in parallel.</p><h4>Progressive Enhancement with Modules</h4><p>This pattern provides modern features to browsers that support them while maintaining compatibility:</p><pre>&lt;!-- Modern browsers use this module version --&gt;<br>&lt;script type=&quot;module&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;<br>&lt;!-- Legacy browsers fall back to this bundled version --&gt;<br>&lt;script nomodule src=&quot;app-bundle.js&quot;&gt;&lt;/script&gt;</pre><p>In your module script:</p><pre>// app.js - Module version<br>import { Router } from &#39;./router.js&#39;;<br>import { Store } from &#39;./store.js&#39;;<br><br>// Initialize application with modern features<br>const app = {<br>  router: new Router(),<br>  store: new Store()<br>};<br>app.router.initialize();</pre><p>This approach lets you use modern JavaScript features while providing a fallback for older browsers.</p><h3>Key Takeaways</h3><ul><li><strong>Script positioning affects performance:</strong> Where you place your scripts impacts how quickly users see your content</li><li><strong>Defer is your friend:</strong> Use the defer attribute to load scripts efficiently without blocking rendering</li><li><strong>Keep dependencies in order:</strong> Ensure dependent scripts are listed in the correct sequence</li><li><strong>Embrace modern techniques:</strong> ES6 modules provide better organization and automatic defer behavior</li><li><strong>Security matters:</strong> Always use integrity and crossorigin attributes with third-party scripts</li></ul><p>With these techniques, you can organize your scripts logically in the &lt;head&gt; section while maintaining optimal page performance—truly the best of both worlds.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38427692ac6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Complete Guide to HTML Script Tags: Best Practices and Precautions]]></title>
            <link>https://medium.com/@valentinakim/the-complete-guide-to-html-script-tags-best-practices-and-precautions-b3cd42ae12e7?source=rss-2dc1362b944f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3cd42ae12e7</guid>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Tina Kim]]></dc:creator>
            <pubDate>Sat, 03 May 2025 00:16:33 GMT</pubDate>
            <atom:updated>2025-05-03T01:20:31.710Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Complete Guide to HTML Script Tags: Part 1</h3><figure><img alt="Close-up view of colorful JavaScript code on a dark background, highlighting syntax such as functions, variables, and strings in red, green, blue, and yellow." src="https://cdn-images-1.medium.com/max/1023/1*QMMkBNRWB4IwaUcAtOE0JQ.png" /></figure><h3>TL;DR</h3><p>The &lt;script&gt; tag is deceptively simple but can cause serious issues if used incorrectly. This guide covers what it is, how its attributes work (async, defer, module, etc.), and how to avoid common pitfalls like execution order bugs and cross-origin errors.</p><h3>Why Script Tags Matter</h3><p>While refactoring legacy web projects, I’ve repeatedly encountered a common issue: HTML pages load external scripts and CDN resources with varying degrees of success. Sometimes scripts work perfectly, other times they get overwritten by other scripts, leading to mysterious bugs and frustrating debugging sessions.</p><p>The culprit? Improper implementation of the humble &lt;script&gt; tag.</p><p>In this comprehensive guide, we’ll dive into everything you need to know about script tags: what they are, their key attributes, and how to implement them properly to avoid performance issues and unintended behaviors.</p><h3>The Basics: What is a &lt;script&gt; Tag?</h3><p>The &lt;script&gt; tag is an HTML element that embeds or references JavaScript code within a web page. When a browser encounters this tag during page rendering, it pauses to interpret and execute the associated JavaScript.</p><p>There are two primary ways to use script tags:</p><h3>1. Inline Scripts</h3><p>With inline scripts, you write JavaScript code directly within your HTML document:</p><pre>&lt;script&gt;<br>  // JavaScript code goes here<br>  console.log(&quot;Hello, World!&quot;);<br>  document.getElementById(&quot;demo&quot;).innerHTML = &quot;JavaScript has been executed!&quot;;<br>&lt;/script&gt;</pre><p>Inline scripts are convenient for small, page-specific functionality but can make your HTML cluttered and difficult to maintain as your application grows.</p><h3>2. External Scripts</h3><p>External scripts reference separate JavaScript files:</p><pre>&lt;script src=&quot;script.js&quot;&gt;&lt;/script&gt;</pre><p>This approach promotes better code organization, caching, and separation of concerns — generally the preferred method for production applications.</p><h3>Understanding Script Tag Attributes</h3><p>The power of the &lt;script&gt; tag comes from its various attributes that control how and when scripts load. Let&#39;s explore each one:</p><h3>src</h3><p>The src attribute specifies the URL of an external JavaScript file:</p><pre>&lt;script src=&quot;&lt;https://cdn.example.com/script.js&gt;&quot;&gt;&lt;/script&gt;</pre><p>This attribute can point to:</p><ul><li>Local files in your project directory</li><li>Scripts hosted on CDNs (Content Delivery Networks)</li><li>Scripts on other domains (subject to CORS policies)</li></ul><h3>type</h3><p>The type attribute specifies the MIME type of the script. In modern HTML5, this attribute is optional for standard JavaScript, as browsers default to &quot;text/javascript&quot;.</p><p>However, when using ES6 modules, you should specify type=&quot;module&quot;:</p><pre>&lt;script type=&quot;module&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;</pre><p>Using type=&quot;module&quot; enables features like:</p><ul><li>ES6 import/export statements</li><li>Automatic strict mode</li><li>Deferred execution by default</li><li>Scoped variables that don’t pollute the global namespace</li></ul><h3>async</h3><p>The async attribute is a boolean that tells the browser to download the script asynchronously while HTML parsing continues:</p><pre>&lt;script src=&quot;analytics.js&quot; async&gt;&lt;/script&gt;</pre><p><strong>How it works:</strong></p><ol><li>Browser discovers the script tag</li><li>Downloads the script in parallel with HTML parsing</li><li>Once downloaded, immediately executes the script (interrupting HTML parsing)</li><li>Resumes HTML parsing after execution</li></ol><p><strong>Best for:</strong></p><ul><li>Third-party scripts that don’t interact with your page content</li><li>Analytics, tracking, and metrics tools</li><li>Independent functionality that doesn’t rely on DOM elements</li></ul><p>⚠️ <strong>Watch out:</strong> Scripts with async execute as soon as they download, without guaranteeing execution order. If script B depends on script A, they might not execute in the correct sequence.</p><h3>defer</h3><p>The defer attribute downloads scripts asynchronously but delays execution until after HTML parsing is complete:</p><pre>&lt;script src=&quot;main.js&quot; defer&gt;&lt;/script&gt;</pre><p><strong>How it works:</strong></p><ol><li>Browser discovers the script tag</li><li>Downloads the script in parallel with HTML parsing</li><li>Completes HTML parsing first</li><li>Executes deferred scripts in the order they appear in the document</li></ol><p><strong>Best for:</strong></p><ul><li>Scripts that manipulate DOM elements</li><li>Scripts with dependencies on other scripts</li><li>Your main application code</li></ul><p>💡 <strong>Pro tip:</strong> Multiple deferred scripts maintain their original document order during execution, making this perfect for scripts with dependencies.</p><h3>crossorigin</h3><p>The crossorigin attribute configures CORS (Cross-Origin Resource Sharing) settings for scripts loaded from different domains:</p><pre>&lt;script<br>  src=&quot;&lt;https://cdn.example.com/script.js&gt;&quot;<br>  crossorigin=&quot;anonymous&quot;<br>&gt;&lt;/script&gt;</pre><p><strong>Available values:</strong></p><ul><li>anonymous: Sends requests without credentials (cookies, HTTP authentication)</li><li>use-credentials: Includes credentials with cross-origin requests</li></ul><p><strong>Why it matters:</strong> Without proper CORS settings, you get limited error reporting for cross-origin scripts and potential security issues.</p><h3>integrity</h3><p>The integrity attribute provides a cryptographic hash of the expected file content:</p><pre>&lt;script<br>  src=&quot;&lt;https://cdn.example.com/library.js&gt;&quot;<br>  integrity=&quot;sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC&quot;<br>  crossorigin=&quot;anonymous&quot;<br>&gt;&lt;/script&gt;</pre><p><strong>How it works:</strong></p><ol><li>You provide a hash (typically SHA-384 or SHA-512)</li><li>The browser downloads the script</li><li>Browser calculates the actual hash of the downloaded file</li><li>If the hashes don’t match, the script won’t execute</li></ol><p>This feature, known as Subresource Integrity (SRI), prevents execution of modified scripts — crucial protection if a CDN gets compromised.</p><h3>nomodule</h3><p>The nomodule attribute creates a fallback for browsers that don&#39;t support ES6 modules:</p><pre>&lt;!-- Modern browsers use this --&gt;<br>&lt;script type=&quot;module&quot; src=&quot;modern-script.js&quot;&gt;&lt;/script&gt;<br><br>&lt;!-- Legacy browsers fall back to this --&gt;<br>&lt;script nomodule src=&quot;legacy-script.js&quot;&gt;&lt;/script&gt;</pre><p>Modern browsers that support modules will ignore scripts with the nomodule attribute, while older browsers will ignore scripts with type=&quot;module&quot; and execute the nomodule script instead.</p><p>This pattern enables graceful degradation across browser generations.</p><p><em>In the next section, we’ll explore script positioning strategies, performance considerations, and common pitfalls to avoid. Stay tuned!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3cd42ae12e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>