Auth Split Timeline Simple

Documentation for Sessions

Auth Split: Simple Timeline (For Non-Developers)

Purpose: Explain in plain language what changed, why it matters, and what comes next.


What Was the Problem?

Our login and authentication code lived in one big library. Every time someone opened the app, the entire login UI (forms, buttons, registration screens) loaded immediately—even if the user was already logged in. That made the app slower to start and harder to maintain.


What Did We Do? (Timeline)

Step 1: Split Into Two Libraries

We divided authentication into two parts:

Library What It Does When It Loads
@auth-core Login logic, security checks, user menu Always (small, fast)
@auth-ui Login page, registration form, preferences screens Only when needed (lazy)

Why this helps: The app starts faster because heavy UI loads only when the user actually needs it.


Step 2: Move the Right Pieces

Why this helps: Clear separation: core = always loaded, UI = load on demand.


Step 3: Update All Imports

We updated every file that used authentication to import from the correct library:

Why this helps: The build system knows exactly what to load when, reducing errors and improving performance.


Step 4: Fix ESLint Rules

We removed ESLint exceptions for auth-related libraries. The split now follows the rules properly.

Why this helps: Future changes stay consistent and easier to maintain.


Step 5: Fix Build Cache Issues

Some builds showed old errors even after fixes. We cleared caches and ensured the correct file content was used.

Why this helps: Reliable builds and faster feedback for developers.


What Are the Benefits?

  1. Faster startup — Users see the app sooner
  2. Smaller initial bundle — Less code loaded upfront
  3. Clearer structure — Easier to understand and change
  4. Better maintainability — Changes follow patterns

What Comes Next?


Summary for Stakeholders

Before After
One auth library Two: core (always) + UI (lazy)
Slow startup Faster startup
Mixed imports Clear import rules
ESLint exceptions Clean rules

Date: 2026-03-14 | Session: S222