@@ -1423,7 +1423,7 @@ function optProxy(value: any): any {
14231423 typeof value !== "object" ||
14241424 ! value ||
14251425 value [ TARGET_SYMBOL ] !== undefined ||
1426- NO_COPY in value
1426+ value [ OPAQUE ]
14271427 ) {
14281428 return value ;
14291429 }
@@ -1721,7 +1721,7 @@ function copyRecursive<T extends object>(dst: T, src: T, flags: number): boolean
17211721 }
17221722 else if ( dstValue !== srcValue ) {
17231723 if ( typeof srcValue === "object" && srcValue !== null ) {
1724- if ( typeof dstValue === "object" && dstValue !== null && srcValue . constructor === dstValue . constructor && ! ( NO_COPY in srcValue ) ) {
1724+ if ( typeof dstValue === "object" && dstValue !== null && srcValue . constructor === dstValue . constructor && ! ( OPAQUE in srcValue ) ) {
17251725 changed = copyRecursive ( dstValue , srcValue , flags ) || changed ;
17261726 continue ;
17271727 }
@@ -1757,7 +1757,7 @@ function copyRecursive<T extends object>(dst: T, src: T, flags: number): boolean
17571757 if ( dstValue === undefined && ! dst . has ( key ) ) dstValue = EMPTY ;
17581758 if ( dstValue !== srcValue ) {
17591759 if ( typeof srcValue === "object" && srcValue !== null ) {
1760- if ( typeof dstValue === "object" && dstValue !== null && srcValue . constructor === dstValue . constructor && ! ( NO_COPY in srcValue ) ) {
1760+ if ( typeof dstValue === "object" && dstValue !== null && srcValue . constructor === dstValue . constructor && ! ( OPAQUE in srcValue ) ) {
17611761 changed = copyRecursive ( dstValue , srcValue , flags ) || changed ;
17621762 continue ;
17631763 }
@@ -1789,7 +1789,7 @@ function copyRecursive<T extends object>(dst: T, src: T, flags: number): boolean
17891789 const dstValue = dst . hasOwnProperty ( key ) ? dst [ key ] : EMPTY ;
17901790 if ( dstValue !== srcValue ) {
17911791 if ( typeof srcValue === "object" && srcValue !== null ) {
1792- if ( typeof dstValue === "object" && dstValue !== null && srcValue . constructor === dstValue . constructor && ! ( NO_COPY in srcValue ) ) {
1792+ if ( typeof dstValue === "object" && dstValue !== null && srcValue . constructor === dstValue . constructor && ! ( OPAQUE in srcValue ) ) {
17931793 changed = copyRecursive ( dstValue as typeof srcValue , srcValue , flags ) || changed ;
17941794 continue ;
17951795 }
@@ -1826,14 +1826,29 @@ const COPY_SUBSCRIBE = 32;
18261826const COPY_EMIT = 64 ;
18271827
18281828/**
1829- * A symbol that can be added to an object to prevent it from being cloned by {@link clone} or {@link copy}.
1830- * This is useful for objects that should be shared by reference. That also mean that their contents won't
1831- * be observed for changes.
1829+ * A symbol that controls how Aberdeen handles an object in copy operations and proxy wrapping.
1830+ *
1831+ * The **presence** of this symbol (regardless of its value) prevents deep-copying: the object is
1832+ * stored and passed by reference in {@link clone} and {@link copy}.
1833+ *
1834+ * The **value** of the symbol controls proxy wrapping when the object is read from reactive state:
1835+ * - **Truthy** (e.g. `true`): the object is fully opaque — it is not wrapped in a proxy, so its
1836+ * properties are not observable. Use this for objects that break when proxied (e.g. class instances
1837+ * with internal slots, Promises) or that must be invisible to Aberdeen's reactive system.
1838+ * - **Falsy** (e.g. `false`): the object is still wrapped in a proxy, so reads on its properties
1839+ * create reactive dependencies as normal — only deep-copying is suppressed.
1840+ */
1841+ export const OPAQUE = Symbol ( "OPAQUE" ) ;
1842+
1843+ /**
1844+ * Use {@link OPAQUE} instead. This is an alias kept for backward compatibility.
1845+ *
1846+ * @deprecated
18321847 */
1833- export const NO_COPY = Symbol ( "NO_COPY" ) ;
1848+ export const NO_COPY = OPAQUE ;
18341849
1835- // Promises break when proxied, so we'll just mark them as NO_COPY
1836- ( Promise . prototype as any ) [ NO_COPY ] = true ;
1850+ // Promises break when proxied, so mark them as fully opaque
1851+ ( Promise . prototype as any ) [ OPAQUE ] = true ;
18371852
18381853/**
18391854 * A reactive object containing CSS variable definitions.
@@ -1961,7 +1976,7 @@ export function darkMode(): boolean {
19611976
19621977// Simple recursive clone - no destination checking needed
19631978function cloneRecursive < T extends object > ( src : T , flags : number ) : T {
1964- if ( NO_COPY in src ) return src ;
1979+ if ( OPAQUE in src ) return src ;
19651980 if ( flags & COPY_SUBSCRIBE ) subscribe ( src , ANY_SYMBOL ) ;
19661981
19671982 if ( src instanceof Array ) {
@@ -3299,8 +3314,8 @@ export function dump<T>(data: T): T {
32993314 if ( data && typeof data === "object" ) {
33003315 const name = data . constructor . name . toLowerCase ( ) || "unknown object" ;
33013316 A ( `#<${ name } >` ) ;
3302- if ( NO_COPY in data ) {
3303- A ( "# [NO_COPY ]" ) ;
3317+ if ( OPAQUE in data ) {
3318+ A ( "# [OPAQUE ]" ) ;
33043319 } else {
33053320 A ( "ul" , ( ) => {
33063321 onEach ( data as any , ( value , key ) => {
@@ -3422,6 +3437,7 @@ export default Object.assign(A, {
34223437 /** {@inheritDoc merge } */ merge,
34233438 /** {@inheritDoc mount } */ mount,
34243439 /** {@inheritDoc multiMap } */ multiMap,
3440+ /** {@inheritDoc OPAQUE } */ OPAQUE ,
34253441 /** {@inheritDoc NO_COPY } */ NO_COPY ,
34263442 /** {@inheritDoc onEach } */ onEach,
34273443 /** {@inheritDoc partition } */ partition,
0 commit comments