Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ClojureScript, beginners' home page

### 使用者影响

升级到 Calcit 和 `@calcit/procs` **0.41.1** 后,请重新安装依赖、生成 JS 并刷新页面。导航、十份展示示例、代码高亮、旧 Map 存档和页面 HUD 继续适用。`content/*.cljs` 仍作为页面示例展示。
升级到 Calcit 和 `@calcit/procs` **0.42.1** 后,请重新安装依赖、生成 JS 并刷新页面。导航、十份展示示例、代码高亮、旧 Map 存档和页面 HUD 继续适用。`content/*.cljs` 仍作为页面示例展示。

Logo 切换使用 `RespoEvent` 和具名 `Action`,状态路径校验为 `CoordKey`。开发面板直接使用类型化 Reel,渲染进入 Respo 的 memo frame。依赖配对正式 Respo **0.19.5**、Reel **0.11.0**、Markdown **0.8.2**、UI **0.15.2**、JS-FFI **0.2.13**,传递 Router **0.12.2**。 页面只派发具名 `Action`,Reel 面板和快捷键单独接收 `reel.typed/Control`,两者在更新状态时用联合类型匹配,缺席的工具 Logo 保持为 `Option`。Highlight.js 注册回调使用具名宿主类型。

Expand Down
31 changes: 19 additions & 12 deletions calcit.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
'dispatch! $ %{} 'CodeEntry (:doc "|Dispatches a typed application action.")
:code $ quote $ defn dispatch! (op) (dispatch-resolved! op)
:examples $ []
:schema $ quote $ Fn schema/Action (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn schema/Action (-> Unit) (:features :js-ffi :state)
'dispatch-resolved! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn dispatch-resolved! (op)
reset! *reel $ match op
Expand All @@ -255,7 +255,7 @@
typed-reel/record-op updater @*reel action (generate-id!) (host/now-ms)
, &unit
:examples $ []
:schema $ quote $ Fn schema/ResolvedAction (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn schema/ResolvedAction (-> Unit) (:features :js-ffi :state)
'main! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn main! ()
println "|Running mode:" $ if config/dev? |dev |release
Expand Down Expand Up @@ -283,7 +283,7 @@
dispatch! $ schema/Action :pick-case $ decode-map-as (rand-int 10) Number
println "|App started."
:examples $ []
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn (-> Unit) (:features :io :js-ffi :state)
'mount-target $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn mount-target ()
let
Expand All @@ -296,7 +296,7 @@
'on-control! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn on-control! (control) (dispatch-resolved! control)
:examples $ []
:schema $ quote $ Fn reel.typed/Control (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn reel.typed/Control (-> Unit) (:features :js-ffi :state)
'reload! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn reload! ()
if (js-nullish? build-errors)
Expand All @@ -309,14 +309,14 @@
hud! |error build-errors
, &unit
:examples $ []
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn (-> Unit) (:features :js-ffi :state)
'render-app! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn render-app! ()
render-with! (mount-target)
fn () $ comp-container @*reel on-control!
, dispatch!
:examples $ []
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn (-> Unit) (:features :js-ffi :state)
'save-store! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn save-store! ()
let
Expand All @@ -327,7 +327,7 @@
:content $ :content store
:case-idx $ :case-idx store
:examples $ []
:schema $ quote $ Fn (-> Unit)
:schema $ quote $ Fn (-> Unit) (:features :state)
:ns $ %{} 'NsEntry (:doc |)
:code $ quote $ ns app.main
:require
Expand All @@ -349,7 +349,7 @@
:defs $ {}
'Action $ %{} 'CodeEntry (:doc |)
:code $ quote $ defenum Action
:states (List respo.schema/CoordKey) Dynamic
:states (List respo.schema/CoordKey) StateValue
:content String
:pick-case Number
:hydrate-storage app.schema/Store
Expand All @@ -363,10 +363,14 @@
:code $ quote $ defstruct Showcase (:code String) (:text String) (:url String)
:examples $ []
:schema $ quote StructDef
'StateValue $ %{} 'CodeEntry (:doc |)
:code $ quote $ defunion StateValue Bool Number String Tag (List StateValue) (Map respo.schema/CoordKey StateValue)
:examples $ []
:schema $ quote UnionDef
'Store $ %{} 'CodeEntry
:doc "|Application fields are concrete. Only the Respo component-state tree retains its existing heterogeneous payload contract; hydrate and updates must pass a runtime decoder."
:doc "|Application fields and the recursive Respo state tree are checked at hydration and update boundaries."
:code $ quote $ defstruct Store
:states $ Map Tag Dynamic
:states $ Map respo.schema/CoordKey StateValue
:content String
:case-idx Number
:examples $ []
Expand Down Expand Up @@ -394,14 +398,17 @@
:code $ quote $ let
action $ restore-action $ format-cirru-edn
{}
:states $ {}
:states $ {} $ :reel
{} $ :data false
:content |saved
:case-idx 3
match action
(:hydrate-storage restored)
do
assert= |saved $ :content restored
assert= 3 $ :case-idx restored
assert= (:states restored)
{} $ :reel $ {} (:data false)
_ $ raise "|Expected hydration action"
:tags $ #{} :regression :unit
'updater $ %{} 'CodeEntry (:doc |)
Expand All @@ -410,7 +417,7 @@
(:states cursor s)
assoc store :states $ decode-map-as
update-state-tree (:states store) cursor s
Map Tag Dynamic
Map respo.schema/CoordKey app.schema/StateValue
(:content c) (assoc store :content c)
(:pick-case c) (assoc store :case-idx c)
(:hydrate-storage d) d
Expand Down
2 changes: 1 addition & 1 deletion deps.cirru
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{} (:calcit-version |0.41.1) (:version |0.1.1)
{} (:calcit-version |0.42.1) (:version |0.1.1)
:dependencies $ {}
|Respo/respo.calcit |0.19.5
|Respo/reel.calcit |0.11.0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"vite": "8.3.3"
},
"dependencies": {
"@calcit/procs": "0.41.1",
"@calcit/procs": "0.42.1",
"@calcit/std": "^0.0.2",
"cirru-color": "^0.2.4",
"copy-text-to-clipboard": "^3.2.2",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.