Skip to content

Feature. Commando Context#8

Open
SerhiiRI wants to merge 1 commit intofeat-registry-redesignfrom
feat-command-context
Open

Feature. Commando Context#8
SerhiiRI wants to merge 1 commit intofeat-registry-redesignfrom
feat-command-context

Conversation

@SerhiiRI
Copy link
Contributor

@SerhiiRI SerhiiRI commented Mar 7, 2026

TLDR

(:instruction
 (commando/execute
   [command-builtin/command-from-spec
    (command-builtin/command-context-spec
      {:theme-configuration {:background-color "#FF0000"
                             :color "#040404"}})]
   {:button-style 
    {:background-color {:commando/context [:theme-configuration :background-color]}
     :color            {:commando/context [:theme-configuration :color]}
     :border           {:commando/context [:theme-configuration :border] :default "1px solid red"}}}))
;; => 
{:button-style
 {:background-color "#FF0000",
  :color "#040404",
  :border "1px solid red"}}

command-builtin/command-context-spec - the first "dynamic" command, which just enclose data inside and gave access via :commando/context. In practice user easily may create it's own context by copying code of this one. To enclose his own , maybe even mutable types/object what can even increase performance. Context have :none dependency, what also dont overload dependency managment logic.

This solution is ready architectural solution what indeed help user to concentrate on the flow inside of instruction and hide ennecessary or unsecured stuffs. With help of Registry overriding it may significantly increase perfrormance on the frontend where commando may run in cycle multiple time at a second, because operatoin very cheap by design.

@SerhiiRI SerhiiRI self-assigned this Mar 7, 2026
@SerhiiRI SerhiiRI requested a review from Kaspazza March 7, 2026 23:55
@SerhiiRI SerhiiRI changed the base branch from main to feat-registry-redesign March 7, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant