Repository navigation
fix(lynx): defer the application first screen until the engine's __RenderPage lifecycle - #419
Merged
leonidaz merged 1 commit intoJul 30, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Huxpro
added a commit
to Huxpro/octane
that referenced
this pull request
Jul 30, 2026
4 tasks done
This was referenced Aug 1, 2026
firstScreenRender: 'engine' renders a blank screen on Lynx for Web (hosts without __RenderPage)
#462
Closed
This branch was previously 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.
Summary
firstScreenRender: 'engine'mode that defers the one-shot first-screen render until the engine's__RenderPagelifecycle arrives, and use it in the Rspeedy application entry. This fixes adopted first-screen trees painting withoverflow: hiddensemantics on native — most visibly, offscreen<image>content that never appeared when transformed onscreen.Why
TemplateAssembler::LoadTemplateInternalrunsVMExecute → DidVMExecute (→ OnPageConfigDecoded → ElementManager::SetConfig) → RenderTemplate(lynx-family/lynx,core/renderer/template_assembler.cc; the numbered pipeline comment sits right aboveLoadTemplateInternal).ElementManager::GetDefaultOverflowVisible()returnsfalsewhileconfig_is unset (core/renderer/dom/element_manager.h).defaultOverflowVisibleabove all — and the created platform UIs clipped their children permanently. ReactLynx never hits this because it builds elements inside the engine-invokedrenderPage, afterDidVMExecute.display: linearcontainer withtranslateX, and every slide beyond the first rendered black — the subtree outside the container's own bounds was never displayed, and no later attribute/style/triggerLayout/element-replacement touch could recover it. A full main-thread PAPI call-sequence trace showed the adopted and background-mounted flows to be equivalent, isolating the divergence to evaluation-time element creation.Changes
main-thread.ts: new validatedfirstScreenRenderoption (defaultimmediate, preserving existing behavior for source and JavaScript-host tests). Inenginemode the render is captured and released by the engine's__RenderPagelifecycle (or, as a fallback on hosts without the typed lifecycle, by the first background ready request — both prove evaluation has finished).markFirstScreenSyncReadyno longer seals a window that is still waiting for the engine; an entry that finishes evaluation without rendering settles toskippedexactly as before. Unmount clears a pending deferred render.first-screen.ts: the host/rootrendercontract returnsnullwhen the render is deferred.main-thread-entry.js(@octanejs/rspeedy-plugin): the generated application receiver opts intofirstScreenRender: 'engine'.first-screen.test.ts: regression driving the mode through a mock engine context — nothing paints during evaluation or onmarkFirstScreenSyncReady, and dispatching__RenderPagepaints the tree and captures the first-tree snapshot.Validation
vitest run --project lynx— 23 files, 264 tests passedtsgo --noEmitforpackages/lynx/tsconfig.jsonandtsconfig.testing.jsonprettier --checkon changed filesRisk / follow-ups
immediateremains the default, so only the Rspeedy application graph changes behavior; all existing JS-host suites run unchanged.enginemode a host that never delivers__RenderPageand has no background falls back to never painting the first screen; the background-ready fallback covers every real transport we have.examples/swiper/README.md; that section should be updated to reference this fix once merged.Note
Medium Risk
Changes first-screen timing for the Rspeedy application entry only (
immediatestays default elsewhere), but incorrect release on unusual hosts could leave the first screen unpainted; core main-thread lifecycle and readiness paths are involved.Overview
Adds
firstScreenRender(immediate|engine, defaultimmediate) so the one-shot main-thread first screen can wait until native PageConfig is on the ElementManager. Inenginemode,root.render()queues work and returnsnull; the actual paint runs on__RenderPage(with a background main-ready fallback when that lifecycle is missing).markFirstScreenSyncReadyno longer closes the window while a deferred render is still pending; entries that finish evaluation without rendering still settle to skipped once release runs. Unmount clears any pending deferred render.The Rspeedy
main-thread-entryswitches tofirstScreenRender: 'engine', aligning first-screen element creation with ReactLynx-style timing and fixing cases where evaluation-time trees baked unconfigured overflow defaults (e.g. translated swiper slides painting black on device). Tests cover deferral through a mock engine context.Reviewed by Cursor Bugbot for commit 1f317e1. Bugbot is set up for automated code reviews on this repo. Configure here.