♻️ Refactor static site SDK to use functional tab pool + work queue#150
Merged
♻️ Refactor static site SDK to use functional tab pool + work queue#150
Conversation
- Add functional tab pool (pool.js) using closures for tab management - Add task-based processing (tasks.js) with dependency injection - Replace page-level concurrency with task-level (page×viewport) - Migrate from Vitest to Node native test runner - Rename all .spec.js to .test.js - Remove vitest dependency - Add tests for viewport helpers and pattern edge cases Key improvements: - True tab control: concurrency now means "max tabs" not "max pages" - Tab reuse: no create/destroy overhead per screenshot - Even work distribution: tasks processed as capacity allows - Functional: no classes, just functions and closures Coverage: 81.89% lines, 91.81% branches, 73.44% functions
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
- Fix concurrency test to import mapWithConcurrency from tasks.js - Export mapWithConcurrency and add proper JSDoc documentation - Document pool drain() null behavior in acquire() JSDoc - Add tab cleanup (resetTab) before release to prevent cross-contamination - Add debug logging to isTddModeAvailable for troubleshooting - Fix mapWithConcurrency error propagation through Promise.all - Update pool tests for async release() method
Contributor
|
Found 4 test failures on Blacksmith runners: Failures
|
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.
Summary
pool.js) using closures for browser tab managementtasks.js) with dependency injection for testability.spec.jsto.test.jsformatViewport,setViewport,getCommonViewports)Key Architecture Changes
Before: Page-level concurrency where each page processed viewports sequentially
After: Task-level concurrency where each (page, viewport) tuple is an independent task
Benefits:
Coverage
Test plan