-
Notifications
You must be signed in to change notification settings - Fork 7.8k
[beta] Sandpack - new bundler #4458
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a799653
add new bundle for testing
danilowoz 3538e01
add timer
danilowoz 44d2b8d
update url
danilowoz 26ac740
update bundler version
danilowoz 826df98
Remove temporary code
gaearon a17c792
Merge branch 'main' into new-bundler
gaearon 0e4a3d8
Fix lint
gaearon 4889245
why?
danilowoz df862bd
testing bundler url
danilowoz 09ed276
uncaught exception handling
danilowoz e36cd2a
catch global errors on new bundler
danilowoz 37b6be3
Try latest bundler
gaearon ea6ffc0
Merge branch 'main' into new-bundler
gaearon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 12.16.1 | ||
| 12.22.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import {useEffect, useState} from 'react'; | ||
|
|
||
| /** | ||
| * Temp component: testing purposes only | ||
| */ | ||
| export const NewBundlerToggle = () => { | ||
| const [state, setState] = useState(false); | ||
|
|
||
| useEffect(() => { | ||
| setState(window.localStorage.getItem('sandpack-new-bundler') === 'true'); | ||
| }, []); | ||
|
|
||
| const onChange = () => { | ||
| const value = window.localStorage.getItem('sandpack-new-bundler'); | ||
|
|
||
| window.localStorage.setItem( | ||
| 'sandpack-new-bundler', | ||
| value === 'true' ? 'false' : 'true' | ||
| ); | ||
|
|
||
| window.location.reload(); | ||
| }; | ||
|
|
||
| return ( | ||
| <label> | ||
| <input onChange={onChange} checked={state} type="checkbox" /> Active new | ||
| bundler (for all pages) | ||
| </label> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import {NewBundlerToggle} from '../components/MDX/Sandpack/NewBundlerToggle'; | ||
|
|
||
| # New Sandpack bundler testing | ||
|
|
||
| <NewBundlerToggle /> | ||
|
|
||
| <Sandpack> | ||
|
|
||
| ```js | ||
| function Text() { | ||
| return <p>Lorem ipsum</p>; | ||
| } | ||
|
|
||
| export default function App() { | ||
| return ( | ||
| <section> | ||
| <h1>Test</h1> | ||
| <Text /> | ||
| <Text /> | ||
| <Text /> | ||
| </section> | ||
| ); | ||
| } | ||
| ``` | ||
|
|
||
| </Sandpack> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5044,6 +5044,11 @@ [email protected]: | |
| dependencies: | ||
| object-assign "^4.1.1" | ||
|
|
||
| use-timer@^2.0.1: | ||
| version "2.0.1" | ||
| resolved "https://registry.yarnpkg.com/use-timer/-/use-timer-2.0.1.tgz#eef400a83e3fa4af9896fdd6d07d34f676e9373c" | ||
| integrity sha512-ESFkDYZluJZ+G/CaoOBFxg0TjuG7kgNFNhIFZhqv14ho2WIZwuxkRnEURhyLm9I4vNz+ea9ZowNaOkExDAM+6Q== | ||
|
|
||
| util-deprecate@^1.0.2: | ||
| version "1.0.2" | ||
| resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.