Skip to content

Conversation

@cngonzalez
Copy link
Member

@cngonzalez cngonzalez commented Jan 29, 2026

FIXES SDK-546
FIXES SDK-739

Description

Projections never worked particularly well with perspectives because they used the "raw" perspective and manually overlaid a draft version over a published version. This isn't necessary with perspectives, so that functionality is added. It's also required for projections that do joins via references -- "raw" won't properly resolve draft versions of referenced documents.

I've also used the opportunity to migrate projections to sources as well as perspectives, so you'll see some new action binders here.

To avoid a breaking change, there were some changes to the "status" query. I considered omitting it and leaving this to be a breaking change, but the status allows us to maintain parity with what Studio does (see screenshot)

Screenshot 2026-01-29 at 9.42.01 AM.png

What to review

I'm most concerned about the status query stuff.

Testing

Added tests for new functions and updating existing ones where required. E2E tests are coming in a following PR. I can't get the Webkit E2E test to work, but it's failing on "unauthenticated" because of a cookie dialogue, so that needs to be fixed separately.

You can also ref the old behavior here (note that the reference is "published" and the value doesn't change when we change perspectives):

Kapture 2026-01-29 at 11 43 18

Against the new behavior here:
Kapture 2026-01-29 at 11 46 51

Fun gif

@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sdk-docs Ready Ready Preview, Comment Feb 5, 2026 3:43pm
sdk-kitchensink-react Ready Ready Preview, Comment Feb 5, 2026 3:43pm

Request Review

expect(Object.keys(params)).toHaveLength(1)
expect(params[`__ids_${projectionHash}`]).toBeDefined()
expect(params[`__ids_${projectionHash}`]).toHaveLength(4)
expect(params[`__ids_${projectionHash}`]).toHaveLength(2)
Copy link
Member Author

Choose a reason for hiding this comment

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

Two because we are no longer querying for drafts and published versions of each document ID.

@cngonzalez cngonzalez force-pushed the 01-28-refactor_projection_update_projection_store_to_use_source_and_perspective branch from bc18070 to 45393e1 Compare January 29, 2026 15:34
@cngonzalez cngonzalez force-pushed the 01-28-refactor_projection_update_projection_store_to_use_source_and_perspective branch from 45393e1 to 844eb05 Compare January 29, 2026 15:48
@cngonzalez cngonzalez force-pushed the 01-28-refactor_projection_update_projection_store_to_use_source_and_perspective branch from 844eb05 to 84bbc5d Compare January 29, 2026 15:56
@cngonzalez cngonzalez changed the base branch from 01-26-fix_query_use_store_key_to_determine_client_for_live_events to graphite-base/723 January 29, 2026 16:18
@cngonzalez cngonzalez force-pushed the 01-28-refactor_projection_update_projection_store_to_use_source_and_perspective branch from 84bbc5d to 1e7d4e5 Compare January 29, 2026 16:18
@cngonzalez cngonzalez changed the base branch from graphite-base/723 to 01-29-feat_core_add_action_binder_for_source_and_perspective January 29, 2026 16:18
@cngonzalez cngonzalez force-pushed the 01-28-refactor_projection_update_projection_store_to_use_source_and_perspective branch from 1e7d4e5 to 01569a5 Compare January 29, 2026 16:32
@cngonzalez cngonzalez force-pushed the 01-28-refactor_projection_update_projection_store_to_use_source_and_perspective branch from 01569a5 to b3a3482 Compare January 29, 2026 17:30
@cngonzalez cngonzalez changed the base branch from main to graphite-base/723 February 5, 2026 14:54
@cngonzalez cngonzalez force-pushed the 01-28-refactor_projection_update_projection_store_to_use_source_and_perspective branch from 2f4fde3 to 6e266b1 Compare February 5, 2026 14:54
@cngonzalez cngonzalez changed the base branch from graphite-base/723 to make-signin-tests-more-lenient February 5, 2026 14:55
@cngonzalez cngonzalez force-pushed the make-signin-tests-more-lenient branch from c5d5f98 to caf89f8 Compare February 5, 2026 14:59
@cngonzalez cngonzalez force-pushed the 01-28-refactor_projection_update_projection_store_to_use_source_and_perspective branch from 6e266b1 to 1352f30 Compare February 5, 2026 14:59
@cngonzalez cngonzalez changed the title refactor(projection): update projection store to use source and perspective feat(projection): update projection store to use source and perspective Feb 5, 2026
@cngonzalez cngonzalez changed the base branch from make-signin-tests-more-lenient to graphite-base/723 February 5, 2026 15:41
@cngonzalez cngonzalez force-pushed the 01-28-refactor_projection_update_projection_store_to_use_source_and_perspective branch from 1352f30 to 97d6f8b Compare February 5, 2026 15:41
@graphite-app graphite-app bot changed the base branch from graphite-base/723 to main February 5, 2026 15:42
Copy link
Contributor

@binoy14 binoy14 left a comment

Choose a reason for hiding this comment

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

Not 100% sure what's going on but nothing stands out

Copy link
Member Author

cngonzalez commented Feb 6, 2026

Merge activity

  • Feb 6, 4:35 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 6, 4:35 PM UTC: @cngonzalez merged this pull request with Graphite.

@cngonzalez cngonzalez merged commit 332f741 into main Feb 6, 2026
21 checks passed
@cngonzalez cngonzalez deleted the 01-28-refactor_projection_update_projection_store_to_use_source_and_perspective branch February 6, 2026 16:35
@squiggler squiggler bot mentioned this pull request Feb 5, 2026
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