Skip to content

Conversation

@seefeldb
Copy link
Contributor

@seefeldb seefeldb commented Apr 1, 2025

Allow inputs to writing cell methods to have a different Cell<> structure than the destination cell

@seefeldb seefeldb requested review from anotherjesse and Copilot April 1, 2025 22:45
…nt Cell<> structure than the destination cell
@seefeldb seefeldb force-pushed the improve-ts-for-cells branch from 705dc67 to aa3e003 Compare April 1, 2025 22:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces improved type checking for Cell methods by allowing setters to accept a flexible Cell<> structure. Key changes include updating the Cell interface methods (set, send, update, push) to use the new Cellify type transformation, modifying test schemas to use "as const satisfies JSONSchema" for stricter type inference, and updating the builder types to use unique symbols for ID constants.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
runner/test/cell.test.ts Updated schema assertions from "satisfies JSONSchema" to "as const satisfies JSONSchema" and refined imports.
runner/src/cell.ts Modified Cell interface method signatures to accept Cellify-wrapped types and adjusted the push union types accordingly.
builder/src/types.ts Changed ID and ID_FIELD symbols to unique symbols and extended JSONSchema to include optional ID properties.
Comments suppressed due to low confidence (2)

runner/src/cell.ts:405

  • [nitpick] The push method union type now wraps array items with Cellify, which might allow inconsistent types; verify that both raw and cellified items are correctly handled as intended.
| DocImpl<T extends Array<infer U> ? Cellify<U> : any>

builder/src/types.ts:3

  • Changing ID from a regular symbol to a unique symbol may affect compatibility with external modules; please confirm that all consumers of this constant can work with the new type.
export const ID: unique symbol = Symbol("ID, unique to the context");

@seefeldb seefeldb merged commit a82a176 into main Apr 1, 2025
6 checks passed
@seefeldb seefeldb deleted the improve-ts-for-cells branch April 1, 2025 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants