From 150c55de79f92035b3bb740bfd1fa0c4cba2ebc8 Mon Sep 17 00:00:00 2001 From: Sasha <64744993+r1tsuu@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:20:22 +0200 Subject: [PATCH] chore(next): remove deep copying of `docPermissions` in the Version View (#9491) Removes unnecessary `deepCopyObject(docPermissions)` in the Version View which slows down loading speed. The comment seems to be resolved, I'm not getting this error and here for example in the same case https://github.com/payloadcms/payload/blob/3c0e832a9af2e16179891a87706c65cc3f3cd42d/packages/next/src/views/Document/index.tsx#L327 we don't do deep copying. --- packages/next/src/views/Version/index.tsx | 10 +--------- test/versions/payload-types.ts | 4 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/next/src/views/Version/index.tsx b/packages/next/src/views/Version/index.tsx index 384d72a22d..39710c3326 100644 --- a/packages/next/src/views/Version/index.tsx +++ b/packages/next/src/views/Version/index.tsx @@ -8,7 +8,6 @@ import type { } from 'payload' import { notFound } from 'next/navigation.js' -import { deepCopyObjectSimple } from 'payload' import React from 'react' import { getLatestVersion } from '../Versions/getLatestVersion.js' @@ -140,14 +139,7 @@ export const VersionView: PayloadServerReactComponent = async return (