Frontend Fundamentals

repository·main·Indexed 24 days ago

https://github.com/toss/frontend-fundamentals

A collection of essential principles for building reliable, maintainable, and accessible frontend applications. It covers code quality (Cohesion, Coupling, Predictability, and Readability), bundling behavior, accessibility, and debugging techniques. Includes a Claude Code plugin providing the `/frontend-fundamentals:review` command for automated code quality assessments.

Tokens
123.9K
Snippets
330
Records
540
Agent score
83%

What's inside frontend-fundamentals

  1. Introduction to Debugging Patterns and Approaches

    main
    This documentation provides guidance on common bug patterns and systematic debugging approaches. Instead of relying on intuition or blindly searching for error messages, this resource helps developers analyze bugs through small clues and structured methods to ensure bugs are not only fixed but also prevented from recurring.
  2. Overview of Accessibility (A11y) in Frontend Development

    main

    Accessibility (A11y) is a fundamental principle aimed at making the web easier and more convenient for all users.

    As a frontend developer, you are responsible for creating HTML structures and defining interactions. Because you design the web experience closest to the user, you are the starting point and the core driver of accessibility. By focusing on A11y, you ensure that the web is usable by everyone.

    This documentation provides practical core concepts and common mistake patterns applicable in real-world development, such as:

    • Why nesting buttons inside buttons is problematic.
    • The issues caused by placing a <button> inside an <a> tag.
    • How screen reader users consume content.
    • Practical application of terms like 'Screen Reader', 'Keyboard Navigation', and 'ARIA'.
  3. Overview of Frontend Fundamentals

    main
    Frontend Fundamentals (FF) is a collection of essential principles designed to help developers build reliable, maintainable, and accessible frontend applications. It provides guidance on topics such as code quality, bundling behavior (dev vs. production), accessibility (screen reader interpretation), and efficient debugging techniques.
  4. Overview of the Webpack Tutorial

    main

    This tutorial provides a hands-on experience with Webpack by building a sample project called 오늘의 이모지 (Emoji of the Day). You will learn how to bundle various resources including external libraries, images, fonts, and CSS to understand the importance of bundling in web development.

    The learning path follows these stages:

    1. Starting a Web Project: Initializing with Node.js and npm, installing Webpack, and creating your first bundle.
    2. Understanding Module Systems and Bundling: Installing libraries via npm, importing them as modules, and using Webpack to merge modules.
    3. Modern Frontend Development: Using TypeScript for type safety, React for component-based development, and treating CSS, images, and fonts as modules.
    4. Efficient Development Environments: Extending functionality with plugins and increasing productivity with a development server.
  5. Core principles of web accessibility

    main

    To improve web content accessibility, follow these four core principles:

    1. Build correct structures (🧱 올바른 구조 만들기): Ensure HTML elements are wrapped and placed correctly (e.g., avoid nesting buttons inside buttons).
    2. Communicate meaning accurately (🗣️ 의미를 정확하게 전달하기): Clearly inform users what an element is and what its role is (e.g., naming interactive elements and adding descriptions to elements with duplicate names).
    3. Create predictable interactions (🎯 예측 가능한 인터랙션 만들기): Ensure visual appearance matches actual behavior (e.g., matching button roles to their actions and wrapping input elements in <form> tags).
    4. Do not rely solely on visual information (🌈 시각 정보에만 의존하지 않기): Supplement colors, images, and icons with text or other means (e.g., providing alternative text for images and icons).
  6. What is a Bundler and what does it do?

    main

    A bundler is a tool that performs bundling (combining multiple files into one), transforms code to be browser-compatible, and optimizes assets to improve website loading speeds.

    Core responsibilities include:

    1. Bundling: Combines multiple files into one (or a few) to reduce network requests and enables the use of module systems like ES Modules or CommonJS.
    2. Transpiling: Converts code like TypeScript or JSX into browser-understandable JavaScript (often using tools like Babel).
    3. Optimization:
      • Tree shaking: Removes unused code.
      • Minification: Compresses code by removing whitespace and comments.
      • Code splitting: Separates necessary code into different chunks for faster initial loading.
      • Lazy loading: Dynamically loads files only when needed.
      • Image optimization: Automatically reduces image file sizes.
    4. Development Environment:
      • Hot Module Replacement (HMR): Reflects code changes instantly without a full page reload.
      • Source Maps: Allows developers to debug original source code instead of the bundled output.
  7. What is JSX?

    main

    JSX (JavaScript XML) is a syntax extension that allows you to write HTML-like code inside JavaScript. Since browsers cannot read JSX directly, it must be transformed into standard JavaScript calls (specifically React.createElement) using a tool like Babel.

    Example Transformation:

    // JSX syntax
    const element = <h1 id="title">Hello, {name}!</h1>;
    
    // Transformed JavaScript
    const element = React.createElement("h1", { id: "title" }, "Hello, ", name, "!");
    ```jsx
    // JSX 문법
    const element = <h1>Hello, {name}!</h1>;
    
    // 변환된 JavaScript
    const element = React.createElement("h1", null, "Hello, ", name, "!");
    ```埋
  8. What is Bundling and why is it used

    main

    Bundling is the process of combining multiple resource files (such as JavaScript, CSS, and images) into one or a few files, known as a bundle.

    In modern web development, applications are often split into hundreds of small, modular files for easier development. However, if a browser attempts to request each file individually, it increases network overhead and slows down loading speeds. Bundling solves this by reducing the number of requests.

  9. What is HMR (Hot Module Replacement)?

    main
    HMR (Hot Module Replacement) is a feature that dynamically replaces only the changed code chunks in the runtime during frontend development. Unlike Live Reload, which detects file changes and refreshes the entire browser page (causing the application state to be lost), HMR allows code updates to be reflected immediately without a full page reload, thereby preserving the current application state.
  10. What is Babel and why is it used in React?

    main

    Babel is a JavaScript compiler that converts modern JavaScript (ES6+) into older versions (ES5) so that code can run in older browsers. In a React project, Babel is essential for:

    • JSX Transformation: Converting JSX syntax into React.createElement() calls.
    • Syntax Downleveling: Converting arrow functions to standard function keywords, classes to prototype-based constructors, template literals to string concatenation, and destructuring to standard variable assignments.
    • TypeScript Support: Using @babel/preset-typescript to strip TypeScript types and output plain JavaScript.
  11. What is a Loader and why is it used?

    main

    A Loader is a tool that transforms non-JavaScript files (such as CSS, images, or TypeScript) into JavaScript modules. This allows the bundler to read and connect these files during the module resolution process (following import or require statements).

    Without a loader, if you attempt to import a non-JS file, the bundler will fail because it only understands JavaScript by default. For example, importing a .css file in a .tsx file without a loader will result in a Module parse failed: Unexpected token error.