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
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
87 changes: 41 additions & 46 deletions calcit.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -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 |)
Expand Down Expand Up @@ -61,18 +63,18 @@
{}
: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)"
:width |40px
: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
Expand Down Expand Up @@ -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)
Expand All @@ -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 |)
Expand All @@ -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
Expand Down Expand Up @@ -213,15 +213,14 @@
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
app.schema :refer $ Showcase
'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 |)
Expand All @@ -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
Expand Down Expand Up @@ -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 |)
Expand All @@ -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
Expand All @@ -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 |)
Expand All @@ -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")
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions deps.cirru
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
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.