Skip to content

Commit

Permalink
Remove deprecated HIDDEN and ALWAYS_HIDDEN
Browse files Browse the repository at this point in the history
Have now been replaced by PROVIDES and UNSAFE_PROPERTY_KEYS.
  • Loading branch information
aedart committed Feb 24, 2024
1 parent cf15261 commit a98c24c
Showing 1 changed file with 0 additions and 70 deletions.
70 changes: 0 additions & 70 deletions packages/contracts/src/support/concerns/index.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,10 @@
import { DANGEROUS_PROPERTIES } from "@aedart/contracts/support/objects";

/**
* Support Concerns identifier
*
* @type {Symbol}
*/
export const SUPPORT_CONCERNS: unique symbol = Symbol('@aedart/contracts/support/concerns');

/**
* @deprecated TODO: This MUST be redesigned, such that each Concern class can provide a list of what to expose
*
* Symbol used by a {@link Concern} to define properties or methods that must be
* "hidden" and not allowed to be aliased into a target class.
*
* **Note**: _Symbol MUST be used to as name for a "static" method in the desired Concern class._
*
* **Example**:
* ```ts
* class MyConcern implements Concern
* {
* static [HIDDEN](): PropertyKey[]
* {
* // ...not shown...
* }
*
* // ...remaining not shown...
* }
* ```
*
* @type {symbol}
*/
export const HIDDEN: unique symbol = Symbol('hidden');

/**
* Symbol used by a [concern class]{@link ConcernConstructor} to indicate what properties
* and methods can be aliased into a target class.
Expand Down Expand Up @@ -74,48 +47,6 @@ export const CONCERN_CLASSES: unique symbol = Symbol('concern_classes');
*/
export const CONCERNS: unique symbol = Symbol('concerns');

/**
* @deprecated TODO: Move this into support/concerns. It is way too implementation specific to belong here.
*
* List of properties and methods that must always remain "hidden" and
* **NEVER** be aliased into a target class' prototype.
*
* @type {ReadonlyArray<PropertyKey>}
*/
export const ALWAYS_HIDDEN: ReadonlyArray<PropertyKey> = [

...DANGEROUS_PROPERTIES,

// ----------------------------------------------------------------- //
// Defined by Concern interface / Abstract Concern:
// ----------------------------------------------------------------- //

// It is NOT possible, nor advised to attempt to alias a Concern's
// constructor into a target class.
'constructor',

// The concernOwner property (getter) shouldn't be aliased either
'concernOwner',

// If the Concern defines any hidden properties or methods,
// then such a method will not do any good in a target class.
HIDDEN,

// The static properties and methods (just in case...)
PROVIDES,
'resolvedConcernKeys',
'removeAlwaysHiddenKeys',
'rememberConcernKeys',

// ----------------------------------------------------------------- //
// Other properties and methods:
// ----------------------------------------------------------------- //

// In case that a concern class uses other concerns, prevent them
// from being aliased.
CONCERNS,
];

import Concern from "./Concern";
import ConcernConstructor from "./ConcernConstructor";
import Configuration from "./Configuration";
Expand All @@ -136,5 +67,4 @@ export {
}

export * from './exceptions/index';

export * from './types';

0 comments on commit a98c24c

Please sign in to comment.