Web IDE & CodeSandbox
This enables JavaScripts projects to have live previews straight in the browser without requiring any local configuration. This uses the CodeSandbox package `sandpack` to compile it all inside of an iframe. This feature is off by default and can be toggled on in the admin settings. Only projects with a `package.json` and a `main` key are supported. Updates happen in real-time with hot-reloading. We just watch for changes to files and then send them to `sandpack` to allow it to reload the iframe. The iframe includes a very simple navigation bar, the text bar is `readonly` to stop users navigating away from the preview and the back and forward buttons just pop/splice the navigation stack which is tracked by a listener on `sandpack` There is a button inside the iframe which allows the user to open the projects inside of CodeSandbox. This button is only visible on **public** projects. On private or internal projects this button get hidden to protect private code being leaked into an external public URL. Closes #47268
Showing
... | ... | @@ -34,6 +34,7 @@ |
"chart.js": "1.0.2", | ||
"classlist-polyfill": "^1.2.0", | ||
"clipboard": "^1.7.1", | ||
"codesandbox-api": "^0.0.18", | ||
"compression-webpack-plugin": "^1.1.11", | ||
"core-js": "^2.4.1", | ||
"cropper": "^2.3.0", | ||
... | ... | @@ -80,6 +81,7 @@ |
"sanitize-html": "^1.16.1", | ||
"select2": "3.5.2-browserify", | ||
"sha1": "^1.1.1", | ||
"smooshpack": "^0.0.48", | ||
"sortablejs": "^1.7.0", | ||
"sql.js": "^0.4.0", | ||
"stickyfilljs": "^2.0.5", | ||
... | ... |
Please register or sign in to comment