From fc907e2f81698d89502fb2ee0375e6d98a492c13 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Thu, 9 Sep 2021 23:33:34 -0700 Subject: current --- .../bun-framework-next/renderDocument.tsx | 722 --------------------- 1 file changed, 722 deletions(-) delete mode 100644 examples/hello-next/bun-framework-next/renderDocument.tsx (limited to 'examples/hello-next/bun-framework-next/renderDocument.tsx') diff --git a/examples/hello-next/bun-framework-next/renderDocument.tsx b/examples/hello-next/bun-framework-next/renderDocument.tsx deleted file mode 100644 index 356ff788b..000000000 --- a/examples/hello-next/bun-framework-next/renderDocument.tsx +++ /dev/null @@ -1,722 +0,0 @@ -import * as App from "next/app"; -import { AmpStateContext } from "next/dist/shared/lib/amp-context"; -import { HeadManagerContext } from "next/dist/shared/lib/head-manager-context"; -import Loadable from "next/dist/shared/lib/loadable"; -import { LoadableContext } from "next/dist/shared/lib/loadable-context"; -import { RouterContext } from "next/dist/shared/lib/router-context"; -import { NextRouter } from "next/dist/shared/lib/router/router"; -import { - AppType, - ComponentsEnhancer, - DocumentInitialProps, - DocumentProps, - DocumentType, - getDisplayName, - loadGetInitialProps, - NextComponentType, - RenderPage, - RenderPageResult, - HtmlContext, -} from "next/dist/shared/lib/utils"; -import * as NextDocument from "next/document"; -import * as ReactDOMServer from "react-dom/server.browser"; -import * as url from "url"; -import * as React from "react"; -import * as ReactIs from "react-is"; -import { BODY_RENDER_TARGET } from "next/constants"; - -const dev = process.env.NODE_ENV === "development"; - -type ParsedUrlQuery = Record; - -const isJSFile = (file: string) => - file.endsWith(".js") || - file.endsWith(".jsx") || - file.endsWith(".mjs") || - file.endsWith(".ts") || - file.endsWith(".tsx"); - -const notImplementedProxy = (base) => - new Proxy( - {}, - { - deleteProperty: function (target, prop) { - return undefined; - }, - enumerate: function (oTarget, sKey) { - return [].entries(); - }, - ownKeys: function (oTarget, sKey) { - return [].values(); - }, - has: function (oTarget, sKey) { - return false; - }, - defineProperty: function (oTarget, sKey, oDesc) { - return undefined; - }, - getOwnPropertyDescriptor: function (oTarget, sKey) { - return undefined; - }, - get(this, prop) { - throw new ReferenceError( - `${base} is not available for this environment.` - ); - }, - set(this, prop, value) { - throw new ReferenceError( - `${base} is not available for this environment.` - ); - }, - } - ); - -globalThis.fetch = (url, options) => { - return Promise.reject(new Error(`fetch is not implemented yet. sorry!!`)); -}; - -function getScripts(files: DocumentFiles) { - const { context, props } = this; - const { - assetPrefix, - buildManifest, - isDevelopment, - devOnlyCacheBusterQueryString, - disableOptimizedLoading, - } = context; - const normalScripts = files.allFiles.filter(isJSFile); - const lowPriorityScripts = buildManifest.lowPriorityFiles?.filter(isJSFile); - - return [...normalScripts, ...lowPriorityScripts].map((file) => { - return ( -