aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demos/hello-next/bun-framework-next/client.development.tsx14
-rw-r--r--demos/hello-next/bun-framework-next/package.json3
-rw-r--r--demos/hello-next/bun-framework-next/server.development.tsx16
-rw-r--r--demos/hello-next/components/Title.tsx3
-rw-r--r--demos/hello-next/package.json3
-rw-r--r--demos/hello-next/pages/_app.tsx (renamed from demos/hello-next/pages/_app.js)0
-rw-r--r--demos/hello-next/pages/api/hello.tsx (renamed from demos/hello-next/pages/api/hello.js)0
-rw-r--r--demos/hello-next/pages/blue.tsx9
-rw-r--r--demos/hello-next/pages/index.tsx (renamed from demos/hello-next/pages/index.js)11
9 files changed, 54 insertions, 5 deletions
diff --git a/demos/hello-next/bun-framework-next/client.development.tsx b/demos/hello-next/bun-framework-next/client.development.tsx
index d046751b2..c4346913d 100644
--- a/demos/hello-next/bun-framework-next/client.development.tsx
+++ b/demos/hello-next/bun-framework-next/client.development.tsx
@@ -1,3 +1,13 @@
+var onlyChildPolyfill = React.Children.only;
+React.Children.only = function (children) {
+ if (children && typeof children === "object" && children.length == 1) {
+ return onlyChildPolyfill(children[0]);
+ }
+
+ return onlyChildPolyfill(children);
+};
+
+globalThis.global = globalThis;
import * as ReactDOM from "react-dom";
import App from "next/app";
import mitt, { MittEmitter } from "next/dist/shared/lib/mitt";
@@ -21,7 +31,7 @@ import {
NEXT_DATA,
ST,
} from "next/dist/shared/lib/utils";
-import { Portal } from "next/dist/client/portal";
+// import { Portal } from "next/dist/client/portal";
import initHeadManager from "next/dist/client/head-manager";
import PageLoader, { StyleSheetTuple } from "next/dist/client/page-loader";
import measureWebVitals from "next/dist/client/performance-relayer";
@@ -187,7 +197,7 @@ let CachedComponent: React.ComponentType;
function _boot(EntryPointNamespace) {
const PageComponent = EntryPointNamespace.default;
-
+
ReactDOM.hydrate(
<Container fn={(error) => <div>{JSON.stringify(error)}</div>}>
<App Component={PageComponent} pageProps={data.props}></App>
diff --git a/demos/hello-next/bun-framework-next/package.json b/demos/hello-next/bun-framework-next/package.json
index 02377e339..7aa47a88f 100644
--- a/demos/hello-next/bun-framework-next/package.json
+++ b/demos/hello-next/bun-framework-next/package.json
@@ -68,5 +68,6 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
- "license": "ISC"
+ "license": "ISC",
+ "dependencies": {}
}
diff --git a/demos/hello-next/bun-framework-next/server.development.tsx b/demos/hello-next/bun-framework-next/server.development.tsx
index 54181c271..82caf0ab7 100644
--- a/demos/hello-next/bun-framework-next/server.development.tsx
+++ b/demos/hello-next/bun-framework-next/server.development.tsx
@@ -1,3 +1,19 @@
+import React from "react";
+class URL {
+ constructor(base, source) {
+ this.pathname = source;
+ this.href = base + source;
+ }
+}
+var onlyChildPolyfill = React.Children.only;
+React.Children.only = function (children) {
+ if (children && typeof children === "object" && children.length == 1) {
+ return onlyChildPolyfill(children[0]);
+ }
+
+ return onlyChildPolyfill(children);
+};
+globalThis.URL = URL;
globalThis.global = globalThis;
import { render } from "./renderDocument";
diff --git a/demos/hello-next/components/Title.tsx b/demos/hello-next/components/Title.tsx
new file mode 100644
index 000000000..10636164f
--- /dev/null
+++ b/demos/hello-next/components/Title.tsx
@@ -0,0 +1,3 @@
+export default function Title() {
+ return <h1>Hello</h1>;
+}
diff --git a/demos/hello-next/package.json b/demos/hello-next/package.json
index 8309b88eb..fd803c98a 100644
--- a/demos/hello-next/package.json
+++ b/demos/hello-next/package.json
@@ -7,6 +7,7 @@
"next": "^11.1.0",
"path": "^0.12.7",
"react": "^17.0.2",
- "react-dom": "^17.0.2"
+ "react-dom": "^17.0.2",
+ "whatwg-url": "^9.1.0"
}
}
diff --git a/demos/hello-next/pages/_app.js b/demos/hello-next/pages/_app.tsx
index 2fc3e0700..2fc3e0700 100644
--- a/demos/hello-next/pages/_app.js
+++ b/demos/hello-next/pages/_app.tsx
diff --git a/demos/hello-next/pages/api/hello.js b/demos/hello-next/pages/api/hello.tsx
index df63de88f..df63de88f 100644
--- a/demos/hello-next/pages/api/hello.js
+++ b/demos/hello-next/pages/api/hello.tsx
diff --git a/demos/hello-next/pages/blue.tsx b/demos/hello-next/pages/blue.tsx
new file mode 100644
index 000000000..fe72a744f
--- /dev/null
+++ b/demos/hello-next/pages/blue.tsx
@@ -0,0 +1,9 @@
+import Link from "next/link";
+
+export default function Blue({}) {
+ return (
+ <div>
+ <h1>Blue</h1>
+ </div>
+ );
+}
diff --git a/demos/hello-next/pages/index.js b/demos/hello-next/pages/index.tsx
index 4db0d5ae6..2866bad51 100644
--- a/demos/hello-next/pages/index.js
+++ b/demos/hello-next/pages/index.tsx
@@ -1,6 +1,9 @@
import Head from "next/head";
import Image from "next/image";
import styles from "../styles/Home.module.css";
+import Link from "next/link";
+
+import Title from "../components/Title";
export default function Home() {
return (
@@ -13,9 +16,15 @@ export default function Home() {
<main className={styles.main}>
<h1 className={styles.title}>
- Welcome to <a href="https://nextjs.org">Next.js!</a>
+ Welcom <a href="https://nextjs.org">Next.js!</a>
</h1>
+ <Title />
+
+ <Link href="/blue">
+ <a>Blue page</a>
+ </Link>
+
<p className={styles.description}>
Get started by editing{" "}
<code className={styles.code}>pages/index.js</code>
/www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner 7-6/+13 2023-05-21Fix testGravatar Jarred Sumner 1-10/+10 2023-05-21[internal] Even more loggingGravatar Jarred Sumner 1-3/+5 2023-05-21[internal] Use `HiveArray` instead of bespoke memory allocator in Bun.serve()Gravatar Jarred Sumner 2-89/+14 2023-05-21Fix assertion failureGravatar Jarred Sumner 1-1/+1 2023-05-21oopsieGravatar Jarred Sumner 1-1/+1 2023-05-21WS send with callback (#2986)Gravatar Ciro Spaciari 3-44/+39 2023-05-21[Bun.serve] Support `"nodebuffer"` binaryType in `ServerWebSocket`Gravatar Jarred Sumner 4-77/+122 2023-05-21[WebSocket] Implement `"nodebuffer"` binaryTypeGravatar Jarred Sumner 5-5/+125 2023-05-21[ws client] Make it a little more type safeGravatar Jarred Sumner 1-33/+51 2023-05-21[internal] Add more debug logs for uwsGravatar Jarred Sumner 2-3/+8 2023-05-21[internal] Add a 0 byte to EOF read files as a precautionGravatar Jarred Sumner 1-1/+5 2023-05-21[internal] Make AbortSIgnal usage slightly saferGravatar Jarred Sumner 3-6/+11 2023-05-21Add extra flag just to be sureGravatar Jarred Sumner 1-1/+1 2023-05-21[internal] Fix potential missing callbacks in AbortSignalGravatar Jarred Sumner 2-208/+2