From 05e5f174cd15800ebf193b2d0f77c1be92d9fe79 Mon Sep 17 00:00:00 2001 From: tiye Date: Fri, 6 Nov 2026 06:02:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=20ClojureScript=20=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E5=88=B0=20Calcit=200.35.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 ++---- calcit.cirru | 87 +++++++++++++++++++++++++--------------------------- deps.cirru | 12 ++++---- package.json | 4 +-- yarn.lock | 10 +++--- 5 files changed, 57 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index fd5ce94..ea8f75b 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,11 @@ ClojureScript, beginners' home page > No offending. I'm just trying to explore if such a page is meaningful for beginners. -### Calcit 0.32.1:使用者影响 +### 使用者影响 -CLI 与 `@calcit/procs` 配对正式 **0.32.1**,需重新安装完整图、生成 JS 并完整刷新。严格安装已发布 Respo **0.17.1**、Reel **0.7.0**、Markdown **0.5.0**、UI **0.9.0**、JS FFI **0.2.9**;UI 固定的传递 Router 仍为精确 **0.9.0-alpha.4**,不混入本地候选或 hash。导航、展示内容、高亮、启动随机选择、存档恢复顺序及 JS HUD 保持;`content/*.cljs` 仍是展示示例,不作为 Calcit 源码改写。 +升级到 Calcit 和 `@calcit/procs` **0.35.1** 后,请重新安装依赖、生成 JS 并刷新页面。导航、十份展示示例、代码高亮、旧 Map 存档和页面 HUD 继续适用。`content/*.cljs` 仍作为页面示例展示。 -官方 format 规范化九处旧类型写法;32 个应用定义的代码/schema/metadata/原测试与 main 经官方 format 归一后的完整查询视图相同。原完整 strict、all-defs、两项业务测试和零弃用调用/动态方法门禁保留,不增加强转、预算、校验脚本或测试框架。Actions 使用已核对原 SHA 的精确正式 tag;包等待期按维护者明确的一小时策略显式为 60m,COS 内置 verify 和原部署路径不变。 - -精确官方 0.32.1、真实已发布六模块 Caps 图、307/307 定义、完整 strict(diagnostics=[])、原两项测试、零动态方法/弃用调用、canonical dry-run、immutable、工具链配对与构建通过。实际隔离 IAB 中 Logo 将展示从 Thread macros 切到 Data manipulation、再到 EDN,语法高亮和刷新正常,warning/error 为空。保留原大 bundle 提示,不调整阈值;未点击复制、访问外部工具或操作真实存档,未重验坏存档、HMR 和移动端。精确 PR CI 结果在迁移 PR 更新,不将本地验收当作生产部署成功。 - -历史 Git Snapshot 的旧类型暂不能由 program-diff 加载([Calcit #2503](https://github.com/calcit-lang/calcit/issues/2503));本轮对历史 blob 隔离副本仅经官方 format,再查询全部定义对照,不绕过原门禁。下方 0.31 说明为历史记录。 +Logo 切换使用 `RespoEvent` 和具名 `Action`,状态路径校验为 `CoordKey`。开发面板直接使用类型化 Reel,渲染进入 Respo 的 memo frame。依赖配对正式 Respo **0.19.4**、Reel **0.9.2**、Markdown **0.8.1**、UI **0.15.1**、JS-FFI **0.2.13**,传递 Router **0.12.1**。 ### Workflow diff --git a/calcit.cirru b/calcit.cirru index 8635033..0e0abae 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -26,12 +26,14 @@ comp-md-block (inline |clojure-is.md) {} $ :class-name "|content on-dark" comp-showcase $ :case-idx store - =< nil 32 + respo.comp.space/space-y 32 comp-tools comp-resources - =< nil 16 + respo.comp.space/space-y 16 comp-footer - when dev? $ comp-reel (>> states :reel) (reel-view/view-data reel) ({}) + if dev? + Option :some $ comp-typed-reel (>> states :reel) reel $ {} + Option :none :examples $ [] :schema $ quote $ Fn (reel.typed/State app.schema/Action app.schema/Store) (-> respo.schema/Component) 'comp-footer $ %{} 'CodeEntry (:doc |) @@ -61,10 +63,10 @@ {} :style $ .merge ui/row-center $ {} (:cursor |pointer) :on-click $ fn (e d!) - hint-fn $ Fn (Map Tag Dynamic) - Fn Dynamic & Dynamic $ -> Unit + hint-fn $ Fn respo.schema/RespoEvent + Fn AnyEnum $ -> Unit -> Unit - d! $ :: :pick-case $ rand-int 10 + d! $ app.schema/Action :pick-case $ decode-map-as (rand-int 10) Number div $ {} $ :style {} :background-image $ str "|url(https://cdn.tiye.me/logo/cljs.png)" @@ -72,7 +74,7 @@ :height |40px :background-position "|center center" :background-size |cover - =< 8 nil + respo.comp.space/space-x 8 a $ {} (:href |https://clojurescript.org/) (:inner-text "|(Unofficial)") :style $ {} :color $ hsl 240 80 80 @@ -132,7 +134,7 @@ div {} $ :style $ {} (:margin-top |48px) <> |Learning $ {} (:font-size |24px) (:font-weight |100) (:font-family ui/font-normal) (:vertical-align |middle) - =< 16 nil + respo.comp.space/space-x 16 a {} :style $ .merge ui/button $ {} (:vertical-align |middle) (:border-radius |16px) (:padding "|0 16px") (:font-family ui/font-fancy) (:font-size |20px) (:text-decoration |none) (:line-height |32px) (:display |inline-block) @@ -153,15 +155,13 @@ respo-ui.core :refer $ hsl respo-ui.core :as ui respo.core :refer $ defcomp >> <> div button textarea span a - respo.comp.space :refer $ =< - reel.comp.reel :refer $ comp-reel + reel.comp.reel :refer $ comp-typed-reel respo-md.comp.md :refer $ comp-md comp-md-block app.config :refer $ dev? app.util :refer $ highlighter inline app.comp.showcase :refer $ comp-showcase |@calcit/std :refer $ rand-int app.schema :refer $ ToolInfo - reel.typed-compat :as reel-view 'app.comp.showcase $ %{} 'FileEntry :defs $ {} 'comp-showcase $ %{} 'CodeEntry (:doc |) @@ -176,7 +176,7 @@ div ({}) <> (:text showcase) {} (:color |white) (:font-size |16px) - =< 16 nil + respo.comp.space/space-x 16 a $ {} :href $ :url showcase :target |_blank @@ -213,7 +213,6 @@ respo-ui.core :refer $ hsl respo-ui.core :as ui respo.core :refer $ defcomp cursor-> action-> mutation-> <> div button textarea span a - respo.comp.space :refer $ =< respo-md.comp.md :refer $ comp-md comp-md-block app.config :refer $ dev? app.util :refer $ highlighter inline @@ -221,7 +220,7 @@ 'app.config $ %{} 'FileEntry :defs $ {} 'Site $ %{} 'CodeEntry (:doc |) - :code $ quote $ defstruct Site (:dev-ui 'String) (:release-ui 'String) (:cdn-url 'String) (:title 'String) (:icon 'String) (:storage-key 'String) + :code $ quote $ defstruct Site (:dev-ui String) (:release-ui String) (:cdn-url String) (:title String) (:icon String) (:storage-key String) :examples $ [] :schema $ quote StructDef 'dev? $ %{} 'CodeEntry (:doc |) @@ -243,20 +242,16 @@ :examples $ [] :schema $ quote $ Ref (reel.typed/State app.schema/Action app.schema/Store) 'dispatch! $ %{} 'CodeEntry - :doc "|One checked Respo event boundary: legacy anonymous enums normalize to typed Reel controls or nominal application Actions. Dynamic remains only because Respo render! owns an open dispatcher contract; business updater/store are concrete." - :code $ quote $ defn dispatch! (input) - if (enum? input) - match (typed-reel/decode-control input) - (:some control) - reset! *reel $ typed-reel/apply-control updater @*reel control - (:none) - let - action $ decode-action input - reset! *reel $ typed-reel/record-op updater @*reel action (generate-id!) (host/now-ms) - raise "|Expected one action enum" + :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) + reset! *reel $ typed-reel/apply-control updater @*reel control + (:none) + reset! *reel $ typed-reel/record-op updater @*reel (decode-action op) (generate-id!) (host/now-ms) , &unit :examples $ [] - :schema $ quote $ Fn Dynamic (-> Unit) + :schema $ quote $ Fn AnyEnum (-> Unit) (:features :js-ffi) 'main! $ %{} 'CodeEntry (:doc |) :code $ quote $ defn main! () println "|Running mode:" $ if config/dev? |dev |release @@ -305,7 +300,9 @@ :schema $ quote $ Fn (-> Unit) (:features :js-ffi) 'render-app! $ %{} 'CodeEntry (:doc |) :code $ quote $ defn render-app! () - render! (mount-target) (comp-container @*reel) dispatch! + render-with! (mount-target) + fn () $ comp-container @*reel + , dispatch! :examples $ [] :schema $ quote $ Fn (-> Unit) (:features :js-ffi) 'save-store! $ %{} 'CodeEntry (:doc |) @@ -322,7 +319,7 @@ :ns $ %{} 'NsEntry (:doc |) :code $ quote $ ns app.main :require - respo.core :refer $ render! clear-cache! realize-ssr! + respo.core :refer $ render-with! clear-cache! realize-ssr! app.comp.container :refer $ comp-container app.updater :refer $ updater decode-action app.schema :as schema @@ -340,33 +337,31 @@ :defs $ {} 'Action $ %{} 'CodeEntry (:doc |) :code $ quote $ defenum Action - :states - quote $ List Dynamic - , 'Dynamic - :content 'String - :pick-case 'Number - :hydrate-storage 'app.schema/Store + :states (List respo.schema/CoordKey) Dynamic + :content String + :pick-case Number + :hydrate-storage app.schema/Store :examples $ [] :schema $ quote EnumDef 'DispatchOp $ %{} 'CodeEntry (:doc "|Respo 入口事件合同,容纳应用和 Reel 控制事件;代表值不发送。") :code $ quote $ def DispatchOp (:: :unhandled) :examples $ [] - :schema $ quote Enum + :schema $ quote AnyEnum 'Showcase $ %{} 'CodeEntry (:doc |) - :code $ quote $ defstruct Showcase (:code 'String) (:text 'String) (:url 'String) + :code $ quote $ defstruct Showcase (:code String) (:text String) (:url String) :examples $ [] :schema $ quote StructDef '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." :code $ quote $ defstruct Store - :states $ quote $ Map Tag Dynamic - :content 'String - :case-idx 'Number + :states $ Map Tag Dynamic + :content String + :case-idx Number :examples $ [] :schema $ quote StructDef 'ToolInfo $ %{} 'CodeEntry (:doc |) - :code $ quote $ defstruct ToolInfo (:name 'String) (:url 'String) (:description 'String) - :logo $ quote $ Option String + :code $ quote $ defstruct ToolInfo (:name String) (:url String) (:description String) + :logo $ Option String :examples $ [] :schema $ quote StructDef 'store $ %{} 'CodeEntry (:doc |) @@ -383,7 +378,7 @@ match op (:states cursor data) Action :states - decode-map-as cursor $ :: 'List 'Dynamic + decode-map-as cursor $ List respo.schema/CoordKey , data (:content text) if (string? text) (Action :content text) (raise "|Expected content String") @@ -393,7 +388,7 @@ Action :hydrate-storage $ decode-map-as data 'app.schema/Store _ $ raise "|Unknown application action" :examples $ [] - :schema $ quote $ Fn Enum (-> app.schema/Action) + :schema $ quote $ Fn AnyEnum (-> app.schema/Action) :tests $ [] $ %{} 'TestEntry (:name |restores-legacy-store-map) :code $ quote $ let action $ decode-action $ :: :hydrate-storage @@ -414,7 +409,7 @@ (:states cursor s) assoc store :states $ decode-map-as update-state-tree (:states store) cursor s - :: 'Map 'Tag 'Dynamic + Map Tag Dynamic (:content c) (assoc store :content c) (:pick-case c) (assoc store :case-idx c) (:hydrate-storage d) d @@ -439,8 +434,8 @@ :defs $ {} 'HighlightHost $ %{} 'CodeEntry (:doc |) :code $ quote $ deftrait HighlightHost - .highlight $ quote $ Fn app.util/HighlightHost String JsObject (-> JsObject) - .register-language! $ quote $ Fn app.util/HighlightHost String Fn (-> Unit) + .highlight $ Fn app.util/HighlightHost String JsObject $ -> JsObject + .register-language! $ Fn app.util/HighlightHost String Fn $ -> Unit :examples $ [] :ffi $ {} (:backend :js) (:kind :external-object) :schema $ quote Trait diff --git a/deps.cirru b/deps.cirru index 52fe348..777dbff 100644 --- a/deps.cirru +++ b/deps.cirru @@ -1,7 +1,7 @@ -{} (:calcit-version |0.32.1) (:version |0.1.0) +{} (:calcit-version |0.35.1) (:version |0.1.1) :dependencies $ {} - |Respo/respo.calcit |0.17.1 - |Respo/reel.calcit |0.7.0 - |Respo/respo-markdown.calcit |0.5.0 - |Respo/respo-ui.calcit |0.9.0 - |calcit-lang/js-ffi |0.2.9 + |Respo/respo.calcit |0.19.4 + |Respo/reel.calcit |0.9.2 + |Respo/respo-markdown.calcit |0.8.1 + |Respo/respo-ui.calcit |0.15.1 + |calcit-lang/js-ffi |0.2.13 diff --git a/package.json b/package.json index 1416f25..c2394f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clojure-script-org", - "version": "0.1.0", + "version": "0.1.1", "description": "ClojureScript beginners home page built with Calcit", "private": true, "packageManager": "yarn@4.18.0", @@ -21,7 +21,7 @@ "vite": "8.3.3" }, "dependencies": { - "@calcit/procs": "0.32.1", + "@calcit/procs": "0.35.1", "@calcit/std": "^0.0.2", "cirru-color": "^0.2.4", "copy-text-to-clipboard": "^3.2.2", diff --git a/yarn.lock b/yarn.lock index 15c57d3..b25d5e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,15 +12,15 @@ __metadata: languageName: node linkType: hard -"@calcit/procs@npm:0.32.1": - version: 0.32.1 - resolution: "@calcit/procs@npm:0.32.1" +"@calcit/procs@npm:0.35.1": + version: 0.35.1 + resolution: "@calcit/procs@npm:0.35.1" dependencies: "@calcit/finger-vec": "npm:0.1.1" "@calcit/ternary-tree": "npm:0.0.26" "@cirru/parser.ts": "npm:0.0.10" "@cirru/writer.ts": "npm:^0.1.9" - checksum: 10c0/54c505396a4653e643d24eaa71bf9a029b48034cabcd68ce47b2b40b565cf04a4693ac47c7feb34b8e84936621a397802743bffd3134ddeb37b08d23ef113923 + checksum: 10c0/c39ab807cdda677cfd9fa9f6ae8adbb468347d5dd85ac38355a27a048cc9a1b7301d4f9c73f3bbf815269ecc7a59d824f61c8c46a9d56ae6a67f3b5cb21be3de languageName: node linkType: hard @@ -229,7 +229,7 @@ __metadata: version: 0.0.0-use.local resolution: "clojure-script-org@workspace:." dependencies: - "@calcit/procs": "npm:0.32.1" + "@calcit/procs": "npm:0.35.1" "@calcit/std": "npm:^0.0.2" bottom-tip: "npm:^0.1.5" cirru-color: "npm:^0.2.4"