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
4 changes: 2 additions & 2 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
node-version: 24
package-manager-cache: false
- uses: calcit-lang/setup-calcit@v1.5.0
- uses: calcit-lang/setup-calcit@v1.5.1
with:
tools: calcit,caps
caps-version: "0.1.1"
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
name: client-dist
path: dist/
- name: Upload and verify frontend resources
uses: worktools/cos-upload-action@v1.2.0
uses: worktools/cos-upload-action@8c4f3d09a4478b0d4c8698ffb94759b41831cba8 # v1.3.0
with:
source-dir: dist
bucket: ${{ secrets.COS_BUCKET }}
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ ClojureScript, beginners' home page

### 使用者影响

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

Logo 切换使用 `RespoEvent` 和具名 `Action`,状态路径校验为 `CoordKey`。开发面板直接使用类型化 Reel,渲染进入 Respo 的 memo frame。依赖配对正式 Respo **0.19.5**、Reel **0.10.0**、Markdown **0.8.2**、UI **0.15.2**、JS-FFI **0.2.13**,传递 Router **0.12.2**。 应用派发使用 `Action | reel.typed/Control`,缺席的工具 Logo 保持为 `Option`。Highlight.js 注册回调使用具名宿主类型。
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 注册回调使用具名宿主类型。

### 0.31.0 迁移记录

Expand Down Expand Up @@ -39,8 +39,7 @@ For development, run `yarn watch` and `yarn serve` in separate terminals. Open
the Vite URL with `?mode=dev` to enable the existing Reel tools.

The application Store, actions, showcases and tool cards have explicit nominal
types. The legacy Respo component-state payload and incoming dispatcher remain
open boundaries, so this is not a claim of zero Dynamic type debt.
types. The Respo component-state payload remains heterogeneous.
Stored data retains the original Map field format and is decoded into Store
when restored. Startup still chooses a random showcase, as before.

