Fold entry-point detection and RALE/RDB injection into the single staging walk - #389
Open
TwitchBronBron wants to merge 1 commit into
Open
Fold entry-point detection and RALE/RDB injection into the single staging walk#389TwitchBronBron wants to merge 1 commit into
TwitchBronBron wants to merge 1 commit into
Conversation
…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>
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.
Fixes #341.
On telnet launches against a large staging dir,
findEntryPointran six sequential full-treefind-in-filessearches over every.brsfile, hanging the launch for 60–80s. We already walk every staged file once inpreprocessStagingFiles, so this moves that work into that walk instead.findEntryPointand drop thefind-in-filesdependency. Entry point is now found during the staging walk via a single combined regex and stored onProject.entryPoint;registerEntryBreakpointreads that.replace-in-filetree walks into the same walk. EachcopyAndTransform*splits into a copy step (before the walk) and aninjectEntryCommenttransform (during it).fixSourceMapCommentno longer writes the file itself — it returns the new contents, so sourcemap fixes and RALE/RDB injection share a single write per file.