-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into feat/platform-on-expr…
…essions * origin/main: Use the right extension syntax on promise.js (#194) Battle test RSC with Suspense + client components (#190) Move ppx transformation to function body (not last expression) (#192) fix: format missing mel.raw chore: update reason to 3.14 Update README.md
- Loading branch information
Showing
30 changed files
with
676 additions
and
473 deletions.
There are no files selected for viewing
This file contains 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 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 was deleted.
Oops, something went wrong.
This file contains 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 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,40 @@ | ||
import React from "react"; | ||
import { renderToPipeableStream } from "react-server-dom-webpack/server"; | ||
|
||
const DefferedComponent = async ({ sleep, children }) => { | ||
await new Promise((res) => setTimeout(() => res(), sleep * 1000)); | ||
return <span>Sleep {sleep}s, {children}</span>; | ||
}; | ||
|
||
const decoder = new TextDecoder(); | ||
|
||
const debug = (readableStream) => { | ||
const reader = readableStream.getReader(); | ||
const debugReader = ({ done, value }) => { | ||
if (done) { | ||
console.log("Stream complete"); | ||
return; | ||
} | ||
console.log(decoder.decode(value)); | ||
console.log(" "); | ||
return reader.read().then(debugReader); | ||
}; | ||
reader.read().then(debugReader); | ||
}; | ||
|
||
const sleep = (seconds) => | ||
new Promise((res) => setTimeout(res, seconds * 1000)); | ||
|
||
const App = () => ( | ||
<React.Suspense fallback="Fallback 1"> | ||
<DefferedComponent sleep={1}> | ||
<React.Suspense fallback="Fallback 2"> | ||
<DefferedComponent sleep={1}>"lol"</DefferedComponent> | ||
</React.Suspense> | ||
</DefferedComponent> | ||
</React.Suspense> | ||
); | ||
|
||
const { pipe } = renderToPipeableStream(<App />); | ||
|
||
pipe(process.stdout); |
This file contains 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 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 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 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 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 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 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,11 @@ | ||
[@react.component] | ||
let make = () => { | ||
<hr | ||
className={Cx.make([ | ||
"block", | ||
"w-full", | ||
"h-px", | ||
Theme.border("gray-700"), | ||
])} | ||
/>; | ||
}; |
Oops, something went wrong.