Jump to content

Self-Hosted Playground! (Demo)


Dal
 Share

Recommended Posts

Hi guys,

As you may or may not know, a little while back, Microsoft released the full source code for Visual Studio Code under the MIT license.
The really cool thing about that is, VS Code is built on top of the Monaco code editor... the same editor that drives the Babylon.js playground.
That means we can finally start to use that awesome code editor in our own apps and Babylon tools!

There's not any documentation available for the editor at the moment, and the VS Code github already has a couple of issues open asking for it, but it's not yet materialized.

I decided to have a go at figuring it out myself, using the Typescript Playground and Babylon Playground for pointers. I managed to come up with this:

https://www.darrylryan.com/playground/

This does now mostly work - it can syntax highlight the typescript code, the intellisense autocomplete and type checking all works. I've also implemented a way to compile and run the code in the same way that the Typescript playground does it.

For now though I have a few problems I haven't solved:

- The gulp build task for the editor doesn't seem to build all the parts it needs. The loader tries to load other files too. I therefore had to rip some files from the full build of VS Code. This makes a bit of a mess and it ends up way bigger than it needs to be. I'm hoping there's a better build task for it that I've missed, or that there will be one soon as the VS Code team are working on it.

- The browser console lists a lot of warnings about duplicate file requires. I'm not sure how to solve that yet as I haven't figured out where they're coming from.

-  The BIG problem that I'm hoping @Deltakosh might be able to help with is that I really can't figure out how to load extra TypeScript definition files in such as the BABYLON framework. The method used in the BabylonJS Playground doesn't seem to work for me, the methods don't exist on the objects being called, so I guess the API has changed between the VS Code version and the one on Azure. 

 

The full source code (MIT license) is here if you want to dig around and help me out :) 
https://cloud.loudened.com/index.php/s/xYeeyYAsVVresJ2/download

 

Dal

 

 

Link to comment
Share on other sites

@RaananW My thing is just the editor ripped out. The full VS Code source is available now but it runs within Electron in order to have access to the file system... that stuff won't be possible from the browser. 

I'm planning to make a full Babylon IDE using this though, which will support saving to cloud storage and possibly browser local storage.

Link to comment
Share on other sites

On 21/1/2016 at 7:03 PM, Deltakosh said:

But my plan is to Open source the playground as soon as I can

Just to know, you think when put open source?

I am very interested to see how the intellisense system is realize for my editor. that of the playground is really great.

Thank you DK, looking forward.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...