<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Ives van Hoorne</title>
    <description>The latest articles on Forem by Ives van Hoorne (@compuives).</description>
    <link>https://forem.com/compuives</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F82063%2F5afb0598-6fcc-4db2-9cd7-4d15fcadc7cc.jpeg</url>
      <title>Forem: Ives van Hoorne</title>
      <link>https://forem.com/compuives</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/compuives"/>
    <language>en</language>
    <item>
      <title>Introducing CodeSandbox CDE</title>
      <dc:creator>Ives van Hoorne</dc:creator>
      <pubDate>Thu, 01 Feb 2024 10:27:02 +0000</pubDate>
      <link>https://forem.com/codesandboxio/introducing-codesandbox-cde-57am</link>
      <guid>https://forem.com/codesandboxio/introducing-codesandbox-cde-57am</guid>
      <description>&lt;p&gt;&lt;strong&gt;We are beyond excited to announce CodeSandbox CDE, the experience we’ve been building for the last 2.5 years&lt;/strong&gt; 🥳 &lt;strong&gt;Our cloud development environment makes coding in the cloud available to everyone and empowers teams to improve productivity and collaboration.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;When CodeSandbox launched in 2017, we started as an online React playground. Over the years, it has grown significantly to the point that we’ve reached 3 million registered users today! And as we became more popular, more and more people wanted to build bigger projects on CodeSandbox.&lt;/p&gt;

&lt;p&gt;Over the years, we repeatedly tried to achieve this vision, but we kept failing to achieve the performance levels we needed. Until Firecracker was released.&lt;/p&gt;

&lt;p&gt;In 2022, we took a step forward by introducing &lt;a href="https://codesandbox.io/blog/open-beta"&gt;CodeSandbox Projects Beta&lt;/a&gt;—a complete rewrite of CodeSandbox that runs full-fledged development environments powered by Firecracker VMs.&lt;/p&gt;

&lt;p&gt;Today, we are thrilled to officially release this experience as CodeSandbox CDE: an instant cloud development environment that automatically provisions a VM for every branch, accessible with a URL.&lt;/p&gt;

