Add subdomain for Codesandbox bundler
We are integrating Codesandbox with the Web IDE to enable client evaluation of Javascript projects https://gitlab.com/gitlab-org/gitlab-ce/issues/47268.
Codesandbox consists of three two components:
- transpiler: https://github.com/CompuIves/codesandbox-client/tree/master/packages/sandpack
- bundler: https://github.com/CompuIves/codesandbox-client/blob/master/packages/app/src/sandbox/index.js
-
packager: https://github.com/codesandbox-app/dependency-packagerthe bundler is now able to resolve the dependency tree in the browser and request dependencies directly from https://unpkg.com/
The transpiler passes the source code of the project to the bundler which is running in an iframe
on a different domain to prevent cookies being leaked. The bundler requests the required npm dependencies from the packager calculates the dependency tree and downloads the dependencies to the browser from https://unpkg.com/.
The bundler should be served from a different subdomain to the GitLab application to prevent cookies being leaked from GitLab to the codesandbox.
Proposal
- Add support for the bundler to be served on a subdomain to the GitLab instance.
Links
https://github.com/CompuIves/codesandbox-client/blob/master/packages/app/src/sandbox/index.js