The Sandbox/Editing Environment is the core workspace where you’ll build and edit your web application’s code. It combines a powerful code editor with a live preview system, allowing you to see your changes in real-time.
When you work in the CodeNull environment, code is often generated after:
Confirming website details and pages in the chat interface
Making calls to the chat-completion API
Using the AI assistant to generate components
This generated code is then processed through our in-browser compiler, which goes through three major stages:
1
JSX/TSX Transformation
The compiler converts JSX/TSX code into executable JavaScript using esbuild, a fast JavaScript bundler and minifier. JSX (JavaScript XML) and TSX (TypeScript XML) are extensions of JavaScript and TypeScript that allow developers to write HTML-like syntax within their JavaScript code. Since browsers cannot execute JSX/TSX directly, esbuild converts it into standard JavaScript that the browser can understand.
2
HTML Template Integration
The generated JavaScript code is embedded into a predefined HTML template. This template contains everything the application needs to function properly, including libraries, stylesheets, and other assets. The HTML template serves as the container where the dynamic JavaScript code is inserted, ensuring proper loading and organization of each element.
3
Sandbox Execution
The complete code (HTML, JavaScript, and all dependencies) is injected into an iframe or sandbox environment. This ensures the compiled code runs in a controlled, isolated context that cannot conflict with other parts of the application or website. This isolation allows for testing directly within the browser with smooth execution and display of the compiled code.
This entire process happens automatically and nearly instantaneously as you type or when code is generated, providing a seamless development experience.