Conversation
…with nonmap command execution, test separation and trimming.
60946d0 to
e926ebb
Compare
…e with stub components. integrant , component are now fully testable from repl
e926ebb to
4245912
Compare
| @@ -0,0 +1,630 @@ | |||
| (ns commando.debug | |||
There was a problem hiding this comment.
makes sense to move it from utils.
| (binding [utils/*execute-config* | ||
| (assoc (utils/execute-config) | ||
| :hook-execute-start | ||
| (fn [e] |
There was a problem hiding this comment.
This execute-trace will overrwrite hooks that user may have set under :hook-execute-start. Would be better to compose hooks instead of overwriting them
There was a problem hiding this comment.
it very special case. I think user need to create its own function. But we can handle this in future release. But for now i think it little bit unnecessary, cause the only one case with hooks, is this function.
| Accepts a single mode keyword or a vector of modes to combine. | ||
|
|
||
| Modes: | ||
| :table — tabular execution map (order, deps, results) (default) |
There was a problem hiding this comment.
This says :table is default but in implementation it defaults to :tree
There was a problem hiding this comment.
good catch, will fix it in the second mr.
| execute-debug — execute and visualize a single instruction | ||
| execute-trace — trace all nested execute calls with timing | ||
|
|
||
| Display modes for execute-debug / pprint-debug: |
There was a problem hiding this comment.
Having this description of a function details at the ns level docstring is a bad idea, they will drift off quickly.
Even now, when you look at pprint-debug the documentation in it has already drifted, even though it's a first commit on them. The pprint-debug says default is :table and ns says it's :tree.
There was a problem hiding this comment.
your right , i'll fix it in the second mr
(sorry no in this one, because in second MR, i've already add few changes to debug.cljc)
| - `execute-debug` — execute an instruction and visualize it in one of six display modes: `:tree`, `:table`, `:graph`, `:stats`, `:instr-before` / `:instr-after`. Supports combining multiple modes via a vector. | ||
| - `execute-trace` — trace all nested `commando/execute` calls. | ||
|
|
||
| REMOVED **BREAKING** `print-stats`, `print-trace` (`print-deep-stats`) from `commando.impl.utils`. These functions have been replaced by the richer `commando.debug` namespace. |
There was a problem hiding this comment.
If it's breaking it should not be update from 1.1.0 -> 1.1.1, it should be at least 1.2.0
Because the last one is non-breaking so user knows those updates can be safely added and they don't have to change anything in their code.
https://www.taoensso.com/break-versioning
There was a problem hiding this comment.
Respect this idea, but still 1->2 to early, it have to be changed conceptually. Debug function itself cannot break the other architectures. Let discuss it.
| the evaluated instruction into the atom." | ||
| [state-atom instruction] | ||
| ;; (ajax/POST "/commando" ...) | ||
| ;; on-success: (swap! state-atom deep-merge (:instruction result)) |
There was a problem hiding this comment.
this is commented out, so it returns nil, is this TODO?
There was a problem hiding this comment.
reagent_front itself it not completely executable. We need to create some simulation of Mutate-http in repl. I'd rather explaining it from flow perspective, like form-component reagent with r/track which wouldn't work either without frontned. So it walkthroug but not much testable itself, it will if you place components in frontend.
if you know how make it better - let then discuss
ADDED
commando.debugnamespace — new dedicated module for debug visualization. Provides two main entry points:execute-debug— execute an instruction and visualize it in one of six display modes::tree,:table,:graph,:stats,:instr-before/:instr-after. Supports combining multiple modes via a vector.execute-trace— trace all nestedcommando/executecalls.REMOVED BREAKING
print-stats,print-trace(print-deep-stats) fromcommando.impl.utils. These functions have been replaced by the richercommando.debugnamespace.FIXED
crop-final-status-mapincommando.core— internal keys (:internal/cm-list,:internal/cm-dependency,:internal/cm-running-order,:registry) are now properly stripped from the result when:debug-resultis not enabled.FIXED
execute-command-implincommando.impl.executing— added guard for non-mapcommand-databefore callingdissocon driver keys (:=>,"=>), preventing errors when command data is a non-map value.UPDATED documentation — restructured
README.mdwith improved navigation, added "Managing the Registry" and "Debugging" sections. Moved doc files fromdoc/toexamples/directory with richer, runnable code examples:walkthrough.clj,integrant.clj,json.clj,reitit.clj,reagent_front.cljs.UPDATED tests — split monolithic
core_test.cljcinto focused test namespaces:dependency_test.cljc,finding_commands_test.cljc,graph_test.cljc. Addeddebug_test.cljcfor the new debug module. Updated performance tests.@Kaspazza i've added debug_test, it's just smoke test for visual check. Nothing more.