Skip to content

Instantly share code, notes, and snippets.

Technical Specifications: "Pint" Sandbox Type with Feature Flag Support

Overview

This specification outlines the implementation of a new sandbox type called "pint" in the CodeSandbox platform. The feature enables passing a feature flag from the CodeSandbox SDK through the server to the pitcher-manager during sandbox creation and VM startup processes.

Technical Requirements

Core Requirements

  • Add support for a new sandbox type identifier: "pint"

RFC: Rethinking Hibernation and Persistence in @codesandbox/sdk

1. History of Hibernation and Persistence

At CodeSandbox, we built a product where users could treat their sandboxes like cloud-based laptops. When a user stepped away from a project, the sandbox would automatically hibernate after a period of inactivity. Upon resuming, the sandbox would restore to its exact previous state — both in memory and persistence — almost instantly.

Given that most sandboxes were small, short-lived projects, we introduced an automatic archiving mechanism. After 7 days of inactivity, a sandbox would be archived. This system allowed us to manage persistence without requiring user intervention. It was opinionated, reliable, and tailored to a single use case that worked well at our scale.

Additionally, the CodeSandbox product introduced a feature called Live Forking. This allowed users to instantly fork a running sandbox they were viewing, with the new sandbox sharing memory from the original. This enabled seaml

@christianalfoni
christianalfoni / 1_original.tsx
Last active March 24, 2025 10:52
Refactor of component using constructor pattern and state machine
import {
Alert,
Button,
Card,
CardBanner,
CardBody,
CardHeader,
HStack,
VStack,
} from '@client/component-library'
import {
Alert,
Button,
Card,
CardBanner,
CardBody,
CardHeader,
HStack,
VStack,
} from "@client/component-library";

vue-productivity

Install

Only use @vitejs/plugin-vue-jsx in vite.config.ts.

Add to tsconfig.json

"compilerOptions": {

@codesandbox/context

A more powerful createContext API for React

Install

npm install @codesandbox/context

Maintainer needed

I have gotten to a point now where I realize my open source work is not sustainable in combination with family. I have spent a ton of time over the years developing ideas, learning, sharing and engaging with the open source community. It has been a lot of fun, but also exhausting. There is a dark side to doing open source, at least for me. Even though it is a recipe for learning I have also been spending most of my time lost in thought. Thinking about ideas, issues and craving recognition for the stuff that I share. It is not a healthy way to live your life. The cost/benefit was okay for a long time as the only people who were affected by it was my partner and myself, but now with 2 kids I have to stop... I should have stopped when we had our first kid. Sitting for 30 min next to our 4 year old daughter and not even noticing it, because I am working out this new idea in my head. Being impatient and annoyed at our 10 month year old son, because I am amped up by some bug I can not stop thin

const reducer = (context, event) => {
switch (event.type) {
case 'FETCH':
return {
...context,
state: 'fetching',
};
case 'RESOLVE':
return {
state: 'fulfilled',
type ProviderPitcherRequest<T extends Provider> = T["onRequest"] extends (
request: infer Req,
dispatcher: Dispatcher<any, any>,
client: Client
) => void
? Req
: never;
type ProviderPitcherResult<T extends Provider> = T["onRequest"] extends (
request: any,

Updated packages

package from version to version
betsy 1.0.2 1.0.2-1624519707403
overmind 27.0.0 28.0.0-1624519707403
overmind-devtools 28.0.0 29.0.0-1624519707403
overmind-devtools-client 10.0.0 11.0.0-1624519707403
overmind-devtools-vscode 9.0.0 10.0.0-1624519707403
overmind-graphql 7.0.0 8.0.0-1624519707403