Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 3, 2026

Add js plugin with eval command using rquickjs

Summary

Adds a new Tauri plugin js that exposes a single eval command for evaluating JavaScript code using the rquickjs library. The plugin follows the existing plugin conventions (modeled after analytics plugin) and includes TypeScript bindings generated via tauri-specta.

The eval command accepts a JavaScript code string and returns the stringified result. It handles various JS types (undefined, null, bool, int, float, string) and falls back to JSON.stringify for complex objects.

Review & Testing Checklist for Human

  • Security review: The eval command executes arbitrary JavaScript code. Verify this is acceptable for your use case and that the permission model (js:default includes allow-eval) is appropriate.

  • Test end-to-end: Run the desktop app and test that commands.eval("1 + 2") returns "3" from the frontend.

  • Performance consideration: Each eval call creates a new QuickJS runtime. If you plan to make many eval calls, consider whether this overhead is acceptable or if runtime reuse should be implemented.

Recommended test plan:

  1. Run the desktop app with ONBOARDING=0 pnpm -F desktop tauri dev
  2. In the browser console, test: await window.__TAURI__.invoke('plugin:js|eval', { code: '1 + 2' })
  3. Verify the result is "3"

Notes

  • Uses rquickjs v0.11.0 (note: v0.10.0 is used elsewhere in the codebase by tauri-plugin-tracing)
  • There's a compiler warning about unused manager field in the Js struct - this is benign but could be cleaned up
  • Local end-to-end testing was not completed due to build environment issues; CI should verify compilation
  • Requested by: yujonglee (@yujonglee)
  • Devin session: https://app.devin.ai/sessions/85ba93e0eb804553913ffb5e3a492b4e

Updates since last revision

  • Added .plugin(tauri_plugin_js::init()) to desktop app initialization in apps/desktop/src-tauri/src/lib.rs - the plugin is now fully integrated

@netlify
Copy link

netlify bot commented Jan 3, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit 7bb15de
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6958d1b220f4f3000816bfc2

@netlify
Copy link

netlify bot commented Jan 3, 2026

Deploy Preview for howto-fix-macos-audio-selection ready!

Name Link
🔨 Latest commit 7bb15de
🔍 Latest deploy log https://app.netlify.com/projects/howto-fix-macos-audio-selection/deploys/6958d1b256d9740008ca8992
😎 Deploy Preview https://deploy-preview-2753--howto-fix-macos-audio-selection.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Jan 3, 2026

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 7bb15de
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6958d1b235b38b0008f98db7
😎 Deploy Preview https://deploy-preview-2753--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@yujonglee yujonglee merged commit b72a937 into main Jan 3, 2026
26 of 27 checks passed
@yujonglee yujonglee deleted the devin/1767427549-add-js-plugin branch January 3, 2026 08:43
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