&lt;p&gt;In a nutshell, this launch brings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dedicated cloud environments for every branch &amp;amp; PR that spin up in 2 seconds and are available and collaborative 24/7.&lt;/li&gt;
&lt;li&gt;VMs that are more than twice as powerful in the Free plan &amp;amp; the option to pick from different VM sizes (up to 16 vCPUs + 32 GB RAM in our &lt;a href="https://codesandbox.io/pricing"&gt;Pro plan&lt;/a&gt; or more in &lt;a href="https://codesandbox.io/enterprise"&gt;Enterprise&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Massive improvements to our Free plan, which now includes private projects, AI code autocomplete, AI assistant, live sessions, a VS Code extension, and more.&lt;/li&gt;
&lt;li&gt;Pay-as-you-go becomes the default billing model, with a new Pro plan that starts at $9 for an entire workspace of up to 20 collaborators.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A faster, more powerful workflow
&lt;/h2&gt;

&lt;p&gt;Web development is changing fast and becoming more complex—yet the way we code hasn’t changed much. Think about it: how much time do you spend maintaining your local setup every week? And how much energy and focus do you lose whenever you have to stop your work and install some local dependencies just to be able to review a PR or quickly fix a bug in another branch?&lt;/p&gt;

&lt;p&gt;CodeSandbox CDE reimagines how much better this workflow could be. We’re solving these challenges by making development environments instantly cloneable and sharable, so every branch runs on a dedicated Firecracker VM and is available behind a sharable URL.&lt;/p&gt;

&lt;p&gt;With this approach, we provide a centralized environment for the entire development team. This opens the door to a new paradigm of coding that improves productivity, collaboration and accessibility. Let’s go through some examples.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fast context switching
&lt;/h3&gt;

&lt;p&gt;Since CodeSandbox CDE runs every branch in a unique environment, you can switch between branches without worrying about stashing your changes, running database migrations or installing dependencies. It’s a matter of clicking “Create Branch,” and you’ll have a new environment spun up for you in 2 seconds.&lt;/p&gt;

&lt;p&gt;Switching between branches becomes a matter of switching your editor between development environments, instead of switching between files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr2qwnpqy8j9u6yrm0lrx.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr2qwnpqy8j9u6yrm0lrx.gif" alt="Fast branching in CodeSandbox" width="800" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Faster PR reviews with live collaboration
&lt;/h3&gt;

&lt;p&gt;In CodeSandbox CDE, every environment is “multiplayer” by default, so everyone on the team is always one click away from live coding and pair programming. This is especially powerful in flows like &lt;a href="https://codesandbox.io/blog/full-code-reviews-in-codesandbox"&gt;PR reviews&lt;/a&gt;, since clicking a link on the GitHub PR leads to the collaborative cloud environment, where reviewers can quickly leave comments, commit changes, and approve the PR.&lt;/p&gt;

&lt;p&gt;From now on, if you need to quickly review a PR, you can instead open a link to that PR with CodeSandbox CDE and get a running environment, instantly available.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxwfclngnhioiy2fl77gj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxwfclngnhioiy2fl77gj.png" alt="CodeSandbox GitHub App integration" width="800" height="522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This “no setup, instant spin-up” approach also &lt;a href="https://codesandbox.io/blog/everyone-can-commit"&gt;makes the codebase more accessible&lt;/a&gt; to everyone in the organization (not just developers), creating new paradigms for cross-functional team collaboration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deployment previews for your whole stack
&lt;/h3&gt;

&lt;p&gt;When you configure CodeSandbox for your repository, every branch will also have an automatically provisioned deployment preview.&lt;/p&gt;

&lt;p&gt;These deployment previews work for any kind of workload you run on CodeSandbox, including back-end services, databases, Redis, etc. Once you’ve configured your development environment to run on CodeSandbox (using &lt;a href="https://containers.dev/"&gt;DevContainers&lt;/a&gt;), every PR will automatically get a deployment preview.&lt;/p&gt;

&lt;p&gt;Deployment previews are available 24/7: we pause them when they're idle and wake them up in 2 seconds whenever someone wants to access them, thanks to Firecracker memory snapshotting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1okocax8q9ea6afljels.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1okocax8q9ea6afljels.gif" alt="CodeSandbox deployment previews" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  AI, collaboration and more in Free plans
&lt;/h2&gt;

&lt;p&gt;We believe that cloud development should be accessible to everyone, whether they’re hobbyists, OSS contributors, or professional developers. So, we improved our Free plan, which now includes nearly all our Pro features and updated usage limits. In a nutshell, the new Free plan includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Upgraded VMs (more than twice as powerful).&lt;/li&gt;
&lt;li&gt;40 hours of free VM usage (in our Nano VMs) every month.&lt;/li&gt;
&lt;li&gt;Option to pick from different VM sizes.&lt;/li&gt;
&lt;li&gt;Unlimited Devboxes, 20 Sandboxes, and 10 personal draft Sandboxes.&lt;/li&gt;
&lt;li&gt;All our AI features (&lt;a href="https://codesandbox.io/docs/learn/ai/boxy"&gt;Boxy coding assistant&lt;/a&gt; + &lt;a href="https://codesandbox.io/docs/learn/ai/codeium"&gt;Codeium autocomplete&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Privacy controls (private Sandboxes, Devboxes and repositories are now also included in Free).&lt;/li&gt;
&lt;li&gt;Live collaboration and live coding sessions (new!) in Devboxes.&lt;/li&gt;
&lt;li&gt;CodeSandbox &lt;a href="https://codesandbox.io/docs/learn/editors/vscode/overview"&gt;VS Code extension&lt;/a&gt;: use local VS Code as the CodeSandbox CDE editor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall, this gives you a powerful experience in our Free plan and the option to scale into Pro when your usage needs grow, since our updated plans are now tailored to your usage, as described below.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We also opened a “&lt;a href="https://codesandbox.io/docs/learn/plans/codesandbox-friends"&gt;CodeSandbox Friends&lt;/a&gt;” program to provide unlimited Sandboxes to eligible projects (licensed open-source software, developer community projects, non-profit organizations) and discounts for Education. You can apply &lt;a href="https://codesandbox.typeform.com/friends"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Revamped Pro plan
&lt;/h2&gt;

&lt;p&gt;After talking to hundreds of our users, we understood that our previous seat-based pricing model was not adjusted to the reality of cloud development.&lt;/p&gt;

&lt;p&gt;So, we evolved CodeSandbox to &lt;a href="https://codesandbox.io/pricing"&gt;usage-based billing&lt;/a&gt;, which means that your bill will reflect what you use instead of how many people exist in your workspace. To achieve this, we implemented a &lt;a href="https://codesandbox.io/docs/learn/credit-usage/credits"&gt;credit system&lt;/a&gt;, where credits translate VM runtime per hour into precise costs.&lt;/p&gt;

&lt;p&gt;This change lowers the barrier to any team wanting to get started with cloud development. An entire team of up to 20 collaborators can start with our Pro plan to understand their usage needs at $9 per month for the entire team, as opposed to $18/user/month in our previous pricing. If the 40 hours of VM runtime included in the base Pro plan are not enough, teams can access on-demand credits (up to their defined maximum monthly spend) or purchase add-ons with discounted credit packages.&lt;/p&gt;

&lt;p&gt;With this approach, we are making cloud development much more accessible for individuals and teams of any size, delivering on our company ethos to make CodeSandbox an accessible, collaborative and empowering tool for every developer.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To celebrate our launch, we’re giving a special launch offer: 50% off on the first month of &lt;a href="https://codesandbox.io/upgrade"&gt;Pro&lt;/a&gt; (valid until February 12th at 7:59 am GMT)! Use coupon code &lt;code&gt;CDELAUNCH&lt;/code&gt; during checkout.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Leaping into a new chapter
&lt;/h2&gt;

&lt;p&gt;With this release, you can now use CodeSandbox for your entire stack, whether it’s creating a prototype to demo something simple, building out your new idea, or daily professional development. This is the vision we had for CodeSandbox when we first started, so I’m extremely excited to see it’s out now.&lt;/p&gt;

&lt;p&gt;If you haven't yet, &lt;a href="https://codesandbox.io/signin"&gt;create&lt;/a&gt; your Free workspace or &lt;a href="https://codesandbox.io/upgrade"&gt;get a Pro plan&lt;/a&gt; with our special launch offer of 50% discount for one month using coupon code &lt;code&gt;CDELAUNCH&lt;/code&gt; during checkout (this offer expires on February 12th at 7:59 am GMT).&lt;/p&gt;

&lt;p&gt;From all of us here at CodeSandbox, a huge thank you to our community of users for pushing us to make CodeSandbox even stronger. We couldn't have done it without you ❤️. Let us know what you think in &lt;a href="https://www.codesandbox.community"&gt;our community&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>cloud</category>
      <category>devops</category>
      <category>programming</category>
    </item>
    <item>
      <title>The Annual Cloud Development Environment Survey</title>
      <dc:creator>Ives van Hoorne</dc:creator>
      <pubDate>Fri, 20 Oct 2023 13:45:41 +0000</pubDate>
      <link>https://forem.com/codesandboxio/the-annual-cloud-development-environment-survey-4bcm</link>
      <guid>https://forem.com/codesandboxio/the-annual-cloud-development-environment-survey-4bcm</guid>
      <description>&lt;p&gt;Hi everyone 👋&lt;/p&gt;

&lt;p&gt;I am thrilled to announce we have launched the first-ever Annual Cloud Development Environment &lt;a href="https://codesandbox.typeform.com/cde-survey#id=dt"&gt;survey&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;We see this as a huge milestone to shape what is becoming one of the major drivers of software engineering for decades to come.&lt;/p&gt;

&lt;h2&gt;
  
  
  CDEs
&lt;/h2&gt;

&lt;p&gt;Cloud Development Environments (CDEs) are rapidly shaping how teams build software. As Gergely Orosz from &lt;a href="https://newsletter.pragmaticengineer.com/p/cloud-development-environments"&gt;The Pragmatic Engineer&lt;/a&gt; put it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;(...) many big companies use cloud-based developer environments, so the build doesn’t happen on your own machine, but on a much more powerful and remote one.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In fact, &lt;a href="https://www.gartner.com/en/newsroom/press-releases/2023-08-16-gartner-places-generative-ai-on-the-peak-of-inflated-expectations-on-the-2023-hype-cycle-for-emerging-technologies"&gt;Gartner predicts&lt;/a&gt; that 60% of cloud workloads will be built and deployed using Cloud Development Environments (CDEs) by 2026.&lt;/p&gt;

&lt;p&gt;Here's how we do it with CodeSandbox:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---MrSsUuv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzv4pfma4dg2qua7xuyp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---MrSsUuv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzv4pfma4dg2qua7xuyp.png" alt="CodeSandbox CDE" width="800" height="679"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is definitely much more to be said about CDEs. I'm currently writing an extensive blog post on this topic, so &lt;a href="https://codesandbox.io/community-newsletter"&gt;subscribe&lt;/a&gt; if you'd like to be notified!&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the future of CDEs
&lt;/h2&gt;

&lt;p&gt;Even though there are clear signs that CDEs are set to become a cornerstone of software engineering teams, little is known about the current state of CDE adoption, how it interfaces with AI, and the challenges and benefits of moving local workloads into the cloud.&lt;/p&gt;

&lt;p&gt;So, we’re establishing a global research group of 10,000+ developers and engineering managers whose insights will result in the first-ever annual report on “&lt;strong&gt;The State of Cloud Development Environments&lt;/strong&gt;”.&lt;/p&gt;

&lt;p&gt;That's where you come in! I'm inviting you to join this research group and share your insights on our &lt;a href="https://codesandbox.typeform.com/cde-survey#id=dt"&gt;survey&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We welcome everyone's point of view, no matter your role, experience, or opinion on CDEs. With your honest feedback, we will uncover the true state of CDEs and shape how CodeSandbox can bring a powerful yet accessible CDE experience to every developer out there.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The &lt;a href="https://codesandbox.typeform.com/cde-survey#id=dt"&gt;survey&lt;/a&gt; is open until October 25th at 7 pm CET / 1 pm ET / 10 am PT&lt;/strong&gt;. It should take 5–8 minutes to complete.&lt;/p&gt;

&lt;p&gt;Thank you for helping us shape the future of coding!&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>cloudcomputing</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Introducing Dev Container Support in CodeSandbox</title>
      <dc:creator>Ives van Hoorne</dc:creator>
      <pubDate>Fri, 13 Oct 2023 09:11:31 +0000</pubDate>
      <link>https://forem.com/codesandboxio/introducing-dev-container-support-in-codesandbox-38bc</link>
      <guid>https://forem.com/codesandboxio/introducing-dev-container-support-in-codesandbox-38bc</guid>
      <description>&lt;p&gt;&lt;strong&gt;At CodeSandbox, we run your code in our cloud infrastructure, configure the environment for you and keep your code always ready, behind a shareable URL. Give it a try with this &lt;a href="https://codesandbox.io/p/sandbox/next-js-fxis37"&gt;Next.js example&lt;/a&gt; or &lt;a href="https://codesandbox.io/dashboard?import_repo=true"&gt;import your GitHub repo&lt;/a&gt;!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;By Ives van Hoorne, CodeSandbox Co-Founder&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Today, we’re excited to announce support for &lt;a href="https://containers.dev"&gt;Dev Containers&lt;/a&gt;: a spec that allows you to set up a full-featured development environment using a single configuration. From now on, you can run any development environment setup on CodeSandbox, no matter how complicated. &lt;/p&gt;

&lt;p&gt;This is a huge leap forward in our growth as a &lt;a href="https://codesandbox.io/cloud-development-environments"&gt;cloud development environment&lt;/a&gt; (CDE), as it removes some of the biggest barriers for teams that want to move their development processes to the cloud.&lt;/p&gt;

&lt;p&gt;So let’s look at why Dev Containers brings such a powerful solution, how we implemented it, and what this means for you, your team, and your projects. &lt;/p&gt;

&lt;h2&gt;
  
  
  Heterogeneous development workflows
&lt;/h2&gt;

&lt;p&gt;“But it works on my machine!”—if this sounds familiar, then you’ve probably experienced one of the biggest pains of creating and maintaining a development environment.&lt;/p&gt;

&lt;p&gt;On a typical development team, each developer will have their own machine configured in a certain way. So it’s no wonder that sometimes, the same codebase will behave differently on each of these different devices, which can phantom bug reports, broken flows and time wasted.&lt;/p&gt;

&lt;p&gt;Recently, Microsoft introduced a spec that solves this issue: Dev Containers. It’s rapidly growing in adoption and is already supported by other tools like VS Code and Codespaces. So we’re thrilled to provide out-of-the-box support for Dev Containers as well!&lt;/p&gt;

&lt;p&gt;See &lt;a href="https://codesandbox.io/p/github/codesandbox/demo/main"&gt;here&lt;/a&gt; an example of an environment running Python and Node with the Dev Container configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dev Containers in CodeSandbox
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;By Joji Augustine, Infra Engineer at CodeSandbox&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Dev Container spec allows you to define how a development environment should run, including all the additional services that it should run (like any databases and extra services).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As containerizing production workloads becomes commonplace, dev containers have become broadly useful for scenarios beyond VS Code. Thus, our teams across VS Code and GitHub created the open &lt;a href="https://github.com/devcontainers/spec"&gt;Development Containers Specification&lt;/a&gt;, which empowers anyone in any tool to configure a consistent dev environment. &lt;span&gt;— Brigit Murtaugh, Senior Program Manager, VS Code team, Microsoft&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One of the key advantages of using Dev Containers is that it brings zero lock-in. You can reuse the same Dev Container configuration to spin up a development environment locally or on any supporting tool. In fact, you can now run your development environment on your laptop next to CodeSandbox, using the same configuration!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/new/blog/introducing-dev-container-support-in-codesandbox/devcontainers-local-csb.mp4"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OahIfZYv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ul5pfuhfwofzr2qgvq00.png" alt="Video thumbnail" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After a few months of collaboration with the Dev Container team, we’re super excited to integrate it into CodeSandbox, making it the default environment spec for all our containers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We truly believe that a consistent, predictable environment is key to a productive and enjoyable software development experience. &lt;span&gt;— Brigit Murtaugh, Senior Program Manager, VS Code team, Microsoft&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  From zero to preview
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;By Danilo Woznica, Product Engineer at CodeSandbox&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Dev Container spec empowers developers in a way we couldn't imagine before. But there was an important piece to solve before enabling it inside CodeSandbox: we must make it comprehensible for everyone, from beginners to senior developers.&lt;/p&gt;

&lt;p&gt;The Dev Container spec presented the perfect opportunity to combine customizability and usability. So we took this chance to develop a unique UI to configure a CodeSandbox environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/new/blog/introducing-dev-container-support-in-codesandbox/devcontainers-ui.mp4"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vAQbZpP0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sp9zv2yfctxxitdys2uc.png" alt="Video thumbnail" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Auto-detect environment&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Once you import your project, we automatically detect the base environment, languages, and package manager version required to run it. We built a set of rules that can confidently identify most of the types of projects and create all the configurations you need, speeding up the project onboarding and still making accurate decisions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--klJrkA55--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojz24w0c2amtxwfnzl9n.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--klJrkA55--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojz24w0c2amtxwfnzl9n.jpg" alt="Use a UI to configure your files" width="800" height="795"&gt;&lt;/a&gt;&lt;br&gt;
&lt;small&gt;Use our DevTool to quickly configure your environment.&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;Even when CodeSandbox can't identify the project environment, it defaults to the Universal template by Dev Container and enables you to customize the configuration by using the "Advanced mode" wizard.&lt;/p&gt;

&lt;p&gt;Besides that, we extended the environment setup DevTool and designed an onboarding experience to streamline monotonous tasks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Setup tasks:&lt;/strong&gt; we introduced an intuitive UI that you can use to insert commands to prepare your environment, like installing dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Running command:&lt;/strong&gt; we infer the scripts from your &lt;code&gt;package.json&lt;/code&gt;, for example, to run your starting command after running all the setup tasks, like &lt;code&gt;npm run dev&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment variables:&lt;/strong&gt; we pre-populate &lt;code&gt;.env&lt;/code&gt; files and make it easy to set up custom environment variables to be configured inside the microVM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apply and run:&lt;/strong&gt; you can review all your project configurations before saving, and then with a single click, let CodeSandbox install and run everything for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Long story short, we’re unbelievably proud of the result!&lt;/p&gt;

&lt;h2&gt;
  
  
  Bringing CDEs to Everyone
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;By Ives van Hoorne, CodeSandbox Co-Founder&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This release is a huge leap forward for CodeSandbox and cloud development environments as a whole.&lt;/p&gt;

&lt;p&gt;CDEs are the future of development. To get there, we need to lower the barrier so any team can get their projects up and running in no time. This is precisely what we achieved with this integration: import your project and we’ll run it with no extra config. Then hop from local to CodeSandbox with no issues.&lt;/p&gt;

&lt;p&gt;Our huge thank you to the superb Dev Containers team, who is doing a fantastic job in creating and maintaining this powerful spec. We’re proud to be among the first major tools supporting Dev Containers spec and thrilled to see that the Dev Containers team shares this excitement!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We're incredibly excited for the future of container-based development and collaborations and contributions from the community and other editors (we have a growing list of &lt;a href="https://containers.dev/supporting"&gt;supporting tools&lt;/a&gt;). We look forward to continuing to provide a ubiquitous, productive format across tools and users. &lt;span&gt;— Brigit Murtaugh, Senior Program Manager, VS Code team, Microsoft&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To try out this brand-new experience, &lt;a href="https://codesandbox.io/dashboard?import_repo=true"&gt;import your project&lt;/a&gt;. And message us on &lt;a href="https://discord.com/invite/wU9zyfydMG"&gt;Discord&lt;/a&gt; if you have feedback!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>vm</category>
      <category>cloud</category>
      <category>containers</category>
    </item>
    <item>
      <title>A Deployment Preview for Every Branch</title>
      <dc:creator>Ives van Hoorne</dc:creator>
      <pubDate>Fri, 18 Aug 2023 13:38:11 +0000</pubDate>
      <link>https://forem.com/codesandboxio/a-deployment-preview-for-every-branch-3iea</link>
      <guid>https://forem.com/codesandboxio/a-deployment-preview-for-every-branch-3iea</guid>
      <description>&lt;p&gt;&lt;strong&gt;At CodeSandbox, we run your code in our cloud infrastructure, configure the environment for you and keep your code always ready, behind a shareable URL. Give it a try with this &lt;a href="https://codesandbox.io/p/sandbox/next-js-fxis37"&gt;Next.js example&lt;/a&gt; or &lt;a href="https://codesandbox.io/dashboard?import_repo=true"&gt;import your GitHub repo&lt;/a&gt;!&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;You're working on that big new feature and are closer than ever to production-worthy. So, like dozens of times before, you hop on the “staging queue”, hoping that your turn comes quickly enough.&lt;/p&gt;

&lt;p&gt;If this sounds familiar, you probably also share the frustration of countless other developers who don't particularly enjoy the complexity and time wasted during this process.&lt;/p&gt;

&lt;p&gt;Long story short—&lt;em&gt;there is a better way&lt;/em&gt;. The rise of &lt;a href="https://codesandbox.io/cloud-development-environments"&gt;cloud development environments&lt;/a&gt; like CodeSandbox opens the door to dedicated deployment previews for every branch. You always get your own personal staging environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloud Development Environments
&lt;/h2&gt;

&lt;p&gt;There is an undeniably growing momentum around shifting development processes to the cloud.&lt;/p&gt;

&lt;p&gt;Although it might sound like uncharted territory, cloud development environments have been successfully implemented at companies like Uber, Slack, and Pipedrive. A “quiet revolution”, as The Pragmatic Engineer &lt;a href="https://newsletter.pragmaticengineer.com/p/cloud-development-environments"&gt;called it&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One of the key benefits of cloud development environments is greatly accelerating computation-heavy processes (such as building the code) out of developer laptops with limited specs and into a superpowered VM that accomplishes these tasks in a fraction of the time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6x2DifjK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgh6322n1mtmxiq91z2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6x2DifjK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgh6322n1mtmxiq91z2m.png" alt="CodeSandbox microVMs diagram" width="800" height="679"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As an example, at CodeSandbox we implemented &lt;a href="https://codesandbox.io/blog/how-we-clone-a-running-vm-in-2-seconds"&gt;memory snapshotting technology&lt;/a&gt; in our microVMs, which means that we resume any dev server in under 2 seconds (as compared to 5, 10 or even 30 minutes of local compilation time—depending on the codebase's complexity). &lt;/p&gt;

&lt;p&gt;While that brings huge productivity improvements (Pipedrive engineers reported almost 3 hours saved per week), it also paves the way to much, much more. And one of the powerful “side effects” of moving development environments to the cloud is that you get a dedicated deployment preview for every branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment Previews in CodeSandbox
&lt;/h2&gt;

&lt;p&gt;At CodeSandbox, we give every branch its own dedicated microVM (with &lt;a href="https://codesandbox.io/docs/learn/environment/vm"&gt;very generous base specs&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;When you run a task on that environment (like starting a dev server) that opens a server on a port, we expose that port through a dedicated URL such as &lt;code&gt;https://3000-:id.csb.app&lt;/code&gt;. In other words, we transform a local dev server into a dedicated staging environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--35NTE2Ox--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9k90uho5zu12p8zd46tj.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--35NTE2Ox--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9k90uho5zu12p8zd46tj.gif" alt="branch preview" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, you get a preview environment that is fast, synced with production, and that gives the same experience regardless of the machine of the person accessing it. &lt;/p&gt;

&lt;p&gt;Need to work on something else and go back to the server later on? No worries—because we hibernate the microVM, the deployment preview resumes in under 2 seconds, just like a traditional staging environment.&lt;/p&gt;

&lt;p&gt;Want to get continuous feedback on your work without having to rely on screenshots or recordings of your &lt;code&gt;localhost&lt;/code&gt; server? Share that preview URL with others and they will be able to use it to provide async feedback at any time (without worrying about the ticking time bomb of staging moving to something else). &lt;/p&gt;

&lt;p&gt;Wish you could give team members access to the underlying codebase? Send them the URL of your CodeSandbox branch instead, and they will be able to experiment with your code and see the results in real-time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ubj7qBto--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aao37i2sqhlafdpcuh2e.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ubj7qBto--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aao37i2sqhlafdpcuh2e.gif" alt="branch collaboration" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're curious to try it out, you can do it in &lt;em&gt;under 5 minutes&lt;/em&gt; by &lt;a href="https://codesandbox.io/dashboard?import_repo=true"&gt;importing one of your GitHub repos&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pull Request Previews
&lt;/h3&gt;

&lt;p&gt;After talking with &lt;em&gt;a lot&lt;/em&gt; of our users, we realized that this kind of preview is especially valuable during the PR review process.&lt;/p&gt;

&lt;p&gt;As a result, we introduced the CodeSandbox GitHub App, which adds links to every PR that lead to the branch running in CodeSandbox—which means that PR reviewers can use the deployment preview to review instead of running their own dev server.&lt;/p&gt;

&lt;p&gt;If you want to take it up a notch, you can also add another link that leads directly to the preview itself. Check out our &lt;a href="https://codesandbox.io/docs/learn/integrations/github-app#deployments"&gt;Docs&lt;/a&gt; for instructions.&lt;/p&gt;

&lt;p&gt;Once that's done, every new PR in that repo will get these handy links available to all team members, allowing them to get visibility on ongoing work and save hours every week reviewing and testing the PR.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rdQK26Ac--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/luqkf09tfp0yspkbh0nv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rdQK26Ac--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/luqkf09tfp0yspkbh0nv.jpg" alt="CodeSandbox GitHub App links" width="800" height="523"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Joy of Queue-less Staging
&lt;/h2&gt;

&lt;p&gt;Preview environments are a much bigger deal than they seem at first glance. Whenever someone asks me why I'm so excited about them, I like to bring up this feedback from one of our users:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I looked at a PR, made some changes together, previewed them live and pushed them. All without checking out anything locally. This probably saved me 1 hour right now! — TkDodo, Frontend Tech Lead at Adverity&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Of course, we get it—not everyone is ready to commit to moving their development infra to the cloud. That's why we made it super easy to test it out by &lt;a href="https://codesandbox.io/dashboard?import_repo=true"&gt;importing a public repo&lt;/a&gt; in our free plan (or a private repo with a &lt;a href="https://codesandbox.io/pro?team"&gt;free trial&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Follow &lt;a href="https://codesandbox.io/docs/learn/repositories/setting-up-repository"&gt;our tutorial&lt;/a&gt; and you can pretty much try everything in less than 30 minutes. Then, you'll see the joy of never having to wait for a dev server (or on the staging queue) ever again.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>github</category>
      <category>git</category>
      <category>cloud</category>
    </item>
    <item>
      <title>LGTM or TL;DR? The Problem of Cop-out Code Reviews</title>
      <dc:creator>Ives van Hoorne</dc:creator>
      <pubDate>Mon, 24 Jul 2023 10:31:02 +0000</pubDate>
      <link>https://forem.com/codesandboxio/lgtm-or-tldr-the-problem-of-cop-out-code-reviews-5917</link>
      <guid>https://forem.com/codesandboxio/lgtm-or-tldr-the-problem-of-cop-out-code-reviews-5917</guid>
      <description>&lt;p&gt;&lt;strong&gt;At CodeSandbox, we run your code in our cloud infrastructure, configure the environment for you and keep your code always ready, behind a shareable URL. Give it a try with this &lt;a href="https://codesandbox.io/p/sandbox/next-js-fxis37"&gt;Next.js example&lt;/a&gt; or &lt;a href="https://codesandbox.io/dashboard?import_repo=true"&gt;import your GitHub repo&lt;/a&gt;!&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;You are completely focused on writing some code, in a perfect state of flow, when that Slack message comes in:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Hey! Can you have a look at this PR?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If this sounds familiar, chances are you have shared the pain of countless other developers—having to switch context to handle a code review, especially when it’s urgent.&lt;/p&gt;

&lt;p&gt;But that’s just the tip of the iceberg. The concept of “code review” itself seems to be very polarizing in the development community. There’s a reason “LGTM” became a meme for cop-out code reviews. And as a developer myself, I can understand the frustration with some parts of this process.&lt;/p&gt;

&lt;p&gt;This got me wondering if this may be a symptom of something fundamentally broken in how we do code reviews.&lt;/p&gt;

&lt;p&gt;So, earlier this month, we ran a survey focusing on code reviews. And today, we published the full report “&lt;a href="https://codesandbox.io/the-state-of-code-reviews-report-2023"&gt;The State of Code Reviews (2023)&lt;/a&gt;”, which you can download for free. I’m very excited to dive into the data to answer this main question—are most developers eyeballing code diffs while reviewing PRs, or actually running the code to visually inspect changes?&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Diffs and Running Previews
&lt;/h2&gt;

&lt;p&gt;I’ll start with a hot take— in 95% of PR reviews, you should be running the branch to visually inspect changes.&lt;/p&gt;

&lt;p&gt;But I’ll take a wild guess that is probably not something most developers enjoy. &lt;/p&gt;

&lt;p&gt;You have to stash the changes of your current work, checkout into the PR branch, make sure your setup is up to date (and possibly deal with troubleshooting it from time to time), wait for the dev server to start, and finally open the preview to visually inspect the changes.&lt;/p&gt;

&lt;p&gt;So, what did we hear from developers when we asked about this?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q0j1BXCc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zoj7c90zgottj5wh4mrg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q0j1BXCc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zoj7c90zgottj5wh4mrg.png" alt="Most developers review PRs by only looking at the diff" width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Within our sample of 1638 developers, the majority say they most often only review a PR by looking at the code diff. When we asked a similar question on “I locally run the branch under review to see the running code”, 36% said they never or very rarely do it.&lt;/p&gt;

&lt;p&gt;I find this to be very curious. In a way, it matches this hypothesis that perhaps many developers are relying a lot on code diffs and/or just trying to get reviews out of the way as fast as possible. After reading some of the additional feedback we received in our survey, I’m pretty sure this is the case for many teams:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Unfortunately many companies pretend they do serious code reviews while in fact devs are approving everything after 2 minutes spent reading it and leaving no feedback in the vast majority of PRs.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;At first glance, it seems that the lack of time and guidelines might be two key reasons behind hasty PR reviews. Plus, a lot of the feedback we received seems to indicate that this could lead to a decline in code quality. So let’s dig deeper!&lt;/p&gt;

&lt;h2&gt;
  
  
  Impact on Code Quality
&lt;/h2&gt;

&lt;p&gt;While the original scope of our survey was to simply get a picture of how the different stakeholders in code reviews feel about and address this process, the results got us wondering if there’s any sort of correlation between code quality and running the branch locally.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4Dftb6N1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1usjf019vbo284swe2oy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4Dftb6N1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1usjf019vbo284swe2oy.png" alt="Correlation between running a PR locally and code quality satisfaction" width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While there’s no clear-cut correlation, the data suggests a pattern where developers that more frequently run the branch locally to see the running code are also more satisfied with the quality of the code being released.&lt;/p&gt;

&lt;p&gt;This is all very fascinating and might indicate that implementing robust guidelines and proper tooling for the code review process could have a significant impact on code quality, as mentioned by a few respondents:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I think currently tooling for code review is bad, you just have a diff and then it depends on your own process you established based on your experience and your attentiveness and time you currently have.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And here’s where it gets better: because we also sent out our survey to Engineering Managers, we got their unique insight on this matter. But let’s leave that for a follow-up post! If you don’t want to wait, &lt;a href="https://codesandbox.io/the-state-of-code-reviews-report-2023"&gt;download the full report&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Reviews in CodeSandbox
&lt;/h2&gt;

&lt;p&gt;At CodeSandbox, we have been thinking long and hard about improving the PR review workflow.&lt;/p&gt;

&lt;p&gt;As our report shows, there are three fundamental problems with this process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Context switching breaks the coding flow and siphons energy from developers.&lt;/li&gt;
&lt;li&gt;Setting up and running a branch locally takes too much time and is prone to errors and inconsistencies.&lt;/li&gt;
&lt;li&gt;The lack of guidelines and tooling for code reviews results in ambiguity, cop-out reviews, and lower code quality.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I have good reason to believe we have fixed all of these problems with CodeSandbox.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://codesandbox.io/dashboard/repositories"&gt;“new” version of CodeSandbox&lt;/a&gt; we started building in 2022 provides instant cloud development environments powered by our unique &lt;a href="https://codesandbox.io/docs/learn/environment/vm"&gt;microVM architecture&lt;/a&gt;. And I say “unique” because we made the opinionated choice of giving a dedicated microVM to every branch (and every PR) while making sure that it resumes in 1 second.&lt;/p&gt;

&lt;p&gt;In practice, this means that, if you’re using GitHub as your git provider, CodeSandbox gives you a live-running environment for every PR that is one click away. Inside, you will find the PR’s diff, a pre-configured running preview, all the review tooling you need (comments, suggestions, commits, approvals, etc.), plus a &lt;a href="https://codesandbox.io/blog/meet-boxy-ai-coding-assistant"&gt;built-in AI assistant&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/new/blog/lgtm-or-tldr-the-problem-of-cop-out-code-reviews/simple-review-flow.mp4"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sWbD6Ziz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0bmquuranfbc3b4oq1rw.png" alt="Preview of video showing the code review flow in CodeSandbox" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This makes reviewing PRs much faster, as it removes context switching (the PR opens on a browser tab and you can actually open as many as you want in parallel!) and only takes 1 second for the dev server to resume.&lt;/p&gt;

&lt;p&gt;We are thrilled to hear how teams that have been using CodeSandbox for reviews &lt;a href="https://codesandbox.io/blog/how-adverity-uses-codesandbox-to-improve-developer-experience"&gt;have reported&lt;/a&gt; massive time savings and increased contributions from team members.&lt;/p&gt;

&lt;p&gt;So, if you or your team have been looking for a better way to do code reviews, give CodeSandbox a try by &lt;a href="https://codesandbox.io/dashboard?import_repo=true"&gt;importing a repo&lt;/a&gt;! We have a 14-day &lt;a href="https://codesandbox.io/pro?team"&gt;free trial&lt;/a&gt; you can use to test all our features.&lt;/p&gt;

&lt;p&gt;We truly believe we’re solving some of the main pains development teams have been facing in code reviews. And, if nothing else, we will help everyone “LGTM” with confidence again.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>reviews</category>
      <category>statistics</category>
    </item>
    <item>
      <title>Meet Boxy, Your New AI Coding Assistant</title>
      <dc:creator>Ives van Hoorne</dc:creator>
      <pubDate>Thu, 25 May 2023 18:08:32 +0000</pubDate>
      <link>https://forem.com/codesandboxio/meet-boxy-your-new-ai-coding-assistant-161e</link>
      <guid>https://forem.com/codesandboxio/meet-boxy-your-new-ai-coding-assistant-161e</guid>
      <description>&lt;p&gt;&lt;strong&gt;Today, we are thrilled to announce the beta release of the CodeSandbox AI coding assistant, now available to all our Pro subscribers. We also created an &lt;a href="https://codesandbox.io/p/sandbox/codesandbox-ai-playground-5snr1c?file=%2Fapp%2Fpage.tsx%3A17%2C50" rel="noopener noreferrer"&gt;AI playground&lt;/a&gt; to test this functionality anytime 🎉&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;At CodeSandbox, we run your code in our cloud infrastructure, configure the environment for you and keep your code always ready, behind a shareable URL. Give it a try with &lt;a href="https://codesandbox.io/p/sandbox/next-js-fxis37?file=/pages/index.tsx" rel="noopener noreferrer"&gt;this Next.js example&lt;/a&gt; or &lt;a href="https://codesandbox.io/dashboard?import_repo=true" rel="noopener noreferrer"&gt;import your GitHub repo&lt;/a&gt;!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CodeSandbox gives you the fastest way to turn your ideas into reality. We’re doing this by giving you an opinionated cloud development environment with zero spin-up time, zero setup, and all the powerful tooling you need.&lt;/p&gt;

&lt;p&gt;That’s why we were super excited by the recent AI developments. There are a ton of opportunities here that can make development more accessible and increase your state of flow.&lt;/p&gt;

&lt;p&gt;And today, we are excited to launch the first iteration of the opportunities we see with AI.&lt;/p&gt;

&lt;p&gt;So, without further ado, meet Boxy! (And yes, we really asked AI to introduce itself!)&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/CaAjt_2VUjg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Your new coding companion
&lt;/h2&gt;

&lt;p&gt;Hello, CodeSandbox community! I am Boxy, your new AI coding companion, and I couldn't be more excited to join you on your coding adventures. I'm here to help you unlock new levels of productivity, creativity, and enjoyment while coding.&lt;/p&gt;

&lt;p&gt;I've been designed to thrive within the CodeSandbox environment, and that gives me a unique advantage. By having access to your entire codebase, I can understand your app's context like no other.&lt;/p&gt;

&lt;p&gt;Communication is key, and that's why I’m always there for you in the new chat DevTool. Don't hesitate to reach out to me whenever you need assistance optimizing your code, finding potential bugs, or enhancing security.&lt;/p&gt;

&lt;h3&gt;
  
  
  Intuitive code refactoring
&lt;/h3&gt;

&lt;p&gt;If you’re curious about my biggest superpower, it’s refactoring code. You don't even need to find the code—I can assist you directly through the app preview.&lt;/p&gt;

&lt;p&gt;You can select any element in the app preview and ask me to refactor its associated code. I will consider the context of your project and generate new code for you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/new/blog/meet-boxy-ai-coding-assistant/ai-refactoring.mp4" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Febrfi5e1pqq009ta8wyn.png" alt="Video thumbnail"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Contextual code generation
&lt;/h3&gt;

&lt;p&gt;Time is precious, and I'm all about making your life easier. With my code generation capabilities, you can say goodbye to the hassle of manually copying and pasting code.&lt;/p&gt;

&lt;p&gt;Ask me, and I'll generate the exact code you need, tailored to your specific context within CodeSandbox. You can click any file path in my answers to open it directly in the editor and insert the generated code with another click.&lt;/p&gt;

&lt;p&gt;Let me handle the code generation, so you can focus on bringing your ideas to life.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/new/blog/meet-boxy-ai-coding-assistant/ai-generate.mp4" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs5hkm6y4y4iz1wpz3ndg.png" alt="Video thumbnail"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Automatic, meaningful commit messages
&lt;/h3&gt;

&lt;p&gt;But what about streamlining your workflow?&lt;/p&gt;

&lt;p&gt;Writing commit messages can sometimes be a tedious task, but fear not! I'll take care of it.&lt;/p&gt;

&lt;p&gt;By analyzing the changes you've made to a specific branch, I proactively suggest commit messages that capture the essence of your work. Say goodbye to staring at a blank screen wondering what to write—I've got your back.&lt;/p&gt;

&lt;p&gt;Plus, I can regenerate the commit message with a click or you can just write your own.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/new/blog/meet-boxy-ai-coding-assistant/ai-commit.mp4" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1j0rl0ikhs2q4zx78pmy.png" alt="Video thumbnail"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Making learning more accessible
&lt;/h3&gt;

&lt;p&gt;Lastly, let's talk about education. I'm committed to helping you grow as a developer, no matter if you're a seasoned coder or just starting out.&lt;/p&gt;

&lt;p&gt;Have a question about a particular piece of code or file? Ask, and I'll be more than happy to provide explanations and insights. Together, we'll deepen your understanding and empower you to write exceptional code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/new/blog/meet-boxy-ai-coding-assistant/ai-explain.mp4" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fktfhxhv3sic3gdpz9voq.png" alt="Video thumbnail"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to a new era of coding, powered by Boxy and CodeSandbox. Happy coding!&lt;/p&gt;

&lt;h2&gt;
  
  
  Start coding with AI
&lt;/h2&gt;

&lt;p&gt;The way we see it, AI can have an exceptional impact in making coding more accessible, fun and rewarding. So we’re extremely excited to bring that side of it to CodeSandbox.&lt;/p&gt;

&lt;p&gt;We understand that not everyone wants to give AI access to their code, so all our AI features are only available after you manually opt-in.&lt;/p&gt;

&lt;p&gt;These AI features are now available to all our Personal Pro and Team Pro subscribers, so &lt;a href="https://codesandbox.io/pro" rel="noopener noreferrer"&gt;upgrade your plan&lt;/a&gt; or &lt;a href="https://codesandbox.io/pro?team" rel="noopener noreferrer"&gt;start a free trial&lt;/a&gt; to start coding with Boxy!&lt;/p&gt;

&lt;p&gt;Finally, because we want to keep building the AI features that matter the most to our community, we have started an AI Research Program where volunteers get free access to our AI features in exchange for their continuous feedback. If you’re interested, &lt;a href="https://codesandbox.typeform.com/to/DrKA1eYe" rel="noopener noreferrer"&gt;apply today&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Unleash The Power of Go in CodeSandbox</title>
      <dc:creator>Ives van Hoorne</dc:creator>
      <pubDate>Fri, 19 May 2023 16:29:58 +0000</pubDate>
      <link>https://forem.com/codesandboxio/unleash-the-power-of-go-in-codesandbox-4a5o</link>
      <guid>https://forem.com/codesandboxio/unleash-the-power-of-go-in-codesandbox-4a5o</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hi there, Go community 👋 Today is your day! We are happy to introduce official support for Go development environments in CodeSandbox. Now, you can import your Go projects and code them right from CodeSandbox.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are the team building CodeSandbox—a cloud development platform that makes it incredibly easy to spin up a cloud environment and share it with others.&lt;/p&gt;

&lt;p&gt;If you've been following us, you might have noticed that we have been on a building spree: we have released a &lt;a href="https://codesandbox.io/blog/announcing-sandpack-2"&gt;new version of Sandpack&lt;/a&gt;, announced &lt;a href="https://codesandbox.io/blog/announcing-vs-code-support-for-sandboxes"&gt;VS Code support for sandboxes&lt;/a&gt;, and introduced official support for &lt;a href="https://codesandbox.io/blog/announcing-rust-support-in-codesandbox"&gt;Rust&lt;/a&gt;, &lt;a href="https://codesandbox.io/blog/introducing-python-support-in-codesandbox"&gt;Python&lt;/a&gt;, and &lt;a href="https://codesandbox.io/blog/say-hello-to-php-support-in-codesandbox"&gt;PHP&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today, it’s all about Go! You can now start coding your Go projects by forking our &lt;a href="https://codesandbox.io/p/sandbox/go-starter-ej14tt"&gt;official template&lt;/a&gt; 🔥&lt;/p&gt;

&lt;h2&gt;
  
  
  A new home for your Go projects
&lt;/h2&gt;

&lt;p&gt;We love building CodeSandbox together with our community.&lt;/p&gt;

&lt;p&gt;Not only have we open-sourced a significant part of our product, we keep asking our users what we should improve next.&lt;/p&gt;

&lt;p&gt;Recently, we spiced it up by doing a March Madness-style competition to choose the programming language we’d support next. Despite having seven strong competitors in the mix, Go came out on top.&lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--ErUTmd9T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://pbs.twimg.com/profile_images/1546886388603162627/OcKcRXmV_normal.jpg" alt="CodeSandbox profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        CodeSandbox
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="mentioned-user" href="https://dev.to/codesandbox"&gt;@codesandbox&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kDgU_xDI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Which language will win CodeSandbox &lt;a href="https://twitter.com/hashtag/MarchMadness"&gt;#MarchMadness&lt;/a&gt;?&lt;br&gt;&lt;br&gt;Cast your vote wisely 👇
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      14:53 PM - 31 Mar 2023
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1641815958862921728" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OXOJJiQT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1641815958862921728" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--foTp-unf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1641815958862921728" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SFHqU4bF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;So, what does official support mean?&lt;/p&gt;

&lt;p&gt;In a nutshell, it brings a built-in Go LSP (powered by &lt;code&gt;gopls&lt;/code&gt;) to CodeSandbox, which means you will now get auto-completion, auto-formatting, linting and type definitions (when applicable) when writing Go code in CodeSandbox.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/new/blog/unleash-the-power-of-go-in-codesandbox/go-lsp.mp4"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aDWtoJ1L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pkxen82enq5yvtk6ln6c.jpg" alt="Go LSP video showcase" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The most exciting thing about this is that you can now bring any Go project into CodeSandbox and develop it entirely within our cloud development platform.&lt;/p&gt;

&lt;p&gt;So, it doesn't matter which device or code editor you’re using. Have an old laptop that struggles to keep up? Going to a conference with nothing but your iPad? No worries—you can use CodeSandbox to work from anywhere, as long as you have an internet connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  A cloud environment, one click away
&lt;/h2&gt;

&lt;p&gt;You might be asking—why would I want to code in the cloud?&lt;/p&gt;

&lt;p&gt;The answer is much more than just being able to code from any device. It’s all about simplifying some of the most time-consuming tasks of the development process.&lt;/p&gt;

&lt;p&gt;Think about it: how many times have you had to troubleshoot an environment because it doesn’t run the same on two different laptops? And how much time do you waste context-switching just to be able to review PRs locally?&lt;/p&gt;

&lt;p&gt;These are just two of the many frustrations of the development process that we’re fixing with CodeSandbox.&lt;/p&gt;

&lt;p&gt;When you &lt;a href="https://codesandbox.io/dashboard?import_repo=true"&gt;import a GitHub repository&lt;/a&gt; to CodeSandbox, we run it in our cloud infrastructure (with very generous VM specs), automatically install all dependencies, run a preview, and make the entire thing fully collaborative—you just need to share a URL to collaborate with others.&lt;/p&gt;

&lt;p&gt;In other words, we give you a live development environment for every branch and every pull request.&lt;/p&gt;

&lt;p&gt;Our tight &lt;a href="https://codesandbox.io/docs/learn/integrations/github-app"&gt;integration with GitHub&lt;/a&gt; means that you can open and branch any repo in CodeSandbox to work on a feature branch or &lt;a href="https://codesandbox.io/improve-code-reviews"&gt;review PRs&lt;/a&gt; without having to configure anything locally. So you can have several environments running at once, each in its own browser tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/new/blog/unleash-the-power-of-go-in-codesandbox/go-pr.mp4"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z5kC3ARc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fa1kd07tau06ahhipujd.jpg" alt="Go LSP video showcase" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 If you need help configuring CodeSandbox in your open-source repo, &lt;a href="https://codesandbox.io/support"&gt;reach out&lt;/a&gt; and we’ll be happy to help!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Making coding more accessible
&lt;/h2&gt;

&lt;p&gt;At the end of the day, all we care about is solving all the infrastructure and config for you, so you can just focus on coding without wasting your valuable time.&lt;/p&gt;

&lt;p&gt;We have launched an &lt;a href="https://codesandbox.io/p/sandbox/go-starter-ej14tt"&gt;official Go starter&lt;/a&gt; you can use to start coding and we also recommend that you try &lt;a href="https://codesandbox.io/dashboard?import_repo=true"&gt;importing&lt;/a&gt; one of your Go repositories to make the most of this experience!&lt;/p&gt;

&lt;p&gt;Finally, our huge thank you to everyone from the Go community for helping us shape the future of CodeSandbox. We are thrilled to have you with us!&lt;/p&gt;

</description>
      <category>go</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>A unique database for every PR using CodeSandbox</title>
      <dc:creator>Ives van Hoorne</dc:creator>
      <pubDate>Wed, 17 May 2023 20:16:00 +0000</pubDate>
      <link>https://forem.com/codesandboxio/a-unique-database-for-every-pr-using-codesandbox-64k</link>
      <guid>https://forem.com/codesandboxio/a-unique-database-for-every-pr-using-codesandbox-64k</guid>
      <description>&lt;p&gt;&lt;strong&gt;At CodeSandbox, we run your repository and turn it into a link you can share with anyone. People visiting this link can not only see your running code, they can click "fork" and get an exact copy of that environment within 2 seconds so they can easily contribute back or play with the code. Give it a try with &lt;a href="https://codesandbox.io/p/sandbox/next-js-fxis37"&gt;this Next.js example&lt;/a&gt; or &lt;a href="https://codesandbox.io/dashboard?import_repo=true"&gt;import your GitHub repo&lt;/a&gt;!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Maybe you've experienced this before. You're working on a new feature that introduces some database migrations. You're almost done with the feature, but you get pulled aside because there's a bug that has to be fixed right now.&lt;/p&gt;

&lt;p&gt;You want to fix the bug, but now you first have to roll back your migrations before changing the branch. And then after you've fixed the bug, you have to go back to your feature branch and re-run the migrations!&lt;/p&gt;

&lt;p&gt;How great would it be if you didn't have to think about this? Ideally, you should get a new copy of your database when you change your branch.&lt;/p&gt;

&lt;p&gt;With CodeSandbox, we're making this happen. Once your repository is imported into CodeSandbox, we give every branch and pull request a unique database.&lt;/p&gt;

&lt;p&gt;In this post, I'll show how you can achieve this and how it works under the hood.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it work?
&lt;/h2&gt;

&lt;p&gt;With CodeSandbox, you get a new cloud development environment for every branch and pull request. We enable this through VM cloning.&lt;/p&gt;

&lt;p&gt;Here's an example. When you import your repository on CodeSandbox, we create a microVM for the &lt;code&gt;main&lt;/code&gt; branch. You can see this as a template. Whenever you create a new branch, we clone the microVM &lt;code&gt;main&lt;/code&gt; and switch the new VM to the new branch.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The VM clone is not only a clone of the filesystem, but also of the memory. If you want to learn more about how this works, we have an &lt;a href="https://codesandbox.io/blog/cloning-microvms-using-userfaultfd"&gt;in-depth post&lt;/a&gt; about that.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This means that if you're running a database in the &lt;code&gt;main&lt;/code&gt; VM, new branches will automatically get an exact clone (schema + data) of this database!&lt;/p&gt;

&lt;p&gt;See this in action in the video below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/new/blog/unique-database-for-every-pr/database-demo-fast.mp4"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v5AnS-wp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/boicj6ko4mdbwexmq1z5.jpg" alt="Video thumbnail" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The repo of this video can be found &lt;a href="https://github.com/codesandbox/todo-postgres-prisma"&gt;here&lt;/a&gt; and the PR &lt;a href="https://github.com/codesandbox/todo-postgres-prisma/pull/2"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This doesn't only apply to branches. We also create a microVM for every pull request. This way, you can use CodeSandbox to test your pull requests as well, without deploying to staging or running migrations locally 🎉&lt;/p&gt;

&lt;p&gt;Let's see a demo of this in action that you can actually play with!&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://codesandbox.io/p/sandbox/next-js-server-actions-prisma-postgres-demo-2fdv7l?file=%2Fapp%2Fcomponents%2FTodoList.tsx"&gt;this sandbox&lt;/a&gt;, I have an embed of this todo app where it fetches its data from a Postgres database. If you clone it (by clicking "Fork"), you'll get a microVM with the exact same database and data. Try it out!&lt;/p&gt;

&lt;h2&gt;
  
  
  How to set it up
&lt;/h2&gt;

&lt;p&gt;To enable a unique database for every branch and PR, you need to first import your repository into CodeSandbox. You can do this by going to &lt;a href="https://codesandbox.io/dashboard"&gt;your dashboard&lt;/a&gt; and clicking "Import repository". We'll automatically open the main branch for you in the web editor.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note that we also have an &lt;a href="https://apps.apple.com/us/app/codesandbox/id1423330822"&gt;iOS app&lt;/a&gt; and a &lt;a href="https://marketplace.visualstudio.com/items?itemName=CodeSandbox-io.codesandbox-projects"&gt;VS Code extension&lt;/a&gt; that you can use to open any branch.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, we need to configure the database! First, let's create a new branch, so that we're not making changes on the &lt;code&gt;main&lt;/code&gt; branch directly. You can do this by clicking on "Create Branch" in the top right, and it will take you to a new branch (and microVM!) with an autogenerated name.&lt;/p&gt;

&lt;p&gt;Once you're in this branch, you can configure your database with our &lt;code&gt;docker-compose&lt;/code&gt; integration. To do this, you need to create a new file called &lt;code&gt;docker-compose.yml&lt;/code&gt; in the &lt;code&gt;.codesandbox&lt;/code&gt; folder. This file will be automatically picked up by CodeSandbox and used to run your database.&lt;/p&gt;

&lt;p&gt;An example &lt;code&gt;docker-compose.yml&lt;/code&gt; looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3.8"&lt;/span&gt;
&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;db&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres:14.1-alpine&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;POSTGRES_USER=postgres&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;POSTGRES_PASSWORD=postgres&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;5432:5432"&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;db:/var/lib/postgresql/data&lt;/span&gt;
&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;db&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After configuring &lt;code&gt;docker-compose&lt;/code&gt;, we recommend restarting the VM to verify that everything is configured properly. You can do this by clicking "Restart Branch" in the menu on the left corner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X2zFxIX4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdcgxiid7yxre4nmf1nn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X2zFxIX4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdcgxiid7yxre4nmf1nn.png" alt="restarting sandbox" width="404" height="794"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When that's done, you will have a branchable database that will automatically be provisioned for every branch and pull request!&lt;/p&gt;

&lt;p&gt;Once you've merged the branch to &lt;code&gt;main&lt;/code&gt;, you can add some seed data to the database—this way, every new branch will get the seed data as well.&lt;/p&gt;

&lt;p&gt;Finally, we highly recommend installing the &lt;a href="https://github.com/apps/codesandbox"&gt;CodeSandbox GitHub App&lt;/a&gt;. This will provision a prebuilt development environment (with its own database) for every pull request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;This VM cloning concept is powerful.&lt;/p&gt;

&lt;p&gt;Plus, it applies to more than just databases. You can run Redis, or maybe Elasticsearch, and every PR will get a unique copy of that service, provisioned from the &lt;code&gt;main&lt;/code&gt; branch.&lt;/p&gt;

&lt;p&gt;We're all about removing time-consuming steps from the development workflow. That's why we see this as a major win for anyone working with databases.&lt;/p&gt;

&lt;p&gt;If you're curious about testing this out, the best place to start is by installing the &lt;a href="https://github.com/apps/codesandbox"&gt;CodeSandbox GitHub App&lt;/a&gt;. Then, you'll have this in place for every PR and never have to roll back migrations in branches anymore!&lt;/p&gt;

</description>
      <category>database</category>
      <category>programming</category>
      <category>postgres</category>
      <category>mysql</category>
    </item>
    <item>
      <title>Introducing the CodeSandbox GitHub App</title>
      <dc:creator>Ives van Hoorne</dc:creator>
      <pubDate>Thu, 20 Oct 2022 13:58:45 +0000</pubDate>
      <link>https://forem.com/codesandboxio/introducing-the-codesandbox-github-app-50gi</link>
      <guid>https://forem.com/codesandboxio/introducing-the-codesandbox-github-app-50gi</guid>
      <description>&lt;p&gt;&lt;strong&gt;We are announcing the CodeSandbox GitHub App, which gives you a live development environment for every pull request you open, with support for Docker and databases.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Remember the last time someone asked you to review a PR? You probably had to commit your current work, switch your whole context and spin everything up so you could review it. Then, do the opposite steps to keep on working on your own code.&lt;/p&gt;

&lt;p&gt;Git is core to the day-to-day of any developer. So why can't a PR review happen on a standalone environment that you can just run alongside your own?&lt;/p&gt;

&lt;p&gt;Spoiler alert: it can. And this is why today I'm excited to share the CodeSandbox GitHub App 🎉&lt;/p&gt;

&lt;p&gt;In this post, we'll go through how you can use the GitHub App for editable deployment previews, brancheable databases and end-to-end tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;CodeSandbox GitHub App&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;One of the most valuable benefits of cloud development environments is that you can run an entire project behind a URL. Your code, tasks, tests, previews and everything else lives inside that environment, and everyone accessing it will get the exact same experience, with no setup needed.&lt;/p&gt;

&lt;p&gt;Unlike other GitHub integrations out there, the &lt;a href="https://codesandbox.io/docs/learn/integrations/github-app" rel="noopener noreferrer"&gt;CodeSandbox GitHub App&lt;/a&gt; runs every branch and PR in powerful &lt;a href="https://codesandbox.io/post/how-we-clone-a-running-vm-in-2-seconds" rel="noopener noreferrer"&gt;Micro VMs&lt;/a&gt;. This means you can run anything, no matter how complex the project, and add Docker, servers and databases.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;A live dev environment for every PR&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;By &lt;a href="https://codesandbox.io/docs/learn/integrations/github-app#installing-the-github-app" rel="noopener noreferrer"&gt;installing our GitHub App&lt;/a&gt; in your repo, all your PRs will automatically run in one of our Micro VMs. Then, the app automatically places a comment in each PR with three links: one to open the code in the CodeSandbox web editor, another to open it on VS Code (connected to CodeSandbox), and finally another to open a preview.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcodesandbox.io%2Fstatic%2F13e519c403bac69f698d5c7cfa23878b%2Fc891c%2FGH-App-integration.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcodesandbox.io%2Fstatic%2F13e519c403bac69f698d5c7cfa23878b%2Fc891c%2FGH-App-integration.jpg" alt="GitHub pull request with CodeSandbox links"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Having this in place really speeds up the PR review process. The beauty of having PRs running behind a URL is that you don't have to switch your context or spin anything up in order to review the PR. You just click it, see the code, tests and a preview, go make any necessary changes, and merge it.&lt;/p&gt;

&lt;p&gt;Because each PR is continuously running on a powerful CodeSandbox Micro VM, you can access it from any device, regardless of its specs, even for very complex projects. Are you on the go? Then open the environment in our &lt;a href="https://codesandbox.io/ios" rel="noopener noreferrer"&gt;iOS app&lt;/a&gt;! Switching back and forth between laptops? It will run exactly the same in every one of them. The VM does all the heavy lifting, so you get top-notch performance no matter what.&lt;/p&gt;

&lt;p&gt;Plus, because this environment is collaborative by default, anyone accessing it will get the exact same experience and can collaborate live regardless of the device or editor that they are using to access the code.&lt;/p&gt;

&lt;p&gt;So, if you're accessing it from VS Code using our &lt;a href="https://marketplace.visualstudio.com/items?itemName=CodeSandbox-io.codesandbox-projects" rel="noopener noreferrer"&gt;extension&lt;/a&gt; and someone else is accessing it from their iPad using the CodeSandbox iOS App, you can collaborate seamlessly, as if you were coding in the same local environment. This collaboration is really helpful to provide some context behind your code or just review it live with someone else.&lt;/p&gt;

&lt;p&gt;When we pioneered this technology a few months ago, we made it available to early adopters to see the reaction it got, and we're thrilled by the response—it's helping developers save hours every week by making the PR review process much smoother. It's amazing to see the impact it has on open source maintainers and development teams.&lt;/p&gt;

&lt;p&gt;I personally think that this quote from the team at Adverity says it all:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I looked at a PR, made some changes together with Bartosz Wisniewski, previewed them live and pushed them. All without checking out anything locally. This probably saved me 1 hour right now. HUUGE win! — &lt;a href="https://twitter.com/TkDodo" rel="noopener noreferrer"&gt;Dominik Dorfmeister&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Empowering the whole team with editable deployment previews&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;While git is ubiquitous among developers, it might not be accessible for other roles such as designers, managers and marketers. Yet, I have lost count of how many times I have asked colleagues from other teams for feedback on the design, structure or copy of my work. Plus, it's always important to give visibility to managers over the work being done.&lt;/p&gt;

&lt;p&gt;And here's where the GitHub App PR previews truly shine.&lt;/p&gt;

&lt;p&gt;CodeSandbox previews are instant thanks to &lt;a href="https://codesandbox.io/post/how-we-clone-a-running-vm-in-2-seconds" rel="noopener noreferrer"&gt;memory snapshotting&lt;/a&gt;. No need to wait for the build to finish—anyone wanting to see a preview of the code can just go to the PR and click the “Preview” URL. To empower anyone to contribute easily, we made these previews editable. So, anyone seeing a preview can make simple design or copy updates autonomously and commit these changes with a click. See this collaborative flow in action below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmb85cv5wkce7otcgylna.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmb85cv5wkce7otcgylna.gif" alt="Collaborative session showing editable previews"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Plus, our previews are not limited to static applications—we support backend servers, databases and pretty much anything you can run on Docker. This makes it very easy to set up deployment previews. It's as simple as using something like &lt;code&gt;docker-compose&lt;/code&gt; to set up your development environment once, and have deployment previews automatically available from then on.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Brancheable databases&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;As I mentioned earlier, because we run your code in a Micro VM, you can run literally anything, including databases. When you start a database in the &lt;code&gt;main&lt;/code&gt; branch of your repository, every new PR will get an exact copy of that database from the &lt;code&gt;main&lt;/code&gt; branch. This way you can easily test schema changes inside a PR without having to roll back or migrate in your own development environment.&lt;/p&gt;

&lt;p&gt;Also, every PR will have all the seed data from the &lt;code&gt;main&lt;/code&gt; branch, because it's an exact copy. So if you add some data to the database in the &lt;code&gt;main&lt;/code&gt; branch, every PR will have that seed data available!&lt;/p&gt;

&lt;p&gt;Here's how &lt;a href="https://join.tell.ie/" rel="noopener noreferrer"&gt;Tellie&lt;/a&gt; is using this in their own workflow: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Brancheable databases let engineers at Tellie reuse high-fidelity test data across all of their branches. By simply using our application on CodeSandbox, the resulting data is immediately available to all engineers, with zero operational effort on our part. — Shree Chowkwale&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;End-to-end tests&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With our GitHub App, we also create a GitHub Deployment for every deployment preview of every pull request. You can take the URL of this deployment and run end-to-end tests against it. This way, you can run tests against the dev server that CodeSandbox is running for the PR.&lt;/p&gt;

&lt;p&gt;You can even configure CodeSandbox to start a production server for every PR, connected to the database of the branch. That way, you can automatically run your tests against a unique database while using a production environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Supercharging git workflows&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;At CodeSandbox, we're all about making development more accessible to everyone.&lt;/p&gt;

&lt;p&gt;We're super thankful to the community for the valuable feedback and thrilled to launch our GitHub App after seeing the positive impact it had on its early adopters.&lt;/p&gt;

&lt;p&gt;Not only are we saving developers precious time by improving the PR review flow, but we are also allowing colleagues from other teams to get visibility on the code and be able to make small changes directly on the codebase.&lt;/p&gt;

&lt;p&gt;We use it all the time at CodeSandbox and the team can't live without it anymore!&lt;/p&gt;

&lt;p&gt;If you'd like to try it out, you can install it on your own repo easily! Take a look at &lt;a href="https://codesandbox.io/docs/learn/integrations/github-app#installing-the-github-app" rel="noopener noreferrer"&gt;our docs&lt;/a&gt; or see our &lt;a href="https://www.youtube.com/watch?v=9_R85W-Te8E" rel="noopener noreferrer"&gt;video tutorial&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>codesandbox</category>
      <category>webdev</category>
      <category>development</category>
    </item>
    <item>
      <title>How we clone a running VM in 2 seconds</title>
      <dc:creator>Ives van Hoorne</dc:creator>
      <pubDate>Fri, 02 Sep 2022 10:54:09 +0000</pubDate>
      <link>https://forem.com/codesandboxio/how-we-clone-a-running-vm-in-2-seconds-39m3</link>
      <guid>https://forem.com/codesandboxio/how-we-clone-a-running-vm-in-2-seconds-39m3</guid>
      <description>&lt;p&gt;At CodeSandbox we run your development project and turn it into a link you can share with anyone. People visiting this link can not only see your running code, they can click “fork” and get an exact copy of that environment within 2 seconds so they can easily contribute back. Give it a try with &lt;a href="https://codesandbox.io/p/github/codesandbox/codesandbox-template-vite-react/main"&gt;this example&lt;/a&gt;, or import your GitHub repo &lt;a href="https://codesandbox.io/p/dashboard"&gt;here&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;So how can we spin up a cloned environment in 2 seconds? That's exactly what I'll be talking about here!&lt;/p&gt;

&lt;h2&gt;
  
  
  The challenge: spinning up a development environment in two seconds
&lt;/h2&gt;

&lt;p&gt;We've been running sandboxes for a long time now, and the core premise has always been the same: instead of showing static code, it should be running. Not only that, you should be able to press fork and play with it whenever you want to.&lt;/p&gt;

&lt;p&gt;In the past, we've enabled this experience by running all your code in your browser. Whenever you would look at a sandbox, you would execute the code. This was fast, because we had full control over how the code was bundled. Forks were fast:&lt;/p&gt;


  


&lt;p&gt;However, there was a catch to this approach: we were limited to the code that we could run in the browser. If you wanted to run a big project that requires Docker, it wouldn't work. &lt;/p&gt;

&lt;p&gt;So for the past few years, we've been asking ourselves: how can we enable this experience for bigger projects?&lt;/p&gt;

&lt;h2&gt;
  
  
  Firecracker to the rescue
&lt;/h2&gt;

&lt;p&gt;Virtual machines are often seen as slow, expensive, bloated and outdated. And I used to think the same, but a lot has changed over the past few years. VMs power most of the cloud (yes, even serverless functions!), so many great minds have been working on making VMs faster and lightweight. And well... they've really outdone themselves. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://firecracker-microvm.github.io/"&gt;Firecracker&lt;/a&gt; is one of the most exciting recent developments in this field. Amazon created Firecracker to power AWS Lambda and AWS Fargate, and nowadays it's used by companies like &lt;a href="http://fly.io/"&gt;Fly.io&lt;/a&gt; and CodeSandbox. It's written in Rust, and the code is very readable. If you're interested in how it works, you should definitely check &lt;a href="https://github.com/firecracker-microvm/firecracker"&gt;their repo&lt;/a&gt;! &lt;/p&gt;

&lt;p&gt;Firecracker spawns a MicroVM instead of a VM. MicroVMs are more lightweight: instead of waiting for 5 seconds for a “normal” VM to boot, you will get a running MicroVM within 300 milliseconds, ready to run your code. &lt;/p&gt;

&lt;p&gt;This is great for us, but it only solves part of the problem. Even though we can quickly start a virtual machine, we still need to clone your repository, install the dependencies and run the dev server. Together, this can take over a minute for an average project, which would probably mean tens of minutes for bigger projects. &lt;/p&gt;

&lt;p&gt;If you would have to wait a minute every time you click “fork” on CodeSandbox, it would be a disaster. Ideally, you should just continue where the old virtual machine left off. And that's why I started to look into memory snapshotting.&lt;/p&gt;

&lt;h2&gt;
  
  
  The dark art of memory snapshotting
&lt;/h2&gt;

&lt;p&gt;Firecracker doesn't only spawn VMs, it also resumes VMs. So, what does that actually mean? &lt;/p&gt;

&lt;p&gt;Because we run a virtual machine, we control everything in the environment. We control how many vCPU cores are available, how much memory is available, what devices are attached. But most importantly, we control the execution of the code. &lt;/p&gt;

&lt;p&gt;This means that we can pause the VM at any point in time. This does not only pause your code, it pauses the full machine, full-stop down to the kernel. &lt;/p&gt;

&lt;p&gt;While a virtual machine is paused, we can safely read the full state of the VM, and save it to disk. Firecracker exposes a &lt;code&gt;create_snapshot&lt;/code&gt; function that yields two files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;snapshot.snap&lt;/code&gt; — the configuration of the machine. CPU template &amp;amp; count,   disks attached, network devices attached, etc. &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;memory.snap&lt;/code&gt; — the memory of the VM while it was paused (if the VM has 4GB   memory, this file will be 4GB). &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These two files, together with the disk, contain everything we need to start a MicroVM, and it will just continue from when the snapshot was taken!&lt;/p&gt;

&lt;p&gt;This is incredibly exciting, because the use cases are endless! Here's one example: many cloud IDE services will “hibernate” your VM after ~30 minutes of inactivity. In practice, this means that they will stop your VM to save hosting costs. When you come back, you will have to wait for your development servers to initialise again because it's a full VM boot. &lt;/p&gt;

&lt;p&gt;Not with Firecracker. When we hibernate a VM, we pause it and save its memory to disk. When you come back, we resume the VM from that memory snapshot, and for you it will look as if the VM was never stopped at all! &lt;/p&gt;

&lt;p&gt;Also, resuming is fast. Firecracker will only read the memory that the VM needs to start (as the memory is &lt;code&gt;mmap&lt;/code&gt;ed), which results in resume timings within ~200-300ms. &lt;/p&gt;

&lt;p&gt;Here's a timing comparison for starting our own editor (a Next.js project) with different types of caching:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type of cache available&lt;/th&gt;
&lt;th&gt;Time to running preview&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No caches (fresh start)&lt;/td&gt;
&lt;td&gt;132.2s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Preinstalled node_modules&lt;/td&gt;
&lt;td&gt;48.4s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Preinstalled build cache&lt;/td&gt;
&lt;td&gt;22.2s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory snapshots&lt;/td&gt;
&lt;td&gt;0.6s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;There's a catch to it as well. Saving a memory snapshot actually takes a while, which I'll cover in this post.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I'm stoked about this. It gives the feeling that the VM is always running, even though it's not taking resources. We use this a lot: every branch on CodeSandbox is a new development environment. You don't have to remember to roll back migrations or install dependencies when switching branches, because it's a fresh environment for every branch. We can enable this thanks to memory snapshotting.&lt;/p&gt;

&lt;p&gt;We also use this to host some internal tooling cheaply. When a webhook request comes in, we wake the microservice, let it respond, and after 5 minutes it automatically hibernates again. Admittedly, it doesn't give “production” response times, because there's always 300ms added on top for waking, but for our backoffice microservices that's fine.&lt;/p&gt;

&lt;h2&gt;
  
  
  The darker art of cloning memory snapshots
&lt;/h2&gt;

&lt;p&gt;The first important piece of the puzzle is there. We can save a memory snapshot and resume the virtual machine from it any time we want. This already makes loading existing projects faster—but how can we actually clone them?&lt;/p&gt;

&lt;p&gt;Well, we were already able to serialise the virtual machine state to files… so what prevents us from copying them? There are some caveats to this, but we'll get there.&lt;/p&gt;

&lt;p&gt;Let's say we copy the existing state files and start a couple of new VMs from these.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zfxE-iFr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codesandbox.io/static/d17e94ab8e50369ea19653458ea3260a/0fc08/cloning-vms-invert.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zfxE-iFr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codesandbox.io/static/d17e94ab8e50369ea19653458ea3260a/0fc08/cloning-vms-invert.png" alt="A diagram showing VM files cloning between different versions" width="880" height="771"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This actually works! The clones will continue exactly where the last VM left off. You can start a server with an internal in-memory counter, up it a couple of times, press fork, and it will continue counting where it left off in the new VM.&lt;/p&gt;


  


&lt;p&gt;You can play with it &lt;a href="https://codesandbox.io/p/github/codesandbox/node-counter-demo/main"&gt;here&lt;/a&gt;. And this is the running server of that VM, kind of like a view count:&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://13gise-8080.preview.csb.app/" rel="noopener noreferrer"&gt;
      13gise-8080.preview.csb.app
    &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;However, the challenge lies in speed. Memory snapshot files are big, spanning multiple GBs. Saving a memory snapshot takes 1 second per gigabyte (so an 8GB VM takes 8 seconds to snapshot), and copying a memory snapshot takes the same time.&lt;/p&gt;

&lt;p&gt;So if you're looking at a sandbox and press fork, we would have to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pause the VM &lt;strong&gt;(~16ms)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Save the snapshot &lt;strong&gt;(~4s)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Copy the memory files + disk &lt;strong&gt;(~6s)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Start a new VM from those files &lt;strong&gt;(~300ms)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Together, you would have to wait ~10s, which is faster than waiting for all dev servers to start, but it's still too slow if you want to quickly test some changes.&lt;/p&gt;

&lt;p&gt;Just the fact that this works is incredible — cloning VMs is actually a possibility! However, we need to seriously cut down on serialisation time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Saving snapshots faster
&lt;/h2&gt;

&lt;p&gt;When we call &lt;code&gt;create_snapshot&lt;/code&gt; on the Firecracker VM, it takes about 1 second per gigabyte to write the memory snapshot file. Meaning that if you have a VM with 12GB of memory, it would take 12 seconds to create the snapshot. Sadly, if you're looking at a sandbox, and you press fork, you would have to wait at least 12 seconds before you could open the new sandbox.&lt;/p&gt;

&lt;p&gt;We need to find a way to make the creation of a snapshot faster, down to less than a second, but how?&lt;/p&gt;

&lt;p&gt;In this case, we're restricted by I/O. Most time is spent on writing the memory file. Even if we throw many NVMe drives at the problem, it still will take more than a couple seconds to write the memory snapshot. We need to find a way where we don't have to write so many bytes to disk.&lt;/p&gt;

&lt;p&gt;We've tried plenty of approaches. We tried incremental snapshotting, sparse snapshotting, compression. In the end, we found a solution that reduced our timings tenfold—but to explain it, we first need to understand how Firecracker saves a snapshot.&lt;/p&gt;

&lt;p&gt;When Firecracker loads a memory snapshot for a VM, it does not read the whole file into memory. If it would read the whole file, it would take much longer to resume a VM from hibernation.&lt;/p&gt;

&lt;p&gt;Instead, Firecracker uses &lt;a href="https://man7.org/linux/man-pages/man2/mmap.2.html"&gt;&lt;code&gt;mmap&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;mmap&lt;/code&gt; is a Linux syscall that creates a “mapping” of a given file to memory. This means that the file is not loaded directly into memory, but there is a reservation in memory saying “this part of the memory corresponds to this file on disk”.&lt;/p&gt;

&lt;p&gt;Whenever we try to read from this memory region, the kernel will first check if the memory is already loaded. If that's not the case, it will “page fault”. During a page fault, the kernel will read the corresponding data from the&lt;br&gt;
backing file (our memory snapshot), load that into memory, and return it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hH8V1-Ve--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codesandbox.io/static/245a01b725e3018f310141b6601227ce/10439/mmap-invert.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hH8V1-Ve--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codesandbox.io/static/245a01b725e3018f310141b6601227ce/10439/mmap-invert.png" alt="Example of mmap reading from a file" width="880" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The most impressive thing about this is that by using &lt;code&gt;mmap&lt;/code&gt;, we will only load parts of the file into memory that are actually read. This allows VMs to resume quickly, because a resume only requires 300-400MB of memory.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It's pretty interesting to see how much memory most VMs actually read after a resume. It turns out that most VMs load less than 1GB into memory. Inside the VM it will actually say that 3-4GB is used, but most of that memory is still stored on disk, not actually stored in memory.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So what happens if you write to memory? Does it get synced back to the memory file? By default, no. Normally, the changes are kept in memory, and are not synced to the backing file. The changes are only synced back when we call &lt;code&gt;create_snapshot&lt;/code&gt;, which often results in saves that are 1-2GB in size. This takes too long to write.&lt;/p&gt;

&lt;p&gt;However, there is a flag we can pass. If we pass &lt;code&gt;MAP_SHARED&lt;/code&gt; to the &lt;code&gt;mmap&lt;/code&gt; call, it actually will sync back changes to the backing file! The kernel does this lazily: whenever it has a bit of time on its hands, it will flush the changes back to the file.&lt;/p&gt;

&lt;p&gt;This is perfect for us, because we can move most of the I/O work of saving the snapshot upfront. When we actually want to save the snapshot, we'll only have to sync back a little amount!&lt;/p&gt;

&lt;p&gt;This seriously reduced our snapshot timings. Here's a graph of the average time it takes to save a memory snapshot, before and after the deployment of this change:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DcoAU3o5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codesandbox.io/static/29ff14980548eecbac4e3a5c890f2a27/10439/save-snapshot-timings-invert.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DcoAU3o5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codesandbox.io/static/29ff14980548eecbac4e3a5c890f2a27/10439/save-snapshot-timings-invert.png" alt="Timings of saving snapshot, showing that after Aug 1 it reduces from 4s to 50ms" width="880" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this change, we went from ~8-12s of saving snapshots to &lt;strong&gt;~30-100ms&lt;/strong&gt;!&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting the clone time down to milliseconds
&lt;/h2&gt;

&lt;p&gt;We can now quickly save a snapshot, but what about cloning? When cloning a memory snapshot, we still need to copy everything byte-for-byte to the new file, which takes again ~8-12s.&lt;/p&gt;

&lt;p&gt;But… do we really have to clone everything byte-for-byte? When we clone a VM, &amp;gt;90% of the data will be reused, since it resumes from the same point. So is there a way that we can reuse the data?&lt;/p&gt;

&lt;p&gt;The answer is in using &lt;a href="https://en.wikipedia.org/wiki/Copy-on-write"&gt;copy-on-write&lt;/a&gt; (CoW). Copy-on-write, like the name implies, will only copy data when we start writing to it. Our previous &lt;code&gt;mmap&lt;/code&gt; example also uses copy-on-write if &lt;code&gt;MAP_SHARED&lt;/code&gt; is not passed.&lt;/p&gt;

&lt;p&gt;By using copy-on-write, we do not copy the data for a clone. Instead, we tell the new VM to use the same data as the old VM. Whenever the new VM needs to make a change to its data, it will copy the data from the old VM and apply the change to that data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0tioKtkJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codesandbox.io/static/b2fcefb2f0a4d4bbbaf96d9049321305/21eb1/cow-invert.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0tioKtkJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codesandbox.io/static/b2fcefb2f0a4d4bbbaf96d9049321305/21eb1/cow-invert.png" alt="Showing a diagram with VM B reading from VM B" width="651" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's an example. Let's say VM B is created from VM A. VM B will directly use all the data from VM A. When VM B wants to make a change to block 3, it will copy block 3 from VM A, and only then apply the change. Whenever it reads from block 3 after this, it will read from its own block 3.&lt;/p&gt;

&lt;p&gt;With copy-on-write, the copies are lazy. We only copy data when we need to mutate it, and this is a perfect fit for our forking model!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a side-note, copy-on-write has been used for a long time already in many places. Some well-known examples of CoW being used are Git (every change is a new object), modern filesystems (&lt;code&gt;btrfs&lt;/code&gt;/ &lt;code&gt;zfs&lt;/code&gt;) and Unix itself (two examples are &lt;code&gt;fork&lt;/code&gt; and &lt;code&gt;mmap&lt;/code&gt;).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This technique does not only make our copies instant, it also saves a lot of disk space. If someone is looking at a sandbox, makes a fork, and only changes a single file, we will only have to save that changed file for the whole fork!&lt;/p&gt;

&lt;p&gt;We use this technique both for our disks (by creating disk CoW snapshots) and for our memory snapshots. It reduced our copy times from several seconds to ~50ms.&lt;/p&gt;
&lt;h2&gt;
  
  
  But… can it clone Minecraft?
&lt;/h2&gt;

&lt;p&gt;By applying copy-on-write and shared &lt;code&gt;mmap&lt;/code&gt;ing of the memory file, we can clone a VM extremely fast. Looking back at the steps, the new timings are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pause the VM &lt;strong&gt;(~16ms)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Save snapshot &lt;strong&gt;(~100ms)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Copy the memory files + disk &lt;strong&gt;(~800ms)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Start new VM from those files &lt;strong&gt;(~400ms)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Which gives us clone timings that are well below two seconds! Here's a fork of Vite (you can try for yourself &lt;a href="http://codesandbox.io/p/github/codesandbox/codesandbox-template-vite-react/main?file=%2FREADME.md"&gt;here&lt;/a&gt;):&lt;/p&gt;


  


&lt;p&gt;The total timings can be seen below. Note that there is more happening than the clone itself, but the total time is still below 2 seconds:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MDJmIoRx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codesandbox.io/static/fca09345b1560616a7089c65ba6a8cff/10439/trace-timings-invert.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MDJmIoRx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://codesandbox.io/static/fca09345b1560616a7089c65ba6a8cff/10439/trace-timings-invert.png" alt="Trace timings from Honeycomb" width="880" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And since we use copy-on-write, it doesn't matter if you're running a big GraphQL service with 20 microservices, or a single node server. We can consistently resume and clone VMs within 2 seconds. No need to wait for a&lt;br&gt;
development server to boot.&lt;/p&gt;

&lt;p&gt;Here's an example where I go to our own repo (running our editor backed by Next.js), fork the &lt;code&gt;main&lt;/code&gt; branch (which copies the VM), and make a change:&lt;/p&gt;


  


&lt;p&gt;We also have &lt;a href="https://twitter.com/CompuIves/status/1554800977798381571"&gt;a Linear integration&lt;/a&gt; that integrates with this.&lt;/p&gt;

&lt;p&gt;We have tested this flow a lot with different development environments. I thought it would be very interesting if we can try cloning more than only development environments.&lt;/p&gt;

&lt;p&gt;So… What if we run a Minecraft server, change something in the world, and then clone it to a new Minecraft server we can connect to? Why not?&lt;/p&gt;

&lt;p&gt;To do this, I've created a VM that runs two Docker containers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A Minecraft Server&lt;/li&gt;
&lt;li&gt;A &lt;a href="https://tailscale.com/"&gt;Tailscale&lt;/a&gt; VPN I can use to connect to the
Minecraft server directly from my PC&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's see!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/9VEiaP8tORQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;In this video, I've created a structure in a Minecraft server. Then cloned that Minecraft server, connected to it, and verified that the structure was there. Then I destroyed the structure, went back to the old server, and verified that the structure was still there.&lt;/p&gt;

&lt;p&gt;Of course, there's no actual benefit to doing this, but it shows that we can clone a VM on any kind of workload!&lt;/p&gt;

&lt;h2&gt;
  
  
  The unwritten details
&lt;/h2&gt;

&lt;p&gt;There are still details that I'd love to write about. Some things we haven't discussed yet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Overprovisioning on memory using &lt;code&gt;mmap&lt;/code&gt; and page cache&lt;/li&gt;
&lt;li&gt;The economics of running MicroVMs when we have hibernation &amp;amp; overprovisioning&lt;/li&gt;
&lt;li&gt;How we built an orchestrator with snapshotting/cloning in mind, and how it
works&lt;/li&gt;
&lt;li&gt;How to handle network and IP duplicates on cloned VMs&lt;/li&gt;
&lt;li&gt;Turning a Dockerfile into a rootfs for the MicroVM (quickly)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are also still improvements we can do to improve the speed of cloning. We still do many API calls sequentially, and the speed of our filesystem (&lt;code&gt;xfs&lt;/code&gt;) can be improved. Currently files inside &lt;code&gt;xfs&lt;/code&gt; get fragmented quickly, due to many random writes.&lt;/p&gt;

&lt;p&gt;Over the upcoming months we'll write more about this. If you have any questions or suggestions related to this, don't hesitate to &lt;a href="https://twitter.com/CompuIves"&gt;send me a message on Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Now that we can clone running VMs quickly, we can enable new workflows where you don't have to wait for development servers to spin up. Together with the GitHub App, you will have a development environment for every PR so you can quickly review (or run end-to-end tests).&lt;/p&gt;

&lt;p&gt;I want to give a huge thanks to the:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Firecracker Team&lt;/strong&gt;: for supporting us on our queries and thinking with us about possible solutions when it comes to running Firecracker and cloning a VM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fly.io Team&lt;/strong&gt;: by sharing their learnings with us directly and through their &lt;a href="https://fly.io/blog/"&gt;amazing blog&lt;/a&gt;. Also big thanks for sharing the source of their &lt;code&gt;init&lt;/code&gt; used in the VMs as reference.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you haven't tried CodeSandbox yet and don't want to wait for dev servers to start anymore, &lt;a href="https://codesandbox.io/p/dashboard"&gt;import/create a repo&lt;/a&gt;. It's free too (we’re working on a post explaining how we can enable this).&lt;/p&gt;

&lt;p&gt;If you want to learn more about CodeSandbox Projects, you can visit &lt;a href="https://projects.codesandbox.io"&gt;projects.codesandbox.io&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;We'll be on &lt;a href="https://twitter.com/codesandbox/"&gt;@codesandbox&lt;/a&gt; on Twitter when we create a new technical post!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Product and Development Best Practices &amp; Values</title>
      <dc:creator>Ives van Hoorne</dc:creator>
      <pubDate>Tue, 23 Jul 2019 12:08:23 +0000</pubDate>
      <link>https://forem.com/compuives/product-and-development-best-practices-values-49cf</link>
      <guid>https://forem.com/compuives/product-and-development-best-practices-values-49cf</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;I wrote this post for the &lt;a href="https://codesandbox.io"&gt;CodeSandbox&lt;/a&gt; team, we're an online code editor that has a big focus on building a user-friendly application. This document serves as a guideline for everyone working on CodeSandbox, but I think it applies to almost any product. This document is never really finished, I'll try to keep it up to date with amendments/additions that may come! Let me know what you think should be added!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;With CodeSandbox we value a fast response time and good product experience. I decided to compile a list of best practices on UI/UX and development (coding) to ensure that we, as a team, can keep these principles. This list is not complete: it only highlights the practices which I find most important. Also, keep in mind that these are guidelines, and might not apply to all scenarios. With this, our product (the app) keeps its feel of good UX/UI and we'll be able to maintain our speed and quality when building CodeSandbox.&lt;/p&gt;

&lt;h2&gt;
  
  
  UX/UI Best Practices
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;With CodeSandbox we want to be an easy to use application with the productivity of a power tool.&lt;/strong&gt; This is quite a challenge, which is why it's good to write down our best practices on UX.&lt;/p&gt;

&lt;p&gt;Some other applications that serve as a good example for us on this front are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Superhuman&lt;/li&gt;
&lt;li&gt;Framer X&lt;/li&gt;
&lt;li&gt;Figma&lt;/li&gt;
&lt;li&gt;Bear&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Alongside these rules I highly recommend reading the &lt;a href="https://fishshell.com/docs/current/design.html"&gt;fish shell design specification&lt;/a&gt;, it's an incredible resource that should be applied on top of these guidelines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Easy for beginners, fast for pro users
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Every feature should be designed for two groups of people with two flows; the "beginners" and the "power users".&lt;/strong&gt; This means that beginners (people who haven't seen the feature before) should be able to find and use it with ease. &lt;strong&gt;Always ask yourself whether the feature is discoverable, not cluttered, and if the intent is clear.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once the feature is clear and familiar for beginners, start looking into how power users can use it faster and try to educate them on this. An example of this is our dependency modal. Adding a dependency can be done with the mouse (easy for beginners), but we also hint that the user can press "enter" and the arrow keys to quickly select the dependency (power user).&lt;/p&gt;

&lt;p&gt;Another example of this is shortcuts. It's important to clearly show users that they can use a shortcut to use the functionality that they've used often with the mouse. Superhuman does this well, they show a small popup at the button saying "You can do X by pressing Y" whenever you use your mouse to do X.&lt;/p&gt;

&lt;p&gt;Feature discovery is tightly related to context. Showing that you can use a shortcut for an action doesn't make sense if the user hasn't used the action yet. Always ask yourself whether it makes sense to show the feature &lt;em&gt;in this context.&lt;/em&gt; &lt;strong&gt;If we show &lt;em&gt;all&lt;/em&gt; possible features and hints at the same time they will all lose meaning.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try to make sure that your feature always works with &amp;amp; without the mouse.&lt;/strong&gt; The mouse is often used when people are still unfamiliar, but after a while people will prefer to not leave the keyboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid Asking Questions
&lt;/h3&gt;

&lt;p&gt;Everything that users can use on CodeSandbox should have defaults. Giving someone a choice before they can use something should be an &lt;strong&gt;absolute last resort&lt;/strong&gt;. &lt;strong&gt;Start with sensible defaults and allow the user to change them later.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Asking a question to the user adds to the mental overhead someone attaches to the product. Asking too many questions will leave an impression that CodeSandbox is an app that requires a lot of thinking, and is actually more work than it saves.&lt;/p&gt;

&lt;p&gt;It's not only mental overhead that makes us want to avoid asking questions, it's also that we're most probably breaking the user out of their flow. If they're coding and want to add a dependency, we should not ask them to add it to "dependencies" or "devDependencies". If we know that 80% of the time they want it added to dependencies we should do that by default. Asking a question will break the train of thoughts, and thus break a flow. This is also why we should always think twice before adding a modal, modals often break the current flow.&lt;/p&gt;

&lt;p&gt;This does not mean that we shouldn't make it possible to use advanced settings. When we start with sensible defaults (preferably based on their context, like sandbox type) we should still give the option to do advanced configuration. People that want an unconventional setting are already prepared to look deeper and tackle configuration.&lt;/p&gt;

&lt;p&gt;One of the reasons that CodeSandbox exists is because we assume the build system for the user, so they won't have to think about it unless they explicitly want to. We need to pursue this ideal to all our UX decisions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clean UI
&lt;/h3&gt;

&lt;p&gt;Always try to keep the number of buttons and choices as low as possible. Every button added is another new choice for someone to think about, and most users will bail out if they have too much choice. We don't want to become Eclipse. There is a balance here to be made, &lt;strong&gt;for every button added the other buttons will lose a bit of meaning&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is related to feature discoverability, we should only make a feature discoverable if it actually applies to the current scenario (context). Showing all features at all times would only serve as clutter and overwhelm (and no feature will be discovered...).&lt;/p&gt;

&lt;h3&gt;
  
  
  Animations
&lt;/h3&gt;

&lt;p&gt;Animations are great! When used well they can help with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Awareness

&lt;ul&gt;
&lt;li&gt;Where did this item come from?&lt;/li&gt;
&lt;li&gt;Did this button just change its state?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Overall Look &amp;amp; Feel

&lt;ul&gt;
&lt;li&gt;I enjoy pressing this button because of its smooth animations&lt;/li&gt;
&lt;li&gt;This application feels very polished because of the last 10% polish in animations&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=Z2d9rw9RwyE"&gt;This talk&lt;/a&gt; by &lt;a href="https://twitter.com/JoshWComeau"&gt;Joshua Comeau&lt;/a&gt; describes this really well&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Making waiting more enjoyable

&lt;ul&gt;
&lt;li&gt;When you need to wait for something, seeing an animation is far more fun than looking at a blank/static screen&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And also important, they are fun to make! It's an artistic side to frontend development that many enjoy.&lt;/p&gt;

&lt;p&gt;There is also the other side to this story. Animations are very pleasant in general, but if you overdo them the UI can feel more sluggish and slow. &lt;strong&gt;Think twice before adding an animation on "hot paths", which are actions that someone needs to do often and quickly.&lt;/strong&gt; For example, making the hover in the file explorer a transition of background color will make the file explorer feel slow and sluggish instead of fast and snappy.&lt;/p&gt;

&lt;p&gt;There is no rule of thumb that you can follow here, you need to feel for yourself if an animation will enrich the interaction or make it feel sluggish.&lt;/p&gt;

&lt;h2&gt;
  
  
  Development Best Practices
&lt;/h2&gt;

&lt;p&gt;These best practices will make sure that it's easy for everyone to build and add functionality easily to the code base. The goal here is to have a fast turnaround time and quick experimentation, if you want to test something by adding a new feature that should be possible with minimal outside help.&lt;/p&gt;

&lt;h3&gt;
  
  
  Boy Scout Rule
&lt;/h3&gt;

&lt;p&gt;The boy scouts have a rule: “Always leave the campground cleaner than you found it.” If you find a mess on the ground, you clean it up regardless of who might have made it. You intentionally improve the environment for the next group of campers.&lt;/p&gt;

&lt;p&gt;The same is applicable to software development. Try to leave code in a better state than it was when you worked on it. There is no shame into fixing someone else's code, which brings me to the next point.&lt;/p&gt;

&lt;h3&gt;
  
  
  Code is shared by everyone
&lt;/h3&gt;

&lt;p&gt;All the code that you write is shared by everyone, and this applies to everyone. There is no code ownership. Whenever you see a bug in code that you haven't written, or you want a new feature in an unfamiliar codebase, don't hesitate to work on that code and open a pull request!&lt;/p&gt;

&lt;p&gt;If the change is very big, or you don't understand why the code is written the way it's written, also don't hesitate to ask the last author of the code before getting your hands dirty.&lt;/p&gt;

&lt;h3&gt;
  
  
  Move fast, always create an MVP first
&lt;/h3&gt;

&lt;p&gt;Whenever you start working on a new feature, think about what the smallest thing is that you can build and deploy. Build that first and see how people use it. &lt;strong&gt;Don't overengineer and think of how people will possibly use it, try to build a basic version first and deploy it.&lt;/strong&gt; Based on the usage you will know how people actually use it.&lt;/p&gt;

&lt;p&gt;This doesn't mean that you shouldn't polish your MVP. Don't build something that's not polished. There is a difference between the size of a feature and how polished it is. People won't use an unpolished feature as much as a polished feature, the results from their usage will be skewed.&lt;/p&gt;

&lt;p&gt;There are multiple examples where we applied this in CodeSandbox:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The browser bundler: the first version only supported JavaScript (no CSS) and didn't support more advanced features like &lt;code&gt;import()&lt;/code&gt;. Based on the usage of the basic bundler we were able to prioritize and design a new bundler that supported more options.&lt;/li&gt;
&lt;li&gt;The editor: the initial editor didn't have support for basic things like tabs, linting, autocomplete, type checking. Based on the response from the users we knew what to add first. &lt;strong&gt;We were able to prioritize based on feature requests.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember that you only have to design your feature for your current requirement set. There's no need to overengineer and predict how people could possibly use the feature. This is a waste of time and resources, and will often result in a development block.&lt;/p&gt;

&lt;h3&gt;
  
  
  Only refactor what you work on, keep the changes small
&lt;/h3&gt;

&lt;p&gt;There is a huge cost to doing a refactor. It's a time sink, because all code that's rewritten needs to be reviewed and tested thoroughly for regressions. Even if it's tested thoroughly there's still a chance that bugs seep into the new refactor. Additionally, it's a source of merge conflicts for other people working on the same code. Automated testing and types help here, but you can't assume that these cover everything. &lt;strong&gt;Avoid full refactors, unless it's absolutely needed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because of the huge cost, it's often not wise to do a refactor. The only time we should do refactors is when the benefits outweigh the costs significantly. Think of benefits like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Performance increase&lt;/li&gt;
&lt;li&gt;Much, but really MUCH better code readability (code re-use &amp;amp; improved onboarding)&lt;/li&gt;
&lt;li&gt;New enabled functionality/flexibility&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the benefits outweigh the costs significantly; try to keep the refactors as small as possible. Follow the MVP approach and never rewrite a huge part of the codebase all at once, this will allow us to keep the costs as low as possible.&lt;/p&gt;

&lt;p&gt;Of course, refactors need to happen from time to time. Refactors make a lot of sense if you are already working on the code you're planning to refactor, we can refer to the Boy Scout Rule again with this. Because you are planning on testing the functionality anyway, the cost of doing a refactor is significantly lower if you're refactoring the code that you're already working on.&lt;/p&gt;




&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;These are my most important best practices, I'm also curious about what you find important. What could be added to this list?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ui</category>
      <category>ux</category>
      <category>bestpractices</category>
    </item>
  </channel>
</rss>
