Skip to content

fix(runtime): pump messages during HTTP imports until dev boot completes - #48

Merged
triniwiz merged 1 commit into
mainfrom
fix/dev-boot-pump
Nov 8, 2026
Merged

triniwiz merged 1 commit into
mainfrom
fix/dev-boot-pump

Conversation

@triniwiz

@triniwiz triniwiz commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

A dev boot imports the app graph from the dev server with blocking fetches on the UI thread. On a cold dev server that can take several seconds, and Windows marks the window as not responding.

In debug builds, until @nativescript/vite signals boot completion, esm_http::fetch_module and fetch_modules run the fetch on a helper thread:

  • The helper signals an event when the fetch completes.
  • Meanwhile the UI thread waits in MsgWaitForMultipleObjectsEx(..., QS_ALLINPUT, MWMO_INPUTAVAILABLE) and dispatches messages as they arrive.

Other changes:

  • ns:module gains setDevBootComplete(done), which @nativescript/vite already calls once the app root is committed.
  • It's backed by __nsModuleSetDevBootComplete, registered for the classic engine, the napi engine module runner and windows-v8.
  • Release builds and imports after boot are unchanged.
  • A thread-local guard stops a nested import from pumping again.

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: aea8cc08-31f6-46ba-ad1b-67e8b0e4e971

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A dev boot imports the app graph from the dev server with blocking fetches
on the UI thread. On a cold server that takes seconds and the window stops
responding. In debug builds, until ns:module setDevBootComplete(true), run
the fetches on a helper thread that signals an event when done, while the
UI thread waits in MsgWaitForMultipleObjectsEx and dispatches messages as
they arrive. setDevBootComplete is exposed on ns:module for the classic and
Node-API engines.
@triniwiz
triniwiz merged commit 6db2428 into main Nov 8, 2026
3 checks passed
@triniwiz
triniwiz deleted the fix/dev-boot-pump branch November 8, 2026 20:39
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.

1 participant