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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Text diff

### 使用者影响

升级到 Calcit 和 `@calcit/procs` **0.38.0** 后,请重新安装依赖、编译并刷新。文本输入、Run 输出、原 Map 存档和页面 HUD 继续适用。 应用操作和 Reel 控制解码后通过 `ResolvedOp` union 区分,已有 Reel 标签和存档结构保持兼容。
升级到 Calcit 和 `@calcit/procs` **0.40.0** 后,请重新安装依赖、编译并刷新。文本输入、Run 输出、原 Map 存档和页面 HUD 继续适用。 应用操作和 Reel 控制通过 `ResolvedOp` union 区分。Reel 面板直接接收独立控制回调,原存档结构保持兼容。

Reel 使用 `State<Op, Store>`。旧操作在入口解码,业务更新器接收具名操作。状态路径沿用 `CursorKey = Tag | String | Number`,已有 Map 或 Struct 存档仍在恢复时校验。恢复成功后才注册离页保存。
Reel 使用 `State<Op, Store>`。业务更新器接收具名操作。状态路径和顶层状态键统一使用 `CursorKey = Tag | String | Number`,已有 Map 或 Struct 存档仍在恢复时校验。恢复成功后才注册离页保存。

正式依赖为 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**。
正式依赖为 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**。

### Workflow

Use `calcit.cirru` and `deps.cirru`; do not restore the retired `compact.cirru`
or `package.cirru`. Generated `js-out/` is not committed.

Use Node 24 and Yarn 4.18.0. Install Calcit 0.38.0 and Caps 0.1.1 separately
Use Node 24 and Yarn 4.18.0. Install Calcit 0.40.0 and Caps 0.1.1 separately
(the latter follows [the official Caps installation](https://github.com/calcit-lang/caps)); Corepack/Yarn does not install Caps. Strict dependency installation and the original type/test gates are retained.
Browser and production acceptance remain separate from successful compilation.

Expand Down
11 changes: 5 additions & 6 deletions calcit.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
:code $ quote $ defcomp comp-container (reel on-control)
let
store $ :store reel
states $ :states store
div
{} $ :style $ .merge ui/global ui/row
textarea $ {}
Expand Down Expand Up @@ -43,7 +42,7 @@
-> Unit
println $ :content store
if dev?
Option :some $ comp-typed-reel (>> states :reel) reel ({}) on-control
Option :some $ comp-controlled-reel reel ({}) on-control
Option :none
:examples $ []
:schema $ quote $ Fn (reel.typed/State text-diff.schema/Op text-diff.schema/Store)
Expand All @@ -52,9 +51,9 @@
:ns $ %{} 'NsEntry (:doc |)
:code $ quote $ ns text-diff.comp.container
:require (respo-ui.core :as ui)
respo.core :refer $ defcomp >> <> div button textarea span input
respo.core :refer $ defcomp <> div button textarea span input
respo.comp.space :refer $ space-x
reel.comp.reel :refer $ comp-typed-reel
reel.comp.reel :refer $ comp-controlled-reel
respo-md.comp.md :refer $ comp-md
text-diff.config :refer $ dev?
'text-diff.config $ %{} 'FileEntry
Expand Down Expand Up @@ -204,7 +203,7 @@
:schema $ quote UnionDef
'Store $ %{} 'CodeEntry (:doc |)
:code $ quote $ defstruct Store
:states $ Map Tag Dynamic
:states $ Map text-diff.schema/CursorKey Dynamic
:content String
:examples $ []
:schema $ quote StructDef
Expand All @@ -230,7 +229,7 @@
(:states cursor data)
assoc store :states $ decode-map-as
update-state-tree (:states store) cursor data
Map Tag Dynamic
Map text-diff.schema/CursorKey Dynamic
(:content content) (assoc store :content content)
(:hydrate-storage stored) stored
:examples $ []
Expand Down
2 changes: 1 addition & 1 deletion deps.cirru
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{} (:calcit-version |0.38.0)
{} (:calcit-version |0.40.0)
:version |0.1.4
:dependencies $ {} (|Respo/reel.calcit |0.11.0)
|Respo/respo-markdown.calcit |0.8.2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"vite": "^8.3.1"
},
"dependencies": {
"@calcit/procs": "0.38.0",
"@calcit/procs": "0.40.0",
"cirru-color": "^0.2.4",
"copy-text-to-clipboard": "^3.2.2",
"dayjs": "^1.11.20",
Expand Down
3 changes: 3 additions & 0 deletions scripts/upgrade.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ test('cursor updates preserve content', () => {
const nested = read(read(read(keyed, tags.states), tags.editor), key);
assert.equal(read(nested, tags.data), false);
assert.equal(read(keyed, tags.content), 'keep');
const root = apply(populated, tags.states, c._$L_(key), false);
const restored = decode_store(c.parse_cirru_edn(c.format_cirru_edn(c._$n_struct_$o_to_map(root))));
assert.equal(read(read(read(restored, tags.states), key), tags.data), false);
}
assert.throws(() => apply(populated, tags.states, c._$L_(tags.editor, false), c._$n__$M_()), /CursorKey|declared type/);
});
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.