Expand Down
65 changes: 25 additions & 40 deletions calcit.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
{} (:description |) (:init-fn 'app.main/main!) (:mode :js) (:reload-fn 'app.main/reload!) (:target :browser)
:feature-policy $ {}
:modules $ [] |respo.calcit/ |respo-ui.calcit/ |respo-markdown.calcit/ |reel.calcit/ |js-ffi/
:type-slots $ {} $ :dispatch-op 'app.schema/DispatchOp
:type-slots $ {} $ :dispatch-op 'app.schema/Action
:files $ {}
'app.comp.container $ %{} 'FileEntry
:defs $ {}
'comp-container $ %{} 'CodeEntry (:doc |)
:code $ quote $ defcomp comp-container (reel)
:code $ quote $ defcomp comp-container (reel on-control)
let
store $ :store reel
states $ :states store
Expand All @@ -32,10 +32,12 @@
respo.comp.space/space-y 16
comp-footer
if dev?
Option :some $ comp-typed-reel (>> states :reel) reel $ {}
Option :some $ comp-typed-reel (>> states :reel) reel ({}) on-control
Option :none
:examples $ []
:schema $ quote $ Fn (reel.typed/State app.schema/Action app.schema/Store) (-> respo.schema/Component)
:schema $ quote $ Fn (reel.typed/State app.schema/Action app.schema/Store)
Fn reel.typed/Control $ -> Unit
-> respo.schema/Component
'comp-footer $ %{} 'CodeEntry (:doc |)
:code $ quote $ defcomp comp-footer ()
div
Expand Down Expand Up @@ -64,7 +66,7 @@
:style $ .merge ui/row-center $ {} (:cursor |pointer)
:on-click $ fn (e d!)
hint-fn $ Fn respo.schema/RespoEvent
Fn AnyEnum $ -> Unit
Fn app.schema/Action $ -> Unit
-> Unit
d! $ app.schema/Action :pick-case $ decode-map-as (rand-int 10) Number
div $ {} $ :style
Expand Down Expand Up @@ -241,16 +243,10 @@
:code $ quote $ defref *reel (typed-reel/new-reel schema/store)
:examples $ []
:schema $ quote $ Ref (reel.typed/State app.schema/Action app.schema/Store)
'dispatch! $ %{} 'CodeEntry
:doc "|Checks incoming application operations and Reel controls before updating typed state."
:code $ quote $ defn dispatch! (op)
match (typed-reel/decode-control op)
(:some control) (dispatch-resolved! control)
(:none)
dispatch-resolved! $ decode-action op
, &unit
'dispatch! $ %{} 'CodeEntry (:doc "|Dispatches a typed application action.")
:code $ quote $ defn dispatch! (op) (dispatch-resolved! op)
:examples $ []
:schema $ quote $ Fn AnyEnum (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn app.schema/Action (-> Unit) (:features :js-ffi)
'dispatch-resolved! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn dispatch-resolved! (op)
hint-fn $ Fn app.schema/ResolvedAction (-> Unit) (:features :js-ffi)
Expand All @@ -274,17 +270,17 @@
match
browser/storage-get $ :storage-key config/site
(:some raw)
dispatch! $ :: :hydrate-storage $ parse-cirru-edn raw
dispatch! $ restore-action raw
(:none) &unit
render-app!
add-watch! *reel :changes $ fn (r p)
hint-fn $ Fn (reel.typed/State app.schema/Action app.schema/Store) (reel.typed/State app.schema/Action app.schema/Store) (-> Unit)
render-app!
listen-devtools! |a dispatch!
listen-devtools! |a on-control!
browser/add-event-listener! |beforeunload $ fn (event)
hint-fn $ Fn js-ffi.browser/EventHost $ -> Unit
save-store!
dispatch! $ :: :pick-case $ rand-int 10
dispatch! $ schema/Action :pick-case $ decode-map-as (rand-int 10) Number
println "|App started."
:examples $ []
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
Expand All @@ -297,6 +293,10 @@
:schema $ quote $ Fn
-> $ JsNullish respo.dom/DomElement
:features :js-ffi
'on-control! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn on-control! (control) (dispatch-resolved! control)
:examples $ []
:schema $ quote $ Fn reel.typed/Control (-> Unit) (:features :js-ffi)
'reload! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn reload! ()
if (js-nullish? build-errors)
Expand All @@ -313,7 +313,7 @@
'render-app! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn render-app! ()
render-with! (mount-target)
fn () $ comp-container @*reel
fn () $ comp-container @*reel on-control!
, dispatch!
:examples $ []
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
Expand All @@ -333,7 +333,7 @@
:require
respo.core :refer $ render-with! clear-cache! realize-ssr!
app.comp.container :refer $ comp-container
app.updater :refer $ updater decode-action
app.updater :refer $ updater restore-action
app.schema :as schema
app.config :as config
reel.util :refer $ listen-devtools!
Expand All @@ -355,10 +355,6 @@
:hydrate-storage app.schema/Store
:examples $ []
:schema $ quote EnumDef
'DispatchOp $ %{} 'CodeEntry (:doc "|Respo 入口事件合同,容纳应用和 Reel 控制事件;代表值不发送。")
:code $ quote $ def DispatchOp (:: :unhandled)
:examples $ []
:schema $ quote AnyEnum
'ResolvedAction $ %{} 'CodeEntry (:doc |)
:code $ quote $ defunion ResolvedAction Action reel.typed/Control
:examples $ []
Expand Down Expand Up @@ -389,25 +385,14 @@
:code $ quote $ ns app.schema
'app.updater $ %{} 'FileEntry
:defs $ {}
'decode-action $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn decode-action (op)
match op
(:states cursor data)
Action :states
decode-map-as cursor $ List respo.schema/CoordKey
, data
(:content text)
if (string? text) (Action :content text) (raise "|Expected content String")
(:pick-case index)
if (number? index) (Action :pick-case index) (raise "|Expected showcase Number")
(:hydrate-storage data)
Action :hydrate-storage $ decode-map-as data 'app.schema/Store
_ $ raise "|Unknown application action"
:examples $ []
:schema $ quote $ Fn AnyEnum (-> app.schema/Action)
'restore-action $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn restore-action (raw)
Action :hydrate-storage $ decode-map-as (parse-cirru-edn raw) 'app.schema/Store
:examples $ []
:schema $ quote $ Fn String (-> app.schema/Action)
:tests $ [] $ %{} 'TestEntry (:name |restores-legacy-store-map)
:code $ quote $ let
action $ decode-action $ :: :hydrate-storage
action $ restore-action $ format-cirru-edn
{}
:states $ {}
:content |saved
Expand Down
4 changes: 2 additions & 2 deletions deps.cirru
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{} (:calcit-version |0.37.0) (:version |0.1.1)
{} (:calcit-version |0.38.0) (:version |0.1.1)
:dependencies $ {}
|Respo/respo.calcit |0.19.5
|Respo/reel.calcit |0.10.0
|Respo/reel.calcit |0.11.0
|Respo/respo-markdown.calcit |0.8.2
|Respo/respo-ui.calcit |0.15.2
|calcit-lang/js-ffi |0.2.13
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.37.0",
"@calcit/procs": "0.38.0",
"@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.