Repository navigation
Conversation
A provider renders its slot only once its own instance is available, so
providers nested inside each other load one after another: the inner one
is not created until the outer one has loaded.
DataclassCore.prefetch(ids) starts every id loading at once, each over its
whole graph, and resolves to [{ id, ready, error }] once all have settled.
It reuses fetchInstanceRecursive, so every request is shared with the
providers and nothing is fetched twice. The Vue component
trame-dataclass-prefetch and the dataclass.Prefetch widget wrap it. The
slot always renders; each provider still waits for its own data.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 28, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #14. #15 already covers that PR's other two commits: the shared definition request, and a provider waiting for its whole graph. This PR keeps only
prefetch, rebuilt on the sharedclient-core.Problem
A
Providerrenders its slot only once its own instance is available. When providers are nested, the inner one is not created until the outer one has loaded, so a page of N nested providers loads them one after another. #15 parallelizes loading within one provider's graph, but independent nested providers still form a chain.Change
DataclassCore.prefetch(ids)(client-core, so both clients have it) starts every id loading at once, each over its whole graph throughfetchInstanceRecursive. It resolves to[{ id, ready, error }]once all have settled.allSettled, so one unknown or failing id does not fail the rest.trame-dataclass-prefetch(Vue) anddataclass.Prefetch(Python) wrap it.client_type="react", which has no component yet. React code can callprefetchon its manager directly.Measured on current
mainexamples/getting_started/prefetch.py: 20 nested providers, with--serialfor the same page without the wrapper. Headless Chromium, median of 5 loads, from navigation to the innermost provider's text. Latency was added with a TCP relay delaying each direction by 20 ms.PrefetchPrefetchTests
client-core/tests/prefetch.test.js(4 cases): one wave for all ids; children of a container loaded; an id already loading or loaded not fetched again; an unknown id reported without failing the rest. client-core: 27 passed.tests/test_widgets_prefetch.py(5 cases): list → bound array literal; tuple stays a binding; no ids → no prop; unsafe id refused; React refused.vue-components: builds; 11 passed.🤖 Generated with Claude Code