Skip to content

v1.0.6

Choose a tag to compare

@dev2k6 dev2k6 released this 13 May 23:11
· 19 commits to main since this release

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 .gox extension — 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
  • AbortController cancels stale in-flight navigations
  • requestIdleCallback scheduling 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 CORS and RequestID middleware
  • Guards declared in .gox frontmatter: guard = "auth"

Response Helpers

  • OK, Created, NoContent, BadRequest, Unauthorized, Forbidden, NotFound, ServerError
  • Redirect, RedirectPermanent
  • Paginated with 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/health endpoint
  • 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.Itoa replaces hand-rolled implementation
  • Tailwind CLI uses latest release URL

Documentation

  • Full README.md rewrite with architecture diagram
  • All 15 docs pages updated to .gox extension
  • 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"