← Back to Blog

Benchmark: SvelteKit Framework

Testing loct on SvelteKit source (TS + Svelte)

Use Case: sveltejs/kit - The SvelteKit Framework

Repository: https://github.com/sveltejs/kit Stack: TypeScript + Svelte Test Date: 2025-12-08 Loctree Version: 0.6.2-dev


Overview

Testing loctree on SvelteKit - validating virtual module resolution ($app/*, $lib/*).

Repository Scale

MetricValue
Files Scanned1,117
Analysis Time26.92 seconds
Throughput41 files/sec

Findings

Dead Code Detection

  • High Confidence: 0
  • False Positive Rate: ~0%

Virtual Module Resolution - MAJOR FIX

// Previously flagged as dead (WRONG):
export function enhance() { }  // in packages/kit/src/runtime/app/forms.js

// Used via virtual module:
import { enhance } from '$app/forms';  // NOW CORRECTLY RESOLVED!

Version History

VersionFP RateStatus
0.5.1683%Virtual modules broken
0.5.1767%Slightly better
0.6.1-dev~100%REGRESSION
0.6.2-dev~0%FIXED!

Commands Used

cd SvelteKit
loct                              # Create snapshot
loct dead --confidence high       # Dead code analysis
loct twins                        # Duplicate detection

Verdict

EXCELLENT - Virtual module resolution is production-ready.

Key Insights

  1. Virtual Modules: $app/forms, $lib/* correctly resolved
  2. Framework Magic: load(), prerender exports recognized
  3. Major Improvement: From 100% FP to ~0% FP

SvelteKit-Specific Features

Loctree now handles:

  • $app/forms, $app/navigation, $app/stores
  • $lib/* path aliases
  • +page.server.ts magic exports
  • export const prerender = true patterns

πš…πš’πš‹πšŽπšŒπš›πšŠπšπšπšŽπš. with AI Agents by VetCoders (c)2024-2026 LibraxisAI