# v0.9.0 — Major Refactoring (2026-02-13)

> **Type**: `refactor` | **Impact**: High

## Summary

Comprehensive codebase refactoring laying the groundwork for v1.0.0. This update focuses on code quality, maintainability, and developer experience without breaking existing functionality.

---

## 🔧 Backend Changes

### Architecture Improvements
- **Extracted `broadcastMembers` helper** — Cleaner hub implementation
- **Moved `writePump` to Client** — Better encapsulation of client logic
- **Graceful shutdown** — SIGINT/SIGTERM handling for clean exits

### Dependencies
- **Updated `gorilla/websocket`** to v1.5.3 (latest stable)

---

## 🎨 Frontend Changes

### Code Quality
- **Complete restructuring** — `'use strict'` mode throughout
- **Modular architecture** — Split into `app.*.js` modules:
  - `app.config.js` — Configuration and capabilities
  - `app.media.js` — Media stream handling
  - `app.peers.js` — PeerConnection management
  - `app.signaling.js` — WebSocket communication
  - `app.stats.js` — Connection statistics
  - `app.ui.js` — UI rendering and interaction

### Best Practices
- **Centralized DOM references** — Single source of truth for DOM elements
- **Magic value extraction** — All constants defined at module level
- **Enhanced error logging** — No empty catch blocks
- **Unified formatting** — 2-space indentation across HTML/CSS/JS

---

## 🔨 CI & Tooling

### Testing
- **Multi-version Go matrix** — CI tests against Go 1.22 and 1.23
- **Added staticcheck** — Additional static analysis

### Configuration
- **`.editorconfig`** — Consistent editor settings across IDEs
- **Multi-stage Dockerfile** — Optimized build for production

---

## 📁 Files Changed

```
internal/signal/hub.go        ← Architecture improvements
cmd/server/main.go            ← Graceful shutdown
web/app.js                    → Split into modules
web/app.*.js                  ← New modular files
web/index.html                ← Updated for modules
web/styles.css                ← Formatting cleanup
.github/workflows/ci.yml      ← Added staticcheck, matrix
Dockerfile                    ← Multi-stage build
.editorconfig                 ← New file
```

---

## ⚠️ Breaking Changes

**None** — All changes are backward compatible. Existing deployments continue to work without modification.

---

## 🔮 Next Steps

This refactoring prepares the codebase for:
- v1.0.0 stable release
- Enhanced test coverage
- Production deployment tooling

---

[← Back to Changelog Index](README.md)
