Skip to content

refactor: convert sequential.js to TypeScript#770

Merged
Nihal4777 merged 2 commits intoCircuitVerse:mainfrom
pantha704:js-to-ts-sequential#661
Jan 14, 2026
Merged

refactor: convert sequential.js to TypeScript#770
Nihal4777 merged 2 commits intoCircuitVerse:mainfrom
pantha704:js-to-ts-sequential#661

Conversation

@pantha704
Copy link
Contributor

@pantha704 pantha704 commented Jan 11, 2026

Part of #661 (partial - 1 file per PR rule)

Changes

Converted src/simulator/src/sequential.js to TypeScript:

Before After
sequential.js sequential.ts

TypeScript Improvements

// Added type annotations
export function changeClockEnable(val: boolean): void {
    simulationArea.clockEnabled = val
}

No Logic Changes

  • ✅ Same exported function: changeClockEnable
  • ✅ Same behavior, only added type safety
  • ✅ Imports work (circuit.ts, testbench.ts)

Testing

  • ✅ Build passes (bun run build)
  • ✅ All existing imports resolve correctly

Code Understanding and AI Usage

  • I have reviewed every single line of the changes
  • I can explain the purpose of each type annotation
  • No logic was changed, only types added

Summary by CodeRabbit

  • Refactor

    • Improved type safety and updated documentation for simulator clock controls, enhancing reliability and code clarity.
  • Chores

    • No user-facing changes; internal quality improvements only.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 11, 2026

Walkthrough

The change updates src/simulator/src/sequential.ts: the changeClockEnable function signature was changed to export function changeClockEnable(val: boolean): void, a JSDoc @param val - boolean value to enable/disable clock was added, and an unused import of scheduleUpdate, play, and updateCanvasSet from ./engine was removed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: converting sequential.js to TypeScript with type annotations and file rename.
Linked Issues check ✅ Passed The PR meets all coding requirements from issue #661 [661]: converts one JS file to TS, adds type annotations, maintains logic, and includes manual review.
Out of Scope Changes check ✅ Passed All changes are in-scope: TypeScript conversion of sequential.ts with type annotations. Changes to v1/src path align with the stated conversion objective.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@netlify
Copy link

netlify bot commented Jan 11, 2026

Deploy Preview for circuitverse ready!

Name Link
🔨 Latest commit 6711b71
🔍 Latest deploy log https://app.netlify.com/projects/circuitverse/deploys/696763d9f5f0ec0008dc38b4
😎 Deploy Preview https://deploy-preview-770--circuitverse.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 43 (🟢 up 9 from production)
Accessibility: 73 (no change from production)
Best Practices: 92 (no change from production)
SEO: 82 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Fixes CircuitVerse#661 (partial - 1 file)

- Renamed sequential.js to sequential.ts
- Added TypeScript type annotation to changeClockEnable parameter (val: boolean)
- Added return type annotation (void)
- No logic changes, only type safety improvements
@pantha704 pantha704 force-pushed the js-to-ts-sequential#661 branch from cd0379f to d9fd4af Compare January 12, 2026 03:35
Copy link
Member

@Nihal4777 Nihal4777 left a comment

Choose a reason for hiding this comment

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

@pantha704 Just apply the changes in v1 as well.

@pantha704 pantha704 force-pushed the js-to-ts-sequential#661 branch from bff5598 to 6711b71 Compare January 14, 2026 09:37
@pantha704
Copy link
Contributor Author

Done sir ! @Nihal4777
added the same TypeScript changes to v1/src

@pantha704 pantha704 requested a review from Nihal4777 January 14, 2026 09:42
Copy link
Member

@Nihal4777 Nihal4777 left a comment

Choose a reason for hiding this comment

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

Thanks @pantha704!

@Nihal4777 Nihal4777 merged commit 32938ca into CircuitVerse:main Jan 14, 2026
5 checks passed
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.

2 participants