Skip to content

Conversation

@ShiboSoftwareDev
Copy link
Contributor

@ShiboSoftwareDev ShiboSoftwareDev commented Oct 25, 2025

This introduces dynamic, on-demand loading for the ngspice engine and configures it as the default SPICE simulation engine.

The loading mechanism first attempts a local dynamic import(). If this fails (e.g., in a browser), it falls back to fetching the engine from the jsDelivr CDN. This ensures ngspice is available in both Node.js and browser environments without impacting initial load times.

A Playwright test has been added to verify the CDN fallback functionality in a browser.

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

Is it possible to put ngspice in the default platform config? Or does something break with webworkers? It can be default available

@ShiboSoftwareDev ShiboSoftwareDev changed the title test: Add tests for dynamic ngspice engine loading feat: Dynamically load ngspice engine with CDN fallback Oct 26, 2025
Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

nice

@ShiboSoftwareDev ShiboSoftwareDev merged commit 68cec43 into tscircuit:main Oct 26, 2025
29 of 46 checks passed
@tscircuitbot
Copy link
Contributor

Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


Comment posted by tscircuitbot

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.

3 participants