From 4acfb2fb87cc4e09d0ed3c3e6a6696e7224f3ac8 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Tue, 28 Nov 2023 17:50:28 +0900 Subject: [PATCH] Revert "chore: add wrapConsoleTimeAsync" This reverts commit 4417a491c7dc7a981ff42fa6bac5e2274267d8e9. --- packages/remix-dev/vite/plugin.ts | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/packages/remix-dev/vite/plugin.ts b/packages/remix-dev/vite/plugin.ts index 53efece8a66..eef98b12198 100644 --- a/packages/remix-dev/vite/plugin.ts +++ b/packages/remix-dev/vite/plugin.ts @@ -205,21 +205,7 @@ const writeFileSafe = async (file: string, contents: string): Promise => { await fse.writeFile(file, contents); }; -function wrapConsoleTimeAsync any>(f: F) { - const wrapper = async function (this: any, ...args: any[]) { - const id = Math.random().toString(36).slice(2).padStart(12, "0"); - const label = `${f.name}:${id}`; - globalThis.console.time(label); - try { - return await f.apply(this, args); - } finally { - globalThis.console.timeEnd(label); - } - } - return wrapper as F; -} - -let getRouteManifestModuleExports = async ( +const getRouteManifestModuleExports = async ( viteChildCompiler: Vite.ViteDevServer | null, pluginConfig: ResolvedRemixVitePluginConfig ): Promise> => { @@ -236,9 +222,7 @@ let getRouteManifestModuleExports = async ( return Object.fromEntries(entries); }; -getRouteManifestModuleExports = wrapConsoleTimeAsync(getRouteManifestModuleExports); - -let getRouteModuleExports = async ( +const getRouteModuleExports = async ( viteChildCompiler: Vite.ViteDevServer | null, pluginConfig: ResolvedRemixVitePluginConfig, routeFile: string @@ -263,8 +247,6 @@ let getRouteModuleExports = async ( return exportNames; }; -getRouteModuleExports = wrapConsoleTimeAsync(getRouteModuleExports); - const showUnstableWarning = () => { console.warn( colors.yellow(