-
Notifications
You must be signed in to change notification settings - Fork 7.8k
fix(sandpack-template): use custom react sandpack template #6484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sandpack-template): use custom react sandpack template #6484
Conversation
Size changes📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 Three Pages Changed SizeThe following pages changed size from the code in this PR compared to its base branch:
DetailsOnly 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 Any third party scripts you have added directly to your app using the 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
Update file paths in Sandpack components to use root folder and variables
…eactjs#6484)" This reverts commit e98c393.
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