Skip to content

Add a debug option to cheerpjInit, and document how to warm up a library VM - #52

Merged
Project516 merged 1 commit into
masterfrom
p516/browser-debug
Nov 5, 2026
Merged

Project516 merged 1 commit into
masterfrom
p516/browser-debug

Conversation

@Project516

Copy link
Copy Markdown
Owner

Pages can now see what a VM does with snapshots. cheerpjInit({ debug: true }) passes debug to every VM the worker starts, as --debug does under Node. VM events go to the console, among them whether a warm snapshot was saved, skipped as busy (with the reason) or restored, and why a restore missed. Before this a page had no way to tell, which is why frc-dev-wasm could not see why warm snapshots gave its IDE no gain.

The docs for warmSnapshot now also say how to use it. The image is reused only while every file the warm-up read is unchanged, so the first library calls should read fixed files, such as a compile of a small source that never changes. A first compile of the user's own project records that project's files and listings, so the image misses as soon as one of them changes, which is what happened in frc-dev-wasm's tests (each creates a new project).

Checks: pnpm typecheck passes. The change only threads one boolean through the init message.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 342251b2-5009-459e-ace9-c778a0293fa9
Commits

Reviewing files that changed from the base of the PR and between 468c0f3 and 2e27d2c.

Files selected for processing: 5

  • docs/browser.md
  • docs/node.md
  • src/browser/api.ts
  • src/browser/protocol.ts
  • src/browser/worker.ts
  • 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

@project516-review-bot project516-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds a debug option to cheerpjInit that threads a boolean through the init message to the worker, which passes it to each JVM instance. It also updates documentation for warmSnapshot to explain that the image is only reused while every file read during warm-up remains unchanged, and recommends warming up with fixed files (e.g., a small unchanging source) before the first real compile. The typecheck passes and the changes are minimal and consistent across the five modified files.


review-bot, model nvidia/nemotron-3-ultra-550b-a55b:free, verdict approve

@Project516
Project516 merged commit 4ec0fa6 into master Nov 5, 2026
9 checks passed
@Project516
Project516 deleted the p516/browser-debug branch November 5, 2026 19:19
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

⌂ Proxy