Frontend Document

website·Indexed 30 days ago

https://fontend-document.vercel.app/

A comprehensive technical knowledge base covering frontend development, including deep dives into Vue 2 and Vue 3 (reactivity, Vue.extend, setup API), React (Fiber, Scheduler, diff algorithms), Electron (auto-updates, debugging), and Node.js frameworks like NestJS and Koa2. It also includes guidance on V8 garbage collection, JS error monitoring, and data structure algorithms.

Tokens
283.7K
Snippets
1K
Records
1.8K
Agent score
75%

What's inside Frontend Document

  1. Overview of the Reflect API

    The Reflect object is an ES6 API designed to provide a functional interface for operating on objects. Its primary design goals are:

    1. Centralizing Internal Methods: Moving language-internal methods (like Object.defineProperty) to Reflect. New internal methods will be deployed exclusively on Reflect moving forward.
    2. Improving Return Values: Making return values more consistent. For example, while Object.defineProperty throws an error on failure, Reflect.defineProperty returns false.
    3. Converting Imperative Operations to Functions: Converting operations like the in operator (name in obj) and delete (delete obj[name]) into function calls (Reflect.has and Reflect.deleteProperty).
    4. Proxy Integration: Reflect methods map one-to-one with Proxy traps. This allows Proxy handlers to easily implement default behavior by calling the corresponding Reflect method.
  2. Overview of RSA Asymmetric Encryption

    RSA is a widely used asymmetric encryption algorithm where the encryption and decryption keys are different. It utilizes a public key for encryption and a private key for decryption (or vice versa for digital signatures). A message encrypted with the public key can only be decrypted by the corresponding private key, and a message encrypted with the private key can only be decrypted by the public key.
  3. Overview of App Deep Linking (唤端) Methods

    Deep linking (唤端) is the process of opening a target mobile application and loading specific content from an external source (e.g., ads, shared links, or QR codes). The primary methods for achieving this across platforms are:

    • URL Scheme: Compatible with both iOS and Android.
    • Universal Links: Specific to iOS.
    • App Links / Chrome Intents: Specific to Android.
  4. Overview of Electron IPC Modules

    Electron provides two primary modules for inter-process communication, both of which are EventEmitter objects: ipcMain (used in the main process) and ipcRenderer (used in the renderer process). ipcMain handles asynchronous and synchronous messages sent from renderer processes and can also send messages back to them. ipcRenderer is used to send messages to the main process and receive replies.
  5. Overview of the Intersection Observer API

    The Intersection Observer API provides an asynchronous way to detect when a target element intersects with an ancestor element or the browser viewport. It is designed to replace inefficient patterns—such as attaching scroll event listeners and frequently calling Element.getBoundingClientRect() on the main thread—which can cause performance degradation and jank.

    Common use cases include:

    • Image Lazy Loading: Loading images only when they enter the visible viewport.
    • Infinite Scrolling: Triggering the loading of more content as the user approaches the bottom of a page.
    • Ad Visibility Tracking: Calculating ad impressions by detecting when an ad element is exposed to the user.
    • Triggering Animations: Starting animations or tasks specifically when a user reaches a certain section of the page.

    Note: The API does not provide the exact number of overlapping pixels; instead, it triggers a callback based on the intersection ratio (e.g., when N% of the element is visible).

  6. Overview of Two-Pointer Algorithm Techniques

    The two-pointer technique is generally divided into two categories based on the data structure and problem type:

    1. Fast and Slow Pointers: Primarily used for linked list problems. Common use cases include detecting cycles in a linked list or finding the K-th element from the end of a list.
    2. Left and Right Pointers: Primarily used for arrays or strings. Common applications include implementing sliding windows and binary search.
  7. Overview of the SWR React Hooks library

    The swr library (by Vercel) is named after the stale-while-revalidate HTTP strategy. It adopts the same philosophy: first returning data from cache (stale), then sending a fetch request (revalidate), and finally providing the most up-to-date data.

    Note: The library is a client-side implementation using Maps and hashes for caching; it is not directly tied to the HTTP Cache-Control: stale-while-revalidate header.

  8. Overview of MD5 Hashing Algorithm

    MD5 (Message-Digest Algorithm) is a widely used hash function that produces a 128-bit hash value from an input of any length. It is characterized by one-way encryption (irreversibility), unique output for unique inputs, and strong security properties. It processes input information in 512-bit blocks, which are further divided into sixteen 32-bit sub-blocks.