Skip to content

Conversation

@seefeldb
Copy link
Contributor

@seefeldb seefeldb commented Jun 16, 2025

Changes all places that expect { cell: DocImpl, path: ProperyKey[] } to also accept the JSON representation. Turns off that translation in storage.ts.

At the same time, supports the new sigil for links, should be extracted, effectively { "/": { "link@1": { ... }}}). Folds aliases into those with overwrite: "redirect" as flag.

This is because today storage.ts translates any { "/": string } it finds to { "/": DocImpl }, but we don't want to carry this logic over to this new state.

This changes also affected schema queries on the serverside, which should also support both format.

For future PRs:

  • The new .getAsCellLink() returns the old format and we should remove all places that use this that won't be changed with the upcoming switch to transactions API. Mostly tests at this point.
  • Recipes still generate the old alias format ($alias) because there are a few hacks for closures that I didn't want to carry forward. There's an upcoming refactor here and after that we should change this.

@seefeldb seefeldb force-pushed the convert-cell-links-to-sigil-values branch from 8ad319d to 5c89a41 Compare June 17, 2025 16:08
@seefeldb seefeldb force-pushed the convert-cell-links-to-sigil-values branch 2 times, most recently from 3f5ddc0 to 3386600 Compare June 19, 2025 18:29
@seefeldb seefeldb requested review from Gozala, Copilot and ubik2 June 19, 2025 23:55
@seefeldb seefeldb marked this pull request as ready for review June 19, 2025 23:56
@seefeldb seefeldb requested a review from ellyxir June 19, 2025 23:56

This comment was marked as outdated.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic found 8 issues across 36 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

seefeldb added 22 commits June 25, 2025 18:32
…rray schema generation

- Add runtime parameter to createJsonSchema function to resolve sigil links
- Replace legacy cell link handling with new sigil link parsing
- Improve array schema generation to handle mixed object types with anyOf
- Update tests to pass runtime parameter and expect new array schema format
- Remove unused imports and simplify link resolution logic
…optional if they are always there for given combinations of inputs
- Update isSigilValue to require that the "/" property is a plain object (not an array), using isObject instead of isRecord.
- Add a comprehensive test suite for isSigilValue, including:
  - Valid sigil values (with only "/" property as an object)
  - Cases where "/" and other properties coexist (should not be sigil)
  - Cases where "/" is not an object (string, number, array, null, etc.)
  - Non-object and edge cases
- Ensures sigil value detection is robust and future-proof.
… link for now. This should be captured lower in the stack.
- parseLink got overwrite wrong
- also write rootSchema into links
@seefeldb seefeldb force-pushed the convert-cell-links-to-sigil-values branch from f806fb4 to 6d37fa9 Compare June 26, 2025 01:32
@seefeldb seefeldb merged commit f233112 into main Jun 26, 2025
7 checks passed
@seefeldb seefeldb deleted the convert-cell-links-to-sigil-values branch June 26, 2025 15:55
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.

5 participants