Feng Hua Frontend Engineering Documentation

website·Indexed 29 days ago

https://qzyzz.github.io/

A comprehensive collection of frontend development tutorials and guides covering modern web technologies. Topics include TypeScript (OOP and inheritance), Vue 3 (Composition API and Echarts integration), React, Express, MongoDB, and advanced CSS techniques such as Grid, Flexbox, Container Queries, and the Box Model. The documentation also explores browser APIs (BOM, DOM, Drag & Drop), Web Components, and various UI visual effects.

Tokens
94.2K
Snippets
466
Records
637
Agent score
72%

What's inside Feng Hua Frontend

  1. Overview of TypeScript

    TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. Key characteristics include:

    • Compilation: TS cannot run directly in browsers or Node.js (except Deno); it must be compiled to JS.
    • Static Typing: Unlike JS's dynamic typing, TS requires variables to have determined types at development time, catching type errors before execution.
    • Superset: TS supports all JavaScript syntax and adds additional features, meaning all valid JS code is valid TS code.
  2. Overview of Vite 2.0 architecture and benefits

    Vite 2.0 is a build tool that provides a fast development environment by leveraging native ESM (ES Modules) for loading JavaScript modules. Unlike Webpack, which bundles the entire application on startup, Vite splits the project into two parts:

    1. Dependencies: Libraries specified in package.json are pre-bundled using esbuild (written in Go for high performance) and stored in node_modules/.vite. This process only runs on the first start, when dependencies change, or when configuration is modified. Results are cached in the browser via HTTP.
    2. Source Code: Source files are served via native ESM, meaning the browser requests only the needed modules. Hot Module Replacement (HMR) only updates the minimal amount of code affected by a change, ensuring fast updates regardless of app size.

    Vite supports TypeScript, JSX, and CSS, and uses Rollup for production bundling of multi-page applications and libraries.

  3. Overview of TypeScript

    TypeScript is a typed superset of JavaScript that compiles into plain JavaScript. It provides static typing, allowing developers to define variable types at development time rather than runtime. Because it is a superset, all valid JavaScript code is also valid TypeScript code. Key benefits include early error detection via type checking, improved IDE autocompletion (especially in VS Code), and better maintainability for large-scale collaborative projects by acting as living documentation.
  4. Overview of Web Components core concepts

    Web Components is a native browser technology for creating encapsulated, reusable custom HTML elements. It consists of three primary pillars:

    1. Custom Elements: JavaScript classes that extend HTMLElement (or other specific DOM objects) to define new HTML tags. They include four lifecycle hooks: connectedCallback() (mount), disconnectedCallback() (unmount), adoptedCallback() (moved to a new parent), and attributeChangedCallback() (attribute change).
    2. Shadow DOM: A private, isolated DOM tree attached to a custom element. It prevents styles and scripts inside the component from leaking out and vice versa.
    3. HTML Templates: Uses <template> and <slot> tags. <template> holds markup that isn't rendered until instantiated, and <slot> acts as a placeholder for external content passed into the component.
  5. Introduction to CSS and its core components

    CSS (Cascading Style Sheets) is a descriptive, declarative stylesheet language used to style content rendered by browsers, such as HTML and SVG. It allows developers to control fonts, colors, layout, typography, and add animations to enhance user experience and interactivity.

    Learning CSS involves mastering several key components, categorized into basic and advanced levels:

    Basic Components:

    • Selectors
    • Styles
    • Positioning
    • Layout
    • Media Queries
    • Animations

    Advanced Components:

    • Box Model
    • BFC (Block Formatting Context)
    • Selector Priority/Specificity
    • 2D/3D Space
    • Variables
    • Functions
    • Color Representations
    • Build Tools
    • UI Libraries
  6. Overview of Web Components core concepts

    Web Components is a native browser technology for creating reusable, encapsulated custom HTML elements. It consists of three primary pillars:

    1. Custom Elements: Created by extending HTMLElement (or other DOM objects). They provide lifecycle hooks: connectedCallback() (mount), disconnectedCallback() (unmount), adoptedCallback() (moved), and attributeChangedCallback() (attribute change).
    2. Shadow DOM: A separate, isolated DOM tree attached to a custom element. It prevents styles and scripts from leaking in or out of the component.
    3. HTML Templates: Uses <template> and <slot> tags. The <template> defines the structure and style, while <slot> acts as a placeholder that can be replaced by real elements from the parent DOM.
  7. Overview of Vue 3 Improvements over Vue 2

    Vue 3 introduces several architectural and performance improvements over Vue 2:

    • Performance: Execution speed is approximately 1.5x faster than Vue 2.x.
    • Bundle Size: Smaller bundle sizes due to better Tree-shaking support and the removal of unused APIs (e.g., inline-template, filter).
    • TypeScript Support: The entire source code was rewritten in TypeScript, providing better type inference and maintainability.
    • Project Structure: Uses a monorepo to manage multiple packages, making functional modules clearer and easier to test/release independently.
    • Composition API: A new set of function-based APIs that allow for better logic organization, encapsulation, and reuse compared to the Options API.
  8. Overview of CSS and its core components

    CSS (Cascading Style Sheets) is a descriptive, declarative stylesheet language used to style content rendered by browsers, such as HTML and SVG. Unlike programming languages, CSS focuses on the visual presentation of elements, including colors, layout, typography, and animations to enhance user interaction.

    CSS is categorized into basic and advanced components:

    Basic Components:

    • Selectors
    • Styles
    • Positioning
    • Layout
    • Media Queries
    • Animations

    Advanced Components:

    • Box Model
    • BFC (Block Formatting Context)
    • Selector Specificity/Priority
    • 2D/3D Space
    • Variables
    • Functions
    • Color Representations
    • Build Tools
    • UI Libraries
  9. Overview of TypeScript

    TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. Key characteristics include:

    • Compilation: TS cannot run directly in browsers or Node.js (except Deno); it must be compiled to JS.
    • Static Typing: Unlike JS's dynamic typing, TS requires variables to have determined types at development time to prevent type-related errors.
    • Superset: TS supports all JavaScript syntax, meaning any valid JS code is valid TS code.
  10. Overview of TypeScript

    TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. Key characteristics include:

    • Compilation: TS cannot run directly in browsers or Node.js (except in Deno) and must be compiled to JS.
    • Static Typing: Unlike JavaScript's dynamic typing, TS requires variables to have determined types at development time, allowing errors to be caught before execution.
    • Superset: TS supports all JavaScript syntax and adds additional features, meaning all valid JS code is valid TS code.
  11. Overview of Vue 3 Key Improvements

    Vue 3 introduces several significant upgrades over Vue 2.x:

    • Performance: Execution speed is approximately 1.5x faster than Vue 2.x.
    • Bundle Size: Smaller bundle sizes due to better tree-shaking and on-demand compilation.
    • TypeScript Support: The entire framework is rewritten in TypeScript, providing better type inference and developer tooling.
    • Composition API: A new set of functional APIs that allow for better logic organization, encapsulation, and reuse compared to the Options API.
    • Advanced APIs: Exposure of lower-level APIs and more advanced built-in components.
  12. Understand the CSS Box Model components

    In CSS, every HTML element is treated as a rectangular box consisting of four areas from the inside out:

    1. Content Area: The actual content, determined by width and height.
    2. Padding Area: The space between the content and the border, set via padding.
    3. Border Area: The boundary between padding and margin, set via border.
    4. Margin Area: The space between the border and adjacent boxes, set via margin.