Skip to content

Conversation

danilowoz
Copy link
Contributor

@danilowoz danilowoz commented Dec 12, 2023

This solves the issue that users can't download a runnable sandbox from CodeSandbox. Closes #6482

Since we introduced the new editor, we had to make some changes to make templates easier to maintain and make them compatible with our microVM solution. Consequently, we had to remove some custom rules applied to the sandbox files before downloading them. For example, in the react template, we used to include scripts, dependencies, missing files, and move all files to src.

With this PR, we move the responsibility of providing all files and a runnable sandbox to react.dev, instead of relying on hidden layers inside CodeSandbox download logic. As a result, react.dev can now easily upgrade/download react dependencies, provide the minimal amount of files to run a React.js project and keep it transparent, avoiding any future headache.

Preview

Copy link

github-actions bot commented Dec 12, 2023

Size changes

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

Three Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/404 77.36 KB (🟡 +37 B) 181.17 KB
/500 77.35 KB (🟡 +37 B) 181.17 KB
/[[...markdownPath]] 78.95 KB (🟡 +37 B) 182.76 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Remove console.log(filePath); from createFileMap.ts
@mattcarrollcode mattcarrollcode self-requested a review December 12, 2023 21:51
Update file paths in Sandpack components to use root folder and variables
@mattcarrollcode mattcarrollcode merged commit e98c393 into reactjs:main Dec 13, 2023
@danilowoz danilowoz deleted the draft/flamboyant-rain branch December 14, 2023 08:48
geeseyj added a commit to geeseyj/react.dev that referenced this pull request Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download codesandbox broken in Beta editor
4 participants