Skip to content

v0.1.4-rc.5

Pre-release
Pre-release

Choose a tag to compare

@FedericoAlcantara FedericoAlcantara released this 26 May 15:41
· 8 commits to main since this release
856f27c

v0.1.4-rc.5

Ash Framework improved support - Changes in this release comes from the experience of adopting aurora_uix on real applications

Requires:

  • Elixir 1.17+
  • Phoenix 1.8+
  • Phoenix LiveView 1.1+
  • Ecto 3.13+

Added

  • File-upload support via data.upload field config #251

    • A resource field can now carry a LiveView upload by setting data: %{upload: %{allow: [...], consume: &fun/1}}.
    • The library registers uploads via allow_upload/3, renders live_file_input with entry progress and cancel buttons, and invokes the :consume callback on save.
    • Purely additive — fields without data.upload are unaffected.
    • See guides/core/resource_metadata.md for the data.upload configuration reference.
  • Actor threading for policy-protected Ash resources #253

    • auix_resource_metadata accepts ash_actor_assign: :current_user (or any other socket-assigns key). The named actor is forwarded as actor: to every generated Ash call: Ash.read/2, Ash.get/3, Ash.create/3, Ash.update/3, Ash.destroy/2, Ash.load/3, and AshPhoenix.Form.for_update/3.
    • Backward-compatible: omitting ash_actor_assign keeps the previous behaviour. A nil actor (assign missing or unset) is also a no-op — no actor: is added.
    • authorize?: is never set explicitly; the host domain's authorize config (:by_default / :when_requested / :always) continues to decide whether policies run.
    • Forbidden reads on policy-protected resources now render an empty index (instead of crashing) — Ash.Error.Forbidden is translated to an empty list for list/2, list_function_paginated/2, and to_page/4. Writes still propagate the error so the form handler can flash it.
    • Adds a new socket_opts/2 callback to the Aurora.Uix.Integration.Crud behaviour; the Ash backend resolves the actor from socket.assigns, the Ctx backend ignores it. Connector stays neutral — the new actor_assign field lives on the Ash CrudSpec.
    • See guides/core/ash_integration.md#authorization--policies.

Changed

  • Stylesheet split for host-theme inheritance #259
    • mix auix.gen.stylesheet now writes three files instead of one:
      • auix-variables.css — all :root / --auix-* custom-property declarations (sizes, colors, shadows, palette variants).
      • auix-rules.css — all .auix-* component rules that consume those variables.
      • auix-stylesheet.css — back-compat shim that re-imports the two files above. Existing hosts importing only this file continue to work unchanged.
    • On first run the task also copies assets/css/auix-bridge-daisyui.css into the host project — a small CSS file that maps daisyUI v5 tokens (--color-primary, --color-base-100, --radius-field, …) onto --auix-* variables so Aurora UIX components follow the host theme automatically. The file is treated as user-editable and is not overwritten on subsequent runs; pass --force to refresh it from the library version.
    • Hosts using Tailwind v4 + daisyUI import the files in this order in app.css:
      @import "auix-variables.css";
      @import "auix-bridge-daisyui.css";
      :root { /* optional per-host overrides */ }
      @import "auix-rules.css";
    • Added guides/advanced/writing_a_bridge.md — a guide for authoring a custom bridge for any design system other than daisyUI.
    • ThemeHelper gained two new public functions: generate_variables_stylesheet/0 and generate_rules_stylesheet/0.