DaysWithVenki Technical Blog

website·Indexed 31 days ago

https://tech.dayswithvenki.top

A technical knowledge base covering frontend engineering, JavaScript, TypeScript, and AI. Topics include Vue 2/3 reactivity and virtual DOM, performance optimization (Rspack, Vite, and white-screen reduction), network protocols (HTTP, WebSocket), and AI implementations such as MCP services, AI-driven crawlers, and Codex Subagents.

Tokens
41.5K
Snippets
137
Records
210
Agent score
50%

What's inside DaysWithVenki Tech

  1. Overview of AI-driven web scraping paradigms

    AI-driven web scraping shifts the focus from 'rule matching' (fixed selectors) to 'semantic understanding' and 'intelligent interaction'. This approach solves traditional pain points such as high maintenance costs due to DOM changes, inability to handle dynamic content without complex scripts, and the high technical barrier of JS reverse engineering. Key advantages include:

    1. Semantic Understanding: LLMs identify information based on meaning rather than fixed HTML tags.
    2. Dynamic Adaptability: AI can navigate anti-scraping mechanisms and layout changes flexibly.
    3. Automation: AI can automatically identify key information and generate extraction rules.
    4. Data Readiness: Non-structured web content is directly converted into structured formats suitable for RAG or LLM fine-tuning.
  2. Overview of Vue 3 Reactivity System

    Vue 3 replaces Vue 2's Object.defineProperty approach with a system based on ES6 Proxy. This transition solves several limitations: it allows for deep listening without manual recursion for every property, and it natively supports tracking the addition or deletion of properties (via has and deleteProperty traps), eliminating the need for Vue.$set.
  3. Overview of Codex Subagent Architecture

    The Codex Subagent architecture decouples task dispatch from result waiting to enable concurrency and prevent the Root Agent from being blocked by long-running sub-tasks. Instead of a synchronous call, it uses a four-stage boundary: spawning a child agent, sending messages, waiting for updates via a mailbox, and performing follow-ups. This allows the Root Agent to continue other work while subagents execute in independent contexts.
  4. Understand the browser rendering pipeline flow

    The high-level process of loading and rendering a web page follows these steps:

    1. DNS Resolution: The browser resolves the domain name to an IP address.
    2. Server Request: The browser requests the page from the server using the IP address.
    3. Server Response: The server responds to the HTTP request and returns data to the browser.
    4. Rendering: The browser begins the rendering process to display the content.
  5. Understand AJAX concepts

    AJAX stands for Asynchronous JavaScript and XML. It is a technique used to exchange data with a server in the background asynchronously, allowing web pages to update content and display data without requiring a full page refresh.
  6. Understand and implement JavaScript closures

    A closure is a function created inside another function that retains access to the variables and parameters of its parent scope, even after the parent function has finished executing. This allows functions to maintain state and create persistent reference environments.
    function outerFunction() {
        let outerVariable = 'Kevin';
        return function innerFunction() {
            console.log(outerVariable);
        }
    }
    
    let closure = outerFunction();
    closure(); // Kevin
  7. Understand WebSocket fundamentals and handshake

    WebSocket provides a stateful, persistent connection that allows servers to proactively push messages to clients, resulting in lower latency compared to standard HTTP requests. The connection is established via an HTTP handshake: the client includes Connection: Upgrade and Upgrade: Websocket in the request headers, and the server responds with a 101 Switching Protocols status code to upgrade the connection.
  8. Compare Rspack and Vite for Vue CLI (Webpack v4) migration

    When migrating a legacy Vue CLI project (Webpack v4), Rspack is recommended over Vite for projects using Vue 2 and traditional ecosystems (e.g., Element UI, ECharts) due to its high compatibility with the Webpack ecosystem and lower risk of runtime errors.

    Comparison Summary:

    • Rspack: High compatibility, minimal learning curve (Webpack-like config), extremely fast build times (Rust-based), and stable production output.
    • Vite: Best development performance (ESM), but high risk for legacy projects due to dependency conflicts, circular reference issues, and potential runtime errors (e.g., ReferenceError: Cannot access 'xxx' before initialization) in production builds.
    • Vue CLI (Webpack v4): Poor performance, numerous security vulnerabilities, and Node.js compatibility issues (requires --openssl-legacy-provider).
  9. Use LIS to optimize DOM node movements in Vue 3 diffing

    In Vue 3's patchKeyedChildren function, when new and old nodes are out of order, the LIS algorithm is used to determine the minimum number of nodes to move. By identifying the longest increasing subsequence of indices, Vue can keep those nodes stationary and only move the nodes that are not part of the LIS, minimizing the cost of DOM operations (since modifying attributes is cheaper than moving nodes, which is cheaper than adding nodes).
  10. Understand the three core elements of network security

    Network security is built upon three primary pillars:

    1. Confidentiality: Ensuring that attackers cannot obtain the contents of the communication.
    2. Integrity: Ensuring that any tampering with the content by an attacker can be detected.
    3. Authentication: Ensuring that an attacker cannot impersonate either party in a communication to interact with the other.
  11. Use Crawl4AI for efficient AI data sourcing

    Crawl4AI is designed as a data factory for AI models. It features local data caching to avoid redundant requests to the same page, significantly increasing efficiency. It supports multiple AI collaboration methods, including interface capture, Markdown parsing, and HTML export to produce structured data for LLMs.
  12. Understand the purpose and benefits of using a CDN

    A Content Delivery Network (CDN) is used to optimize content delivery by addressing three primary constraints:

    1. Physical Latency: Reduces network delay by serving content from a server geographically closer to the user (e.g., reducing latency from ~200ms for cross-continental requests to ~20ms for local requests).
    2. Bandwidth Costs: Reduces the cost of distributing large files by avoiding repeated high-bandwidth transfers from a single origin server to multiple users.
    3. Server Scalability: Prevents the need to over-provision origin servers for peak traffic events (like 'Double 11' shopping festivals) by distributing the load across a network of edge servers.