mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 21:32:05 +00:00
remove a bunch of dead code / unused variables
This commit is contained in:
@@ -59,7 +59,6 @@ declare global {
|
||||
function nextDataFromBunData() {
|
||||
const {
|
||||
router: { routes, route, params: paramsList },
|
||||
problems,
|
||||
} = globalThis.__BUN_DATA__;
|
||||
|
||||
const paramsMap = new Map();
|
||||
@@ -100,13 +99,13 @@ type RenderRouteInfo = PrivateRouteInfo & {
|
||||
App: AppComponent;
|
||||
scroll?: { x: number; y: number } | null;
|
||||
};
|
||||
type RenderErrorProps = Omit<RenderRouteInfo, "Component" | "styleSheets">;
|
||||
|
||||
const nextDataTag = document.getElementById("__NEXT_DATA__");
|
||||
|
||||
const data: typeof window["__NEXT_DATA__"] = nextDataTag
|
||||
? JSON.parse(document.getElementById("__NEXT_DATA__")!.textContent!)
|
||||
: nextDataFromBunData();
|
||||
|
||||
window.__NEXT_DATA__ = data;
|
||||
|
||||
const {
|
||||
@@ -151,8 +150,6 @@ const headManager: {
|
||||
} = initHeadManager();
|
||||
const appElement: HTMLElement | null = document.getElementById("__next");
|
||||
|
||||
let lastRenderReject: (() => void) | null;
|
||||
let webpackHMR: any;
|
||||
export let router: Router;
|
||||
let CachedApp: AppComponent = App,
|
||||
onPerfEntry: (metric: any) => void;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import { insertStyleSheet } from "./page-loader";
|
||||
import type {
|
||||
FallbackMessageContainer,
|
||||
FallbackStep,
|
||||
} from "../../../src/api/schema";
|
||||
import type { FallbackMessageContainer } from "../../../src/api/schema";
|
||||
|
||||
var once = false;
|
||||
function insertNextHeadCount() {
|
||||
@@ -30,13 +27,9 @@ document.addEventListener("onimportcss", insertGlobalStyleSheet, {
|
||||
passive: true,
|
||||
});
|
||||
|
||||
import { renderError, _boot, pageLoader } from "./client.development";
|
||||
import { _boot, pageLoader } from "./client.development";
|
||||
|
||||
function renderFallback({
|
||||
router,
|
||||
reason,
|
||||
problems,
|
||||
}: FallbackMessageContainer) {
|
||||
function renderFallback({ router }: FallbackMessageContainer) {
|
||||
const route = router.routes.values[router.route];
|
||||
|
||||
if (!document.getElementById("__next")) {
|
||||
|
||||
@@ -69,7 +69,7 @@ export default class PageLoader extends NextPageLoader {
|
||||
);
|
||||
};
|
||||
|
||||
prefetch(route) {
|
||||
prefetch() {
|
||||
return Promise.resolve({});
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
} 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";
|
||||
@@ -78,8 +77,8 @@ function getScripts(files: DocumentFiles) {
|
||||
buildManifest,
|
||||
isDevelopment,
|
||||
devOnlyCacheBusterQueryString,
|
||||
disableOptimizedLoading,
|
||||
} = context;
|
||||
|
||||
const normalScripts = files.allFiles.filter(isJSFile);
|
||||
const lowPriorityScripts = buildManifest.lowPriorityFiles?.filter(isJSFile);
|
||||
|
||||
@@ -97,33 +96,6 @@ function getScripts(files: DocumentFiles) {
|
||||
});
|
||||
}
|
||||
|
||||
// function fixLink(from: string) {
|
||||
// if (from.startsWith("/_next/http://") || from.startsWith("/_next/https://"))
|
||||
// return from.substring("/_next".length);
|
||||
// return from;
|
||||
// }
|
||||
|
||||
// function cloneWithOverwrittenLink(element: React.ReactElement<any>) {
|
||||
// const props = { ...element.props };
|
||||
// if ("href" in element.props) {
|
||||
// props.href = fixLink(props.href);
|
||||
// }
|
||||
|
||||
// if ("n-href" in element.props) {
|
||||
// props["n-href"] = fixLink(props["n-href"]);
|
||||
// }
|
||||
|
||||
// if ("n-src" in element.props) {
|
||||
// props["n-src"] = fixLink(props["n-src"]);
|
||||
// }
|
||||
|
||||
// if ("src" in element.props) {
|
||||
// props["src"] = fixLink(props.src);
|
||||
// }
|
||||
|
||||
// return React.cloneElement(element, props);
|
||||
// }
|
||||
|
||||
interface DomainLocale {
|
||||
defaultLocale: string;
|
||||
domain: string;
|
||||
|
||||
Reference in New Issue
Block a user