Skip to content

Commit

Permalink
docs: move nodebox page (#736)
Browse files Browse the repository at this point in the history
  • Loading branch information
danilowoz committed Feb 20, 2023
1 parent e916795 commit affdbd5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 32 deletions.
2 changes: 1 addition & 1 deletion website/docs/src/pages/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"index": "Introduction",
"getting-started": "Getting Started",
"nodebox": "Nodebox",

"advanced-usage": "Advanced Usage",

"guides": { "title": "Guides", "collapsed": true },
Expand Down
1 change: 1 addition & 0 deletions website/docs/src/pages/advanced-usage/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"components": "Components",
"hooks": "Hooks",
"client": { "title": "Sandpack Client", "label": "JS" },
"nodebox": { "title": "Nodebox", "label": "JS" },
"bundlers": "Experimental bundler (beta)"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
import Hero from "../../components/Hero";
import { Callout, Tabs, Tab } from "nextra-theme-docs";
import { CodeBlock } from "../../components/CodeBlock";

# Install Nodebox
<Hero
title="Nodebox"
subtitle="Run Node in any browser."
/>

Nodebox is a runtime for executing Node.js code in the browser. Sandpack 2.0 uses Nodebox to run server-side examples directly in the browser. For example, you can run a Vite template such as React and Vue directly on your website.

You can use Nodebox as an [NPM package](https://www.npmjs.com/package/@codesandbox/nodebox) or together with [Sandpack 2.0](/getting-started).

## Server-side support

Nodebox with out-of-the-box support for Next.js, Vite and Astro, but we’re growing to support just about any server-side framework you can imagine.

However, bear in mind it can’t run napi or any other low-level C++/Rust package you can use in Node.js—only WebAssembly and JavaScript modules. Postgres, MongoDB and MySQL are also currently not supported because of the lack of raw socket support in browsers.


## Difference with WebContainers

Web Containers use modern browser technologies like `SharedArrayBuffer`, which makes it impossible to run in Safari and requires the user to set additional `Cross-Origin-Isolation` headers on the server to run any code.

Nodebox however, is implemented without modern browser technologies, to make it run in any browser (like iOS and Safari) with minimal setup.

For further details, check the [Nodebox FAQ](https://sandpack.codesandbox.io/docs/resources/faq#how-does-the-nodebox-compare-to-webcontainers).

## Install Nodebox

<Tabs items={["npm", "yarn"]}>
<Tab>
Expand Down
3 changes: 0 additions & 3 deletions website/docs/src/pages/nodebox/_meta.json

This file was deleted.

26 changes: 0 additions & 26 deletions website/docs/src/pages/nodebox/index.mdx

This file was deleted.

1 comment on commit affdbd5

@vercel
Copy link

@vercel vercel bot commented on affdbd5 Feb 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sandpack-docs – ./website/docs

sandpack-docs-git-main-codesandbox1.vercel.app
sandpack.vercel.app
sandpack-docs-codesandbox1.vercel.app

Please sign in to comment.