aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-framework-next/client.development.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/bun-framework-next/client.development.tsx')
-rw-r--r--packages/bun-framework-next/client.development.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/bun-framework-next/client.development.tsx b/packages/bun-framework-next/client.development.tsx
index 3921bf011..d959b5ae1 100644
--- a/packages/bun-framework-next/client.development.tsx
+++ b/packages/bun-framework-next/client.development.tsx
@@ -4,8 +4,14 @@ globalThis.Bun_disableCSSImports = true;
// We're disabling Object.freeze because it breaks CJS => ESM and can cause
// issues with Suspense and other things that expect the CJS module namespace
// to be mutable when the ESM module namespace is NOT mutable
-globalThis.Object.freeze = (obj) => {
- return obj;
+const freezer = new WeakMap();
+
+globalThis.Object.freeze = function freeze(obj) {
+ freezer.set(freezer, true);
+};
+
+globalThis.Object.isFrozen = function isFrozen(obj) {
+ return freezer.has(obj);
};
import * as React from "react";