codesandbox-client icon indicating copy to clipboard operation
codesandbox-client copied to clipboard

Integrated console

Open CompuIves opened this issue 9 years ago • 26 comments

A console you can expand from the editor pane, should work both in embed view and editor view.

screen shot 2017-06-07 at 13 33 53

CompuIves avatar Jun 07 '17 11:06 CompuIves

This will be integrated using a custom renderer, issue is here: https://github.com/CompuIves/codesandbox-client/issues/31

CompuIves avatar Jul 03 '17 14:07 CompuIves

Decided that this will not be done by the custom renderer, this functionality is global. Also I think that it should be on the right side (under the preview), since this console is used for preview.

CompuIves avatar Sep 27 '17 11:09 CompuIves

I'd like to help if possible. Do you already have an idea of how this should this be done? In which context should this console execute?

renanpvaz avatar Oct 03 '17 13:10 renanpvaz

@renanpvaz Do you want to take this? I already started playing with it, only got some layout going so far, no functionality. Let me know, so we don't both work on the same feature. :smile:

lbogdan avatar Oct 04 '17 20:10 lbogdan

@lbogdan oh don't mind me, if you've started it then keep it up.

renanpvaz avatar Oct 04 '17 21:10 renanpvaz

+1 Yes please!

Hum4n01d avatar Oct 11 '17 23:10 Hum4n01d

is someone still working on this? If any help needed would love to contribute :)

varenya avatar Oct 26 '17 06:10 varenya

@varenya You can find the work so far here https://github.com/lbogdan/codesandbox-client/tree/feature/preview-console, if you want to take a look.

lbogdan avatar Oct 26 '17 08:10 lbogdan

sure thanks, should I fork this branch repo to contribute? is any help needed :)?

varenya avatar Oct 26 '17 08:10 varenya

@CompuIves did you manage to do anything about this? I, for one, was a bit busy with life these last couple of weeks. :disappointed:

lbogdan avatar Oct 26 '17 08:10 lbogdan

Ooh, I hope nothing bad! @lbogdan built an implementation, I need to check it out. I've been a bit busy as well, but I'm going to check and work on it tomorrow 😃

On Thu, Oct 26, 2017, 10:53 lbogdan [email protected] wrote:

@CompuIves https://github.com/compuives did you manage to do anything about this? I, for one, was a bit busy with life these last couple of weeks. 😞

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/CompuIves/codesandbox-client/issues/18#issuecomment-339597940, or mute the thread https://github.com/notifications/unsubscribe-auth/AAj1CBrQylxA8yUx-3a-1DGK8FNKh74nks5swEiIgaJpZM4Nyk1t .

CompuIves avatar Oct 26 '17 09:10 CompuIves

@lbogdan you have used react-console here and it looks to be working what else is pending here? @CompuIves any inputs let me know I can help.

varenya avatar Oct 26 '17 09:10 varenya

Great to hear that it works! There are 2 things pending (I think):

  1. Bit of styling, I want to play with this a bit
  2. Right now the console executes code in the editor environment. I think we should execute it in the sandbox environment so you can inspect eg. window vars. So we should send a postMessage to the sandbox, execute it there and postMessage back to the console what to show. Are you interesting in working on this?

On Thu, Oct 26, 2017, 11:45 Varenya Thyagaraj [email protected] wrote:

@lbogdan https://github.com/lbogdan you have used react-console here and it looks to be working what else is pending here? @CompuIves https://github.com/compuives any inputs let me know I can help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CompuIves/codesandbox-client/issues/18#issuecomment-339612223, or mute the thread https://github.com/notifications/unsubscribe-auth/AAj1CEZB9RUwAsCv8zQOPC-VsjRYOQbGks5swFTIgaJpZM4Nyk1t .

CompuIves avatar Oct 26 '17 10:10 CompuIves

No, I just checked he's doing it in Preview/index.js, basically what you just said postMessage and then switching based on the type and logging it on the react-console.

varenya avatar Oct 26 '17 10:10 varenya

Oh that's great!! Didn't know @lbogdan already finished that. Then the only thing left is styling really, I'll can finish that tomorrow then.

On Thu, Oct 26, 2017, 12:28 Varenya Thyagaraj [email protected] wrote:

No, I just checked he's doing it in Preview/index.js, basically what you just said postMessage and then switching based on the type and logging it on the react-console.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CompuIves/codesandbox-client/issues/18#issuecomment-339622872, or mute the thread https://github.com/notifications/unsubscribe-auth/AAj1CHuQRkCZm1EZZ4u0RnpVb5-NLC73ks5swF7lgaJpZM4Nyk1t .

CompuIves avatar Oct 26 '17 10:10 CompuIves

@CompuIves Unfortunately I didn't, the eval part is not done yet. For this we should also change react-console, which is currently doing the eval internally. So 2. is still pending.

lbogdan avatar Oct 26 '17 10:10 lbogdan

@lbogdan what do you mean by eval? but the flow is as @CompuIves mentioned right i.e. postMessage etc..

varenya avatar Oct 26 '17 11:10 varenya

I mean when you write something in the console and it evals and displays it: In this example, it should evaluate it in the sandbox preview context and show href: "http://localhost:3001/".

lbogdan avatar Oct 26 '17 11:10 lbogdan

hmm understood but any ideas how to go abt it?

varenya avatar Oct 26 '17 14:10 varenya

You could look at the applicable JSBin code; they do it quite nicely

Hum4n01d avatar Oct 26 '17 14:10 Hum4n01d