daily-code icon indicating copy to clipboard operation
daily-code copied to clipboard

Add code execution functionality to CodeRunner component

Open TanmayDhobale opened this issue 1 year ago • 1 comments

Description: This pull request adds code execution functionality to the CodeRunner component.

Changes Made:

Added state variables for code, language, output, and error.

Implemented event handlers for code and language changes.

Implemented the runCode function to execute the provided code using the node-sandbox library.

Displayed the output and error messages in the component UI. This pull request enhances the CodeRunner component by enabling users to execute code snippets in different languages directly within the application

https://github.com/code100x/daily-code/assets/89733575/7ae5046d-249f-4767-9962-def897736bfd

TanmayDhobale avatar Apr 10 '24 09:04 TanmayDhobale

https://github.com/code100x/daily-code/assets/89733575/1274bea9-83de-4a4b-8645-060a465e45c0

TanmayDhobale avatar Apr 10 '24 10:04 TanmayDhobale

  1. hmm so we already have a decent UI for this
  2. We probably dont want to use node-sandbox but create a more generic execution engine (see judge0)

Closing for now , feel free to re-open

hkirat avatar Apr 11 '24 13:04 hkirat