hyperfiddle-2020 icon indicating copy to clipboard operation
hyperfiddle-2020 copied to clipboard

Runtime v3

Open dustingetz opened this issue 5 years ago • 2 comments

Route/spec stuff:

  • [x] hf/defaults args and ret should match the shape of the function fdef (e.g. s/cat)
  • [x] s/cat form should be canonical representation of routes internally
  • [x] s/cat conform names should not be used as selectors (is this already the case?)
  • [x] Untangle route validation (search param validation) vs result validation and how to use spec for this #1081 #1080
  • [ ] remove :shape
  • [x] fiddle defs should use symbols, not (keyword `sub-blocked-list)

Internals:

  • [ ] EDN view should be a live EDN representation of actual RT state
  • [ ] Partition error propagation (and stop mangling errors)
  • [ ] Implementation based on event streams ? Is that Runtime v4?
  • [ ] HFQL - is this v4?

UI

  • [ ] UI can render any document value that comes out of Datomic peer (readonly), without schema or specs
  • [ ] Ability to rewind UI if a staged stmt is rejected by server (don't "bluescreen")
  • [x] Docstrings on search param fields #1083
  • [ ] Highlight dirty cells and loading cells #1065

Acceptance criteria

  • [ ] Bank account form demo (s/or s/and)
  • [ ] Able to explain Hyperfiddle internals via EDN view to Oz
  • [ ] Users able to write spec'ed defns and get UIs without reading hyperfiddle docs
  • [ ] Performance ?

dustingetz avatar Aug 02 '20 15:08 dustingetz

hf/defaults is using the conformer-names from s/cat forms like (s/cat :local-name any?) to generate automatic defaults map which then need to render in the UI therefore the conformer-name itself :local-name needs a spec e.g. ::local-name which is extremely surprising to the end user.

If hf/defaults aligned in shape to s/fdef :args form, we could get away with using the s/fdef as spec that drives UI, thereby reusing existing signals without adding duplicate signal

(s/fdef school-requests*
  :args (s/cat
          :hyperfiddle.route/datomic-args any? 
          ::date inst?)                                     ; canonical declaration
  :ret (s/coll-of map?))

(s/def ::date inst?)                                        ; Duplicate declaration
(defmethod hf/defaults `school-requests* [_ {:keys [::date]}] ; should accept s/cat
  #?(:clj
     {#_#_::school school
      ::date (to-date (or date (t/minus (t/now) (t/days 28))))})) ; this should return s/cat

this also explains this anti-pattern where ::rosie/needle is declared twice: (s/fdef school-subs* :args (s/cat :hyperfiddle.route/datomic-args any? ::rosie/needle ::rosie/needle))

dustingetz avatar Aug 02 '20 15:08 dustingetz

A typo in a s/fdef (datomic-arg instead of argS) took a long time to debug, not sure if this is a real issue in the future when everything gets tightened down by another couple belt notches these types of errors might go away. Otherwise we need extremely robust error handling here for endusers to succeed. Or, new HFQL might reduce number of coding join-points and thus reduce error surface area.

dustingetz avatar Aug 02 '20 17:08 dustingetz