Skip to content

Commit 023795e

Browse files
committed
refactor: remove debug console logs and improve TypeScript types
- Remove build-time console.log statements from compileMDX.ts - Replace 'any' type with proper ReturnType<typeof setTimeout> in usePendingRoute.ts - Improves code quality and type safety
1 parent 2534424 commit 023795e

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/hooks/usePendingRoute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const usePendingRoute = () => {
1717
const [pendingRoute, setPendingRoute] = useState<string | null>(null);
1818
const currentRoute = useRef<string | null>(null);
1919
useEffect(() => {
20-
let routeTransitionTimer: any = null;
20+
let routeTransitionTimer: ReturnType<typeof setTimeout> | undefined = undefined;
2121

2222
const handleRouteChangeStart = (url: string) => {
2323
clearTimeout(routeTransitionTimer);

src/utils/compileMDX.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,8 @@ export default async function compileMDX(
4545
);
4646
const cached = await store.get(hash);
4747
if (cached) {
48-
console.log(
49-
'Reading compiled MDX for /' + path + ' from ./node_modules/.cache/'
50-
);
5148
return cached;
5249
}
53-
if (process.env.NODE_ENV === 'production') {
54-
console.log(
55-
'Cache miss for MDX for /' + path + ' from ./node_modules/.cache/'
56-
);
57-
}
5850

5951
// If we don't add these fake imports, the MDX compiler
6052
// will insert a bunch of opaque components we can't introspect.

0 commit comments

Comments
 (0)