v2.0.0-rc.9
Pre-release
Pre-release
·
97 commits
to main
since this release
π DOCS
You can find the 2.0.0 RC docs at: https://fsnpxp-3000.csb.app/sdk
rc.8 release!
ποΈ Infra
- Fixed an issue with scheduling from our Universal Template
π¨ Breaking (typing)
Finding the correct terminology is always difficult, but we will keep iterating until we get it right:
// This is still considered a Sandbox and represents methods for interacting
// with the Sandbox VM. (type: Sandbox)
const sandbox = await sdk.sandboxes.resume('some-id')
// A session is explicitly creating a session (type: SandboxSession)
const session = await sandbox.createSession()
// There are now 3 ways of creating a CLIENT (type: SandboxClient):
// 1. Browser
import { connectToSandbox } from '@codesandbox/sdk/browser'
const client = await connectToSandbox(...)
// 2. Other Node environment
import { connectToSandbox } from '@codesandbox/sdk/node'
const client = await connectToSandbox(...)
// 3. Or connect in the same environment as the SDK
const sandbox = await sdk.sandboxes.resume('some-id')
// "Connect" creates both session and client for convenience
const client = await sandbox.connect(...)β οΈ Deprecations
createBrowserSessionis renamed tocreateSessionas you can now connect to the Sandbox from both browser and node clients separate from your server and the SDKsdk.sandboxes.forkis deprecated because it introduces yet another term to creating Sandboxes. Usecreatewith anidto create a Sandbox
π Features
- You can now import
connectToSandboxfrom@codesandbox/sdk/nodeto connect to a Sandbox from other Node environment separate from your server where SDK is used, like react-native @codesandbox/pitcher-protocolis now removed as dependency and the types are moved to the SDK. Removing license dependency as well.@codesandbox/pitcher-clientis still bundled into the browser client, but this will shortly be removed as well- When using an
envoption in the session we now write a~/.private/.envfile which is sourced on all terminals and commands created. This ensures we do not pass any private data from your server to clients connecting to the Sandbox - We are now passing the SDK version on the UserAgent of API requests, improving our ability to debug any issues
π Fixes
wsdependency is now replaced withisomorphic-wsto support Node-ish environments- Due to a typo there was a misunderstanding on the special private folder for user sessions. The folder name is
~/.private, NOT~/private. This is now properly used for handling git and env variables - All requests from SDK now has 2min timeout, like the rest of our request flow in the API and infra
- When using a Together.ai Api Key it is now properly handled by the CLI