Repository navigation
Improve Wrapping React preview loading - #7658
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryThe PR delays the Spline preview until it approaches the viewport and the browser has idle time.
Reviews (4) · Last reviewed commit: "Number deferred demos per page instead o..." · Reviewed by Greptile |
Merging this PR will degrade performance by 4.57%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
Keep the 200px IntersectionObserver margin so deferred previews start loading just before they scroll in, and remember loaded demos by a stable per-page id so switching back from the Code tab remounts them without another idle wait. Merge the README defer docs into the existing section, use the public rx.NoSSRComponent in the Wrapping React example, and tighten the tests: assert the tab switch cancels a pending load, replace the renderSplineScene content check with a script-request count, and drop stale loadOnClick assertions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 9 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
The docs app builds with any reflex-site-shared that supports defer; the new loader is picked up from the workspace without a floor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Identical defer fences on one page shared an id, so loading one made the other skip its visibility and idle wait. Ids are now the page path plus the fence's position, which stays stable across renders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Wrapping React overview eagerly loads and mounts Spline's 3D scene while readers are still reading the introduction. Import Spline through
NoSSRComponentand defer the preview until it is visible and the browser has idle time. Readers still see the example automatically, and the Code tab remains available before it loads.Pending preview loads are canceled when readers scroll away or switch tabs. Browsers without idle callbacks use a timer fallback. This also improves the scheduling of existing deferred documentation demos.
Fixes ENG-13557.
Validation
pyright reflex testspassed. Regenerated stubs;pyi_hashes.jsonis unchanged.The full unit run reached 75.09% coverage. After rerunning sandbox-blocked tests with local socket/process access, 12,384 tests passed and five unrelated failures remained. All five also fail with the original sources:
test_typed_dict_helpers_resolve_lazy_annotationstest_compile_sends_telemetry_when_enabledtest_compile_reports_exception_and_reraisestest_compile_event_features_used_match_populated_apptest_compile_event_features_used_stable_across_hot_reloadSubmission checklist