-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into jarred/fix-double-ref
- Loading branch information
Showing
18 changed files
with
306 additions
and
29 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 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
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,37 @@ | ||
import { renderToReadableStream } from "react-dom/server.browser"; | ||
|
||
const HelloWorld = () => { | ||
return <div>Hello World</div>; | ||
}; | ||
|
||
const stream = new Response(await renderToReadableStream(<HelloWorld />)); | ||
|
||
console.log(await stream.text()); | ||
|
||
if (!process.env.NO_BUILD) { | ||
const self = await Bun.build({ | ||
entrypoints: [import.meta.path], | ||
define: { | ||
"process.env.NODE_ENV": JSON.stringify(process.env.CHILD_NODE_ENV), | ||
"process.env.NO_BUILD": "1", | ||
}, | ||
}); | ||
const code = await self.outputs[0].text(); | ||
let shouldHaveJSXDev = process.env.CHILD_NODE_ENV === "development"; | ||
let shouldHaveJSX = process.env.CHILD_NODE_ENV === "production"; | ||
|
||
if (shouldHaveJSXDev) { | ||
if (!code.includes("jsx_dev_runtime.jsxDEV")) { | ||
throw new Error("jsxDEV is not included"); | ||
} | ||
} | ||
|
||
if (shouldHaveJSX) { | ||
if (!code.includes("jsx_runtime.jsx")) { | ||
throw new Error("Jsx is not included"); | ||
} | ||
} | ||
|
||
const url = URL.createObjectURL(self.outputs[0]); | ||
await import(url); | ||
} |
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,6 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"jsx": "react-jsxdev" | ||
} | ||
} |
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 @@ | ||
import "./jsx-production"; |
Oops, something went wrong.