gahing Technical Blog

website·Indexed 31 days ago

https://www.gahing.top/

A technical knowledge base and blog covering software engineering methodologies, including PDCA and 5W2H for efficient learning. Content includes distributed systems (CAP theorem), frontend technologies (Vue, Angular, TypeScript, WebRTC), and various technical interview questions.

Tokens
291.8K
Snippets
1K
Records
1.8K
Agent score
51%

What's inside gahing

  1. Overview of Node.js version management tools

    Common tools for managing and switching Node.js versions include n, nvm, and volta. While n and nvm are general version managers, volta is specifically designed to bind Node versions to individual projects.
  2. Overview of HTML Standard Communication APIs

    The HTML Standard defines several mechanisms for communication between applications within the same client across different domains, as well as server-to-client communication:

    • Server-Sent Events (SSE): Uses the EventSource interface to implement a server-push event stream.
    • WebSockets: Provides a bidirectional, full-duplex socket protocol for scripts.
    • postMessage: Enables cross-document communication between non-same-origin documents while preventing Cross-Site Scripting (XSS) attacks.
    • MessageChannel: Implements communication between different browsing contexts.
    • BroadcastChannel: Allows broadcasting messages to other browsing contexts.

    All event messages in these APIs are based on the MessageEvent interface, which inherits from Event.

  3. Overview of Java NIO (New I/O)

    Introduced in JDK 1.4, Java NIO (New I/O) provides a general-purpose API for I/O services that leverages high-performance I/O features common in modern commercial operating systems. It introduces new abstractions to expose platform-specific capabilities that were previously hidden in the JVM, specifically through the use of Channels and Selectors. Additionally, the java.nio.channels.spi package provides a Service Provider Interface (SPI) to allow the integration of new types of channels and selectors while maintaining specification consistency.
  4. Overview of JavaScript Decorators

    Decorators are a design pattern used to extend the functionality of JavaScript classes, their properties, methods, accessors, and parameters without modifying the original code. This approach is known as Aspect-Oriented Programming. Decorators can be implemented as simple functions (no arguments) or decorator factories (which accept arguments and return a decorator function).
    // Decorator Factory (with arguments)
    @throttle(500)
    expensiveMethod() {}
    
    // Simple Decorator (no arguments)
    @readonly
    x = 1;
  5. Overview of frontend E2E automation tools

    Commonly used tools and frameworks for frontend End-to-End (E2E) automation testing include:

    • Playwright: Modern framework with strong browser isolation and multi-browser support.
    • Puppeteer: Chrome/Chromium automation tool, which can be extended using puppeteer-extra.
    • Cypress: Popular E2E testing framework.
    • Selenium: Industry-standard browser automation.
    • Nightwatch: Node.js based E2E testing framework.
    • Taiko: A browser automation tool designed for simplicity.
    • Phantomjs: Headless browser (legacy).
    • Chrome Remote Interface: Low-level protocol for controlling Chrome.
  6. Overview of WebGL Light Source Types

    WebGL lighting typically involves four primary types of light sources:

    • Directional Light (Parallel Light): Emits parallel rays from an infinite distance (e.g., the sun). Defined by a direction and color/intensity.
    • Point Light: Emits light in all directions from a single point (e.g., a light bulb). Defined by a position and color/intensity.
    • Ambient Light (Indirect Light): Simulates light reflected off other surfaces. It illuminates all objects uniformly from all angles. Defined only by color.
    • Spotlight: A point light constrained to a specific direction and cone of influence.
  7. Overview of the Knowledge Map System

    The personal knowledge system is structured across three primary dimensions: Knowledge Domains, Basic Capabilities, and Core Tags. Each sub-item within these dimensions functions as an independent knowledge map, though they may overlap.
  8. Overview of Webpack 5 Module Federation

    Module Federation is a Webpack 5 feature that allows a project to export specific modules or libraries as remote build artifacts. Other projects can then import these modules from the specified remote build, enabling a form of module-level micro-frontends.
  9. Overview of the View Transitions API

    The View Transitions API provides a native browser mechanism to create smooth visual transitions between different document states. Unlike traditional methods that require absolute positioning and simultaneous rendering of old and new components to achieve fade-in/fade-out effects, the View Transitions API captures a screenshot of the old state and transitions it to the new state. This approach is more decoupled and offers better performance. Browser support is available in Chrome 111+.
  10. Overview of browser cache types

    Browsers utilize multiple layers of caching beyond standard HTTP caching:

    • Memory Cache: Stores resources loaded for the current page (e.g., preloaded resources). Fast but volatile.
    • Service Worker Cache: A programmable cache API that is highly controllable and independent of standard HTTP cache logic.
    • HTTP Cache: The standard disk-based cache governed by headers like Cache-Control and ETag.
    • HTTP2 Push Cache: Temporary storage for resources pushed by the server (typically expires in 5 minutes in Chromium).
  11. Overview of SWC as a Babel replacement

    SWC is a high-performance transpiler written in Rust designed to replace Babel. Its primary purpose is to transpile modern ECMAScript (ES) versions to lower versions for compatibility. While SWC and esbuild offer significantly better performance than Babel and Terser, users may encounter compatibility issues that require manual troubleshooting during migration.
  12. Overview of additional performance metrics (FID, SI, INP)

    Beyond the core paint and interactivity metrics, consider these indicators:

    • FID (First Input Delay): Measures the delay between a user's first interaction and the browser's response. Recommended: < 100ms.
    • SI (Speed Index): Measures how quickly the content of a page is visually displayed during loading.
    • INP (Interaction to Next Paint): Measures the maximum interaction latency across the entire page lifecycle (typically the second-worst value to avoid outliers). Recommended: < 200ms.