Repository navigation
v1.3.0
What's Changed
Updating part of an app
App.update(component_selector=...) runs only the components at the given paths and what it takes to reach them: their ancestors, the root and use_mount children. Every other component is neither run nor treated as gone, so its target states, records and memos stay as they are, and the next update that covers it catches it up. Selecting a path selects its whole subtree.
paths = [coco.ROOT_PATH / coco.Symbol("process_file") / name for name in page]
await app.update(component_selector=paths)
actions = await app.update(component_selector=paths, preview=True)- From the command line,
cocoindex update --select PATH(repeatable) takes a path ascocoindex showprints it, and works with--preview,--liveand--full-reprocess.cocoindex.inspect.list_stable_paths(app)returns the paths of an app asStablePathvalues - A
mount_eachthe selection leaves out doesn't read its source;localfs.walk_dir(...).items()reads just the selected files when only an ancestor of them is selected - A container change (a table rebuild or removal) that would affect rows of components left out is refused with an error asking for a full update, and a preview with the same selector refuses it the same way
by @badmonster0 in #2799, building on #2195 by @gjj930923
Google Docs target (experimental)
cocoindex.connectors.google_docs keeps a Google Doc in step with Markdown your flow declares, such as a report or brief that people read and comment on (pip install "cocoindex[google_docs]"): google_docs.declare_doc(account, name, content).
- The doc is created in your My Drive on the first run and updated in place: only the blocks (a heading and its paragraphs) whose content changed are rewritten, so unchanged paragraphs and the comments on them stay. When the declaration goes away, the doc moves to the trash; it is never deleted permanently
- A block a person edited keeps the person's text, and each write logs a warning naming it until the flow declares the same text.
google_docs.read_doc_edits(account, name, last_declared=...)reads those edits back asBlockEdits, each with the block as declared and as it reads now in Markdown, so a flow can take them in. The read is a data dependency, so a person's edit re-runs a memoized reader and the target's own writes don't - Signs in as your personal Google account with the
drive.filescope only, which reaches the docs CocoIndex created and nothing else:cocoindex auth sign-in google-docs <client_secret.json>(andsign-out google-docs)
Being experimental, it is outside the compatibility promise: a later release, a minor one included, may change or remove it by @georgeh0 in #2863, #2866 and #2867
Stable memo type identifiers
A type's memo entries can survive a rename or a move to another module. Set __coco_memo_type_id__ = "com.example.SourceEntry/v1" on a class you own, or pass stable_type_id= to coco.register_memo_type(...) for one you don't; coco.prev_type_id(old_module, old_name) keeps the entries a type already has under its old name. Types without a stable ID fingerprint as before by @MaxRong in #2256, and @georgeh0 in #2841
Other changes
- fix(core):
App.update(preview=True)also lists the deletions an update makes for components no longer mounted (a deleted source file's outputs, down its whole subtree), instead of leaving them out. It still applies and writes nothing by @georgeh0 in #2861 - fix(core): a data dependency's validator runs once per update for each recorded read, not once for each memoized function, component and ancestor that recorded it by @georgeh0 in #2850
This release also includes the fixes of v1.2.1.
Full Changelog: v1.2.0...v1.3.0