Skip to content

Add an optional sync loading mode - #203

Merged
sevenseacat merged 5 commits into
sevenseacat:mainfrom
Alt-iOS:main
Aug 26, 2026
Merged

Add an optional sync loading mode#203
sevenseacat merged 5 commits into
sevenseacat:mainfrom
Alt-iOS:main

Conversation

@Alt-iOS

@Alt-iOS Alt-iOS commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Adds a global and overridable per collection flag to allow the initial load to be synchronous, making it SSR. Added a few tests to ensure everything afterwards is still async and the user choices are respected. By default is disabled to make it completely opt-in

@Alt-iOS Alt-iOS changed the title Add an optional SSR mode Add an optional sync loading mode Jul 30, 2026
@Alt-iOS

Alt-iOS commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author
Screen.Recording.mov

Here is a simple demo, in the first half of the video the data hasn't been loaded yet, those a flash of empty table/loading state appears. In the second half, the collection items were already loaded so even if the websocket hasn't fully mounted yet, the data is available

@sevenseacat

Copy link
Copy Markdown
Owner

Heya, thanks for this! I'm going to merge this PR as is, but rename the option before release - ssr is a bit misleading because its all server-side, it's more like initial_load={:sync}. Thank you ❤️

@sevenseacat
sevenseacat merged commit 4a9005d into sevenseacat:main Aug 26, 2026
1 check passed
@Alt-iOS

Alt-iOS commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Fair!! And thanks!!

sevenseacat added a commit that referenced this pull request Aug 26, 2026
`ssr` named the outcome rather than the mechanism — Cinder's HTML is
server-rendered either way, and what the flag changes is whether the data is in
that first render. The global default is now `default_initial_load`, and an
unrecognised mode warns instead of silently falling back.

Also reverts #203's change to first-load detection, which made a failed load
stick in its error state instead of retrying, for every collection rather than
just synchronous ones. A synchronous first load only needs to gate the
sync/async choice.
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