Skip to content
This repository was archived by the owner on Jun 9, 2026. It is now read-only.

0.8.0

Choose a tag to compare

@exronnin exronnin released this 23 May 03:45
· 178 commits to main since this release

What's Changed

Features

  • Added framework-neutral HTTP session support in @arkstack/http.

    • @arkstack/http/setup registers the Clear Router session plugin.
    • Route contexts now receive session, httpSession, and errors.
    • Existing non-HTTP session values are preserved, with Arkstack’s session available as httpSession.
    • Sessions support data storage plus a built-in error bag for validation and general form/request errors.
  • Added Kanun validation integration for HTTP sessions.

    • @arkstack/http/setup registers kanunSessionPlugin.
    • Failed Kanun validators automatically fill the current request session error bag.
    • Full Kanun validators, message bags, and validation exceptions normalize into session errors.
  • Added view-level session/error support.

    • Views now always receive a safe errors object.
    • Added ViewErrorBag with Laravel/Kanun-style helpers: first, get, has, hasAny, missing, all, keys, count, toArray, and getMessages.
    • Added request-scoped view data so session, httpSession, and errors can flow into Edge views.
  • Added Clear Router view setup integration.

    • New @arkstack/view/setup entry.
    • New clearRouterViewPlugin reads request locals and exposes request session state to views rendered during the request.

Fixes

  • Prevented Kanun validation hooks from throwing when validation runs outside an active HTTP request session.
  • Improved recursive message-bag normalization for Kanun-style errors(), getMessages(), messagesRaw(), toArray(), and getMessageBag() sources.
  • Preserved existing non-HTTP session context values while exposing Arkstack’s HTTP session as httpSession.

Package Updates

  • Added kanun as a peer dependency for @arkstack/http.
  • Added optional clear-router peer dependency for @arkstack/view.
  • Updated Kanun peer ranges to ^1.2.0.
  • Updated template dependencies for kanun and @kanun-hq/plugin-file.

Documentation

  • Documented HTTP sessions, session errors, and Kanun validation integration.
  • Documented view error usage and session-backed errors in Edge templates.

Tests

  • Added regression tests for:
    • HTTP session context binding.
    • Session data and error bag behavior.
    • Kanun validator normalization into session errors.
    • Automatic session filling when Kanun validation fails.
    • Kanun validation outside a request session.
    • View-safe errors handling.
    • Request-scoped session/errors flowing into views.

Full Changelog: 0.7.20...0.8.0