v2.0.0-rc.8
Pre-release
Pre-release
·
99 commits
to main
since this release
📝 DOCS
You can find the 2.0.0 RC docs at: https://fsnpxp-3000.csb.app/sdk
🚨 Breaking
- The server side SDK and the browser side SDK is now decoupled. Now Node has a much smaller dependency graph and will by default be compatible with edge environments. This did result in certain methods, like
commands.getAllandterminals.getAllto become async - The concept of "sources" is removed. To clone a repository you now create a Sandbox as normal and then use
session.git.cloneto clone a repository. This is partially related to the complexity of managing git credentials, but also setting a path to give your more lower level programmatic tools as opposed to high level declarative and constrained options
🚀 Features
- You can now pass
--aliaswhen building your template to point an alias to the generated template id. The alias is in the format ofnamespace@tag, where it will by default use the template folder as namespace or you can explicitly pass the full alias
npx @codesandbox/sdk build ./my-template --alias latest
my-template@latest now points to the generated template id- You can now use git with credentials. You still assign these credentials to
sandbox.connect({ id, git })orsandbox.createBrowserSession({ id, git ), but there are some additional options.⚠️ You have to use the latest version of our Sandbox Agent for this to work. Make sure to update your templates etc. - When building a template where one Sandbox fails you can now manually verify the Sandbox before continuing to create snapshots and template id

- A new CLI flag called
--cican be sent to prevent the interactive fallback from firing and rather give you a template id, but showing the Sandbox that errored - The CLI can now run without a command, which opens up a starting point for our interactive CLI. Currently it allows you to open a Sandbox, see its running status and change it (See image below)
🐛 Fixes
- Restarting a Sandbox now has a retry mechanism in case of race conditions
- When building templates we now have a 2 min timeout, instead of 30 sec, on starting Sandboxes. This is what the rest of the flow in our infra is configured to. There are edge cases where starting a Sandbox can take more than 30 sec and the "Bad Gateway" error should be gone
- Certain processes exposing ports are not assigned to the related task. This has been fixed, given that you configure the port on your task in
tasks.json

