Repository navigation
v1.0.6
V1.0.6
Highlights
This release consolidates all improvements since v1.0.1 into a single, clean version with full documentation and synchronized pkg.go.dev publishing.
Breaking Changes
- File extension renamed:
.nguyen→.gox
All component files now use the.goxextension — shorter, cleaner, easier to type. The.nguyen/output directory and framework name remain unchanged.
New Features
SPA Navigation Engine (rewritten)
- DOM morphing instead of
innerHTML— preserves focus, scroll position, form state - Binary frame protocol for minimal network payload
- Batch prefetch endpoint (
POST /_nguyen/prefetch) — Go renders multiple routes concurrently via goroutines AbortControllercancels stale in-flight navigationsrequestIdleCallbackscheduling for zero main-thread blocking- View Transitions API support
- In-memory LRU partial cache (128 entries, 60s TTL)
Data Loaders
- Concurrent server-side data fetching via
LoaderRegistry - Multiple loaders execute in parallel using goroutines
- Context timeout and panic recovery built-in
Error Boundaries
- Graceful render failure handling with customizable fallback HTML
- Prevents a single broken page from crashing the server
Template Directives
<nguyen-fragment>— render children without wrapper div<nguyen-show when="key">/<nguyen-hide when="key">— conditional rendering evaluated against SSR state
Middleware System
- Named middleware registry with route guard resolution
- Built-in
CORSandRequestIDmiddleware - Guards declared in
.goxfrontmatter:guard = "auth"
Response Helpers
OK,Created,NoContent,BadRequest,Unauthorized,Forbidden,NotFound,ServerErrorRedirect,RedirectPermanentPaginatedwith full metadata (page, total, has_next, has_prev)
Environment Injection
- Safe access to
NGUYEN_prefixed env vars in SSR context IsProduction()/IsDevelopment()helpers
Health Check
- Built-in
/_nguyen/healthendpoint - Reports: status, version, uptime, Go version, goroutine count, memory stats
Improvements
- Centralized version string (
internal/version/version.go) - Dev server rate limiter increased to 600 req/min (HMR-friendly)
- Pre-compiled regex in scoped CSS processing
strconv.Itoareplaces hand-rolled implementation- Tailwind CLI uses latest release URL
Documentation
- Full README.md rewrite with architecture diagram
- All 15 docs pages updated to
.goxextension - Example templates updated
Retracted Versions
The following versions are retracted in go.mod due to incomplete publishing:
v1.0.2,v1.0.3,v1.0.4
Use v1.0.6 (or v1.0.1 / v1.0.5) instead.
Migration from v1.0.1
# Rename all component files
# Linux/macOS:
find pages/ app/ components/ -name "*.nguyen" -exec sh -c 'mv "$1" "${1%.nguyen}.gox"' _ {} \;
# Windows PowerShell:
Get-ChildItem -Recurse -Filter "*.nguyen" | Rename-Item -NewName { $_.Name -replace '\.nguyen$', '.gox' }
# Update Tailwind config content paths
# "*.nguyen" → "*.gox"