LearnNewsExamplesServices
Frontmatter
id9105
titleRefactor: DevRank Viewport Lazy Loading & Routing
stateClosed
labels
airefactoringperformance
assigneestobiu
createdAtFeb 11, 2026, 11:23 PM
updatedAtFeb 11, 2026, 11:58 PM
githubUrlhttps://github.com/neomjs/neo/issues/9105
authortobiu
commentsCount1
parentIssue8930
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 11, 2026, 11:58 PM

Refactor: DevRank Viewport Lazy Loading & Routing

Closed v12.0.0 airefactoringperformance
tobiu
tobiu commented on Feb 11, 2026, 11:23 PM

Refactor DevRank Viewport for lazy loading and better routing architecture.

Tasks:

  1. Create apps/devrank/view/home/MainContainer.mjs to encapsulate the Home view (Grid + Controls).
  2. Update apps/devrank/view/Viewport.mjs:
    • Use lazy loading (module: () => import(...)) for Home and Learn views.
    • Remove activeIndex: 0 to allow the controller to handle routing.
  3. Update apps/devrank/view/ViewportController.mjs:
    • Add defaultHash: '/home'.

Reason: To improve initial load time and align with the Portal architecture.

tobiu added the ai label on Feb 11, 2026, 11:23 PM
tobiu added the refactoring label on Feb 11, 2026, 11:23 PM
tobiu added the performance label on Feb 11, 2026, 11:23 PM
tobiu referenced in commit 0ee3597 - "Fix: Viewport activeIndex & TreeList store loading race condition (#9105)" on Feb 11, 2026, 11:57 PM
tobiu assigned to @tobiu on Feb 11, 2026, 11:58 PM
tobiu
tobiu Feb 11, 2026, 11:58 PM

Input from Gemini 3 Pro:

✦ I have successfully refactored the DevRank.view.Viewport for lazy loading and routing, and fixed a critical race condition in Neo.app.content.TreeList.

Changes:

  1. Lazy Loading: Created apps/devrank/view/home/MainContainer.mjs and updated Viewport.mjs to use module: () => import(...) for both Home and Learn views.
  2. Routing Fix: Set activeIndex: null in Viewport card layout and removed mainContentLayouts from ViewportController, allowing the controller to handle initial routing via defaultHash.
  3. Race Condition Fix (TreeList): Updated src/app/content/TreeList.mjs to:
    • Check for Neo.isFunction(this.store?.load) in doLoadStore to prevent crashes when the store is not yet initialized.
    • Trigger doLoadStore in afterSetStore if contentPath is already set, ensuring the store loads even if the path was set before the store binding completed.

This ensures robust initialization and prevents double loading in other app sections (like Portal Releases) by checking this.contentPath before auto-loading in afterSetStore.

tobiu added parent issue #8930 on Feb 11, 2026, 11:58 PM
tobiu closed this issue on Feb 11, 2026, 11:58 PM