Skip to content

Fold entry-point detection and RALE/RDB injection into the single staging walk - #389

Open
TwitchBronBron wants to merge 1 commit into
masterfrom
remove-find-in-files-fold-into-staging-walk
Open

Fold entry-point detection and RALE/RDB injection into the single staging walk#389
TwitchBronBron wants to merge 1 commit into
masterfrom
remove-find-in-files-fold-into-staging-walk

Conversation

@TwitchBronBron

@TwitchBronBron TwitchBronBron commented Jul 16, 2026

Copy link
Copy Markdown
Member

Fixes #341.

On telnet launches against a large staging dir, findEntryPoint ran six sequential full-tree find-in-files searches over every .brs file, hanging the launch for 60–80s. We already walk every staged file once in preprocessStagingFiles, so this moves that work into that walk instead.

  • Delete findEntryPoint and drop the find-in-files dependency. Entry point is now found during the staging walk via a single combined regex and stored on Project.entryPoint; registerEntryBreakpoint reads that.
  • Fold the two RALE/RDB replace-in-file tree walks into the same walk. Each copyAndTransform* splits into a copy step (before the walk) and an injectEntryComment transform (during it).
  • fixSourceMapComment no longer writes the file itself — it returns the new contents, so sourcemap fixes and RALE/RDB injection share a single write per file.

…ging walk

Fixes the telnet-launch hang from #341, where fileUtils.findEntryPoint ran six
sequential full-tree find-in-files searches over every .brs file (60-80s on large
staging dirs).

- Remove findEntryPoint and the find-in-files dependency entirely. Entry-point
  detection now happens inside the existing preprocessStagingFiles walk via a single
  combined regex, storing the result on Project.entryPoint. registerEntryBreakpoint
  reads that instead of re-scanning the tree.
- Fold the two RALE/RDB replace-in-file tree walks into the same staging walk. The
  copyAndTransform* methods are split into a copy step (run before the walk) and a
  pure injectEntryComment transform (run during the walk). fixSourceMapComment is now
  a pure transform so source-map fixes and RALE/RDB injection combine into one write
  per file.
- Add unit coverage: entry-point detection, registerEntryBreakpoint, walk-based
  RALE/RDB injection, and the combined injection + sourceMappingURL rewrite in a
  single pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

findEntryPoint can take 60+ seconds on large staging dirs (telnet launch hang)

1 participant