Code-Runner-Web-Component icon indicating copy to clipboard operation
Code-Runner-Web-Component copied to clipboard

[Feature Request]: Support for nodejs and add html and css to javascript

Open bsde1234 opened this issue 1 year ago • 9 comments

Hi, Thanks for making this project. Please add support for nodejs. Also please add html and css support to javascript addon so that html, css and javascript can be used in one.

bsde1234 avatar Nov 13 '22 17:11 bsde1234

@bsde1234 - you are more than welcome! :)

First thing is first -

I do believe Node.js can be executed via the Piston API by using the language javascript

Please report results to me on this.

Second thing -

I am actually in the progress of adding features to implement addons / plugins - so other compilers & more can be added.

That said - I have not found a good compiler that is capable of handling HTML / CSS / JS in a sandboxed iframe environment. If you could recommend one - I could look at possibly taking a jab at this.

Though - if you are willing to provide some CSS that can be easily applied & as well tab functionality to help speed this feature request by chance (it would be more than appreciated) or even willing to create a plugin for this yourself - it would be more than appreciated to have some contributors on this projects, to help with creating plugins like this!

If you can't help with the second request, you might have to wait awhile for me or someone else to implement this feature!

Thank you for your support as well to the repo! :+1:

ps: feel free to share with your friends etc to help the project grow!

MarketingPip avatar Nov 13 '22 19:11 MarketingPip

For javascript it gives error for following code console.log('Current version: ' + process.version); like

[0m[1m[31merror[0m: Uncaught ReferenceError: process is not defined console.log('Current version: ' + process.version); [0m[31m ^[0m at [0m[36mfile:///piston/jobs/168b0392-f191-4900-b784-8897482edfe9/file0.code[0m:[0m

Actually I am not an advanced developer to give a pull request. I will wait to someone will do that for you.

Thanks.

bsde1234 avatar Nov 13 '22 19:11 bsde1234

More than understandable!

Well in the mean time - please be sure to :star: the repo to show your continued support!

As for the Node.JS - pretty sure Node.JS is running fine - just the modules are not exposed to you properly. - I am not a Node.JS developer tho so hoping someone else can chime in here.

MarketingPip avatar Nov 14 '22 02:11 MarketingPip

https://github.com/codevaam/html-js-compiler

bsde1234 avatar Nov 26 '22 07:11 bsde1234

@bsde1234 I have actually been working on this. Lost a lot of work tho due to my computer crashing .-. but, keep a eye out!

Here is a sneak peak!

image

Keep in mind as well - you have no idea how much sending resources like that help me save time so thank you very much. :smile:

ps; I seen you were wanting a PHP compiler + this way back on another repo. I will add a PHP compiler asap. But please again bare with me as my computer is literally old as a dinosaur. (Donations are more than welcome haha!)

MarketingPip avatar Nov 26 '22 08:11 MarketingPip

Image looks nice. In your readme there is php in supported language. Don't you actually support it?

bsde1234 avatar Nov 26 '22 08:11 bsde1234

Image looks nice. In your readme there is php in supported language. Don't you actually support it?

Correct the current Web Component does support PHP but it is rendered via API and not client side. Adding a PHP compiler client side will allow for more REAL / TRUE like PHP compiling in the browser. :+1:

ps; updated the demo to show PHP is currently supported + you can browse all the other supported languages / demo them! :+1:

MarketingPip avatar Nov 26 '22 09:11 MarketingPip

Thanks for the info. You will get more client side compiler at https://github.com/lyricat/code-knack

bsde1234 avatar Nov 26 '22 10:11 bsde1234

Hey @bsde1234,

Sorry for delay on this! I will try to make some updates regarding the HTML, CSS & JS playground ASAP.

That said you are good to go and use Node.js in the latest version! Just set the language attribute to node-js.

Other than that, I hope your doing well. ✌️

ps; I will hopefully wrap up the request of adding the HTML, CSS & JS support in this library or maybe even another etc! Tho I will keep you posted!

MarketingPip avatar May 04 '23 01:05 MarketingPip