Hojunin Tech Blog

website·Indexed 31 days ago

https://www.hojunin.com/

A technical blog covering frontend development, software architecture, and developer growth. Topics include React, TypeScript (Type Narrowing), GraphQL architecture, React Query, Sentry, SEO with dynamic meta tags, and functional programming, alongside reflections on professional development and workflow optimization.

Tokens
24.5K
Snippets
83
Records
161
Agent score
50%

What's inside Hojunin

  1. Overview of Docusaurus features

    Docusaurus is a React-based static site generator developed by Facebook, designed specifically for documentation and blogs. Key features include:

    • Built-in support for SEO, internationalization (i18n), search, and dark mode.
    • Intuitive folder-based structure where folders map to navigation tabs and .md files map to pages.
    • Support for MDX, allowing JSX components to be used within Markdown files.
    • A plugin system for extended customization.
  2. Write technical blog posts based on problem-solving

    When writing technical blog posts, focus on the specific problems solved within the company rather than just summarizing study notes or new facts. Writing about solved problems serves as a professional retrospective. Additionally, contributing to a company's official technical blog is more impactful than a personal blog, as it provides greater visibility and serves as a durable record of professional achievement.
  3. Distinguish between individual and organizational responsibilities

    To avoid burnout and frustration, distinguish between 'things the company/C-level should worry about' and 'things the individual should worry about.' Stress often arises when an individual takes on organizational-level concerns (such as talent density management or overall company direction) that are outside their scope of influence.
  4. Prioritize business value over technical idealism

    A 'good developer' must prioritize business requirements as the primary objective (the '0th priority'). While clean code, clean architecture, and the latest technology stacks are important, they should not supersede the need to deliver functional products that meet business goals quickly and accurately. Technical decisions should be justified by how they solve business problems or provide measurable advantages, rather than simply following trends.
  5. Categorize React Native error types

    Errors in React Native typically fall into three categories based on the architecture's separation of threads:

    1. JS Thread Errors: Occur during logic execution, such as attempting to access properties of undefined or null via dot notation.
    2. UI Thread Errors: Occur during rendering or UI interactions, such as attempting to scroll to a non-existent index or offset.
    3. Server Errors: Standard HTTP errors (e.g., 401, 404, 500, 503).
  6. Collect API query data using Axios interceptors

    To track user behavior related to network requests, use Axios interceptors to hijack responses. This allows the application to dispatch query-related 'BreadCrumbs' (metadata about the request and response) to a global store whenever an API call succeeds or fails.
    const ApiInstance = axios.create({...});
    
    ApiInstance.interceptors.response.use(
     (response) => {
     // Handle successful response
     store.dispatch(
     setQueryCrumbs({
     headers: response.config.headers,
     url: response.config.url,
     timestamp: new Date().getTime(),
     status: response.status,
     }),
     );
     return response;
     },
     (error) => {
     // Handle error response
     store.dispatch(
     setQueryCrumbs({
     headers: error.response.config.headers,
     url: error.response.config.url,
     data: error.response.config.data,
     errorMessage: error.response.data.message,
     timestamp: new Date().getTime(),
     status: error.response.status,
     }),
     )}
    );
  7. Write a 'About Me' section to showcase personality and values

    To avoid being evaluated solely on technical skills, include an 'About Me' section. This section should describe your mindset, mission as a developer, personality, hobbies, or life values. This provides a narrative for the interviewer and serves as an effective icebreaker during interviews.
  8. Understand Type Narrowing and Type Guards

    Type Narrowing is the process of refining a general type (such as unknown or a Union type) into a more specific type as the code progresses. A Type Guard is the specific mechanism or methodology used to perform this narrowing, ensuring that data is of a certain type before it is operated upon, which prevents runtime errors caused by any types.
  9. Analyze user behavior with BreadCrumbs

    BreadCrumbs data can be applied to several product improvement tasks:

    • Debugging/Snapshots: Reconstruct the sequence of events leading up to an error to identify the root cause.
    • Deep Navigation: Retrieve parameters from previous screen transitions to return a user to a specific state (e.g., returning a user to a specific post after they complete a login flow triggered by a 'Like' action).
    • Heatmaps: Use TouchCrumb data to visualize the density of user touch events, helping evaluate if UI elements are being noticed and used as intended.
  10. Understand and use Type Guards in TypeScript

    Type Guards in TypeScript are used to determine the specific type of data when the exact type is unknown. By implementing a type guard, you can ensure that data passing through the check is safely typed, allowing for type-safe operations on that data within the scope of the guard.
  11. Design a user-centric error experience strategy

    When a user encounters an error, the primary goal is to apologize politely, provide clear information about the cause, and guide the user back to a functional state. Errors should be categorized by responsibility to determine the appropriate message and action:

    User-side issues:

    • Outdated hardware/performance limitations
    • Poor network connectivity (Wi-Fi off, 3G)
    • Unsupported OS or OS version
    • Outdated app version

    System-side issues:

    • Server crashes
    • Request timeouts
    • Client-side bugs (typos, calculation errors causing crashes)

    Messaging Guidelines:

    • Avoid generic error codes (e.g., don't just show '404').
    • Use actionable messages: 'Network connection lost' (prompts user to check Wi-Fi), 'A bug occurred' (acknowledges developer error), or 'Post not found' (explains content absence).
  12. Improve image perceived performance with ThumbHash

    ThumbHash is a placeholder technique that represents an image as a small string (approximately 34 bytes) rather than a full image file. This string is decoded into a low-resolution, blurred version of the image that preserves the original's general shape and color, eliminating the 'blank screen' effect while high-resolution images are being downloaded and decoded by the browser.