IonIon
Packages
  • next
  • current
Changelog
GitHub
Packages
  • next
  • current
Changelog
GitHub
  • Version 0.x

    • Release Notes
    • Upgrade Guide
    • Contribution Guide
    • Security Policy
    • Code of Conduct
    • Origin
  • Packages

    • Introduction
    • Container

      • Introduction
      • Prerequisites
      • How to install
      • Container Instance
      • Bindings
      • Dependencies
      • Resolving
      • Contextual Bindings
    • Contracts

      • Introduction
      • How to install
    • Support

      • Introduction
      • How to install
      • Arrays

        • About Arrays
        • Includes All
        • Includes Any
        • Is Array Like
        • Is Concat Spreadable
        • Is Safe Array Like
        • Is Typed Array
        • Merge
      • Concerns

        • About Concerns
        • Prerequisites
        • Concern Class
        • Using Concerns
        • Aliases
        • Conflict Resolution
        • Booting
        • Hooks
        • Edge Cases
        • JSDoc
      • Exceptions

        • About Exceptions
        • Configure Custom Error
        • Configure Stack Trace
        • Get Error Message
        • Custom Errors
      • Facades

        • About Facades
      • Meta

        • About Meta
        • Prerequisites
        • Supported Elements
        • Set & Get
        • Inheritance
        • Outside Changes
        • TC39 Proposal
        • Target Meta
      • Mixins

        • About Mixins
        • New Mixin
        • Apply Mixins
        • Instanceof
        • Inheritance
        • Onward
      • Object

        • About Objects
        • Forget
        • Forget All
        • Get
        • Has
        • Has All
        • Has Any
        • Has Unique ID
        • Is Cloneable
        • Is Populatable
        • Isset
        • Merge
        • Populate
        • Set
        • Unique ID
      • Reflections

        • About reflections
        • Assert Has Prototype Prop.
        • Class Looks Like
        • Class Own Keys
        • Get All Parents Of Class
        • Get Class Prop. Descriptor
        • Get Class Prop. Descriptors
        • Get Constructor Name
        • Get Name Or Desc. Tag
        • Get Parent Of Class
        • Has All Methods
        • Has Method
        • Has Prototype Property
        • Is Callable
        • Is Class Constructor
        • Is Class Method Reference
        • Is Constructor
        • Is Key Safe
        • Is Key Unsafe
        • Is Method
        • Is Subclass
        • Is Subclass Or Looks Like
        • Is WeakKind
      • Misc

        • About Misc.
        • Desc. Tag
        • Empty
        • Is Key
        • Is Primitive
        • Is Property Key
        • Isset
        • Merge Keys
        • To Weak Ref.
      • Callback Wrapper
    • Vuepress Utils

      • Introduction
      • How to install
      • Navigation

        • Archive
      • Plugins

        • Last Updated
      • Components

        • Version Disclaimer
    • XYZ (test package)

Release Notes

caution

Ion is still in development. You SHOULD NOT use any of the packages in a production environment. Breaking changes MUST be expected for all v0.x releases!

Please review the CHANGELOG.md for additional details.

  • Support Policy
  • v0.x Highlights
    • Service Container Available since v0.11
    • Facades Available since v0.11
    • Concerns Available since v0.9
    • Merge Available since v0.9
    • Mixins Available since v0.8
    • "Target" Meta Decorator Available since v0.7
    • Meta Decorator Available since v0.6
    • Support Available since v0.3
    • Vuepress Utils Available since v0.1

Support Policy

VersionTypeScriptECMA ScriptReleaseSecurity Fixes Until
1.x5.0 - ?TBDTBDTBD
0.x*5.0ES2022ongoing releasesuntil v1.x release

*: current supported version.

TBD: "To be decided".

v0.x Highlights

Service Container Available since v0.11

An adaptation of Laravel's Service Container that offers a way to with powerful tool to manage dependencies and perform dependency injection.

import { Container } from "@aedart/container";

container.bind('storage', () => {
    return new CloudService('s3');
});

// Later in your application.
const storage = container.make('storage');

For additional examples, see the Service Container documentation.

Facades Available since v0.11

Adaptation of Laravel's Facade component. It acts as an interface or gateway to an underlying object that is resolved from the Service Container.

import { Facade } from "@aedart/support/facades";

export default class ApiFacade extends Facade
{
    static getIdentifier()
    {
        return 'api_client';
    }
}

// Later in your application
const promise = ApiFacade.obtain().fetch('https://acme.com/api/users');

See the Facades documentation for additional details.

Concerns Available since v0.9

Intended as an alternative to mixins, the Concerns submodule offers a different way to overcome some of the limitations of single inheritance.

import { use, AbstractConcern } from "@aedart/support/concerns";

// A concern class...
class Role extends AbstractConcern {
    addRole(name) {
        /* ...not shown... */
    }
}

// Use concern in target class...
@use(Role)
class User {}

// Later in your application...
const user = new User();
user.addRole('maintainer');
user.addRole('supporter');

Merge Available since v0.9

Objects merge utility, using deep copy.

import { merge } from "@aedart/support/objects";

const a = {
    'name': 'Alin',
};

const b = {
    'address': {
        'street': 'Northern Street 1'
    },
};

const result = merge(a, b); // { 'name': 'Alin', 'address': { 'street': '...' } }

Mixins Available since v0.8

Adaptation of Justin Fagnani's mixwith.js.

import { mix, Mixin } from "@aedart/support/mixins";

const NameMixin = Mixin((superclass) => class extends superclass {
    #name;
    
    set name(value) {
        this.#name = value;
    }
    
    get name() {
        return this.#name;
    }
});

class Item extends mix().with(
    NameMixin
) {}

// ...Later in your application
const item = new Item();
item.name = 'My Item';

console.log(item.name); // My Item

See details and more examples in the @aedart/support/mixins documentation.

"Target" Meta Decorator Available since v0.7

Associate arbitrary metadata directly with the target element that is being decorated. See target meta decorator fro additional details.

import {targetMeta, getTargetMeta} from '@aedart/support/meta';

class Service {

    @targetMeta('desc', 'Seaches for cities')
    search() {
        // ...not shown...
    }
}

const instance = new Service();

// ...later in your application...
getTargetMeta(instance.search, 'desc'); // Seaches for cities

Meta Decorator Available since v0.6

The meta decorator is able to associate arbitrary metadata with a class and its elements.

import {meta, getMeta} from '@aedart/support/meta';

@meta('description', 'Able to search for locations')
class Service {}

getMeta(Service, 'description'); // Able to search for locations

Support Available since v0.3

A package intended to contain various helpers and utilities. At the moment, the package comes with a few object utilities. See package documentation for more details.

Vuepress Utils Available since v0.1

Utilities for vuepress sites, which includes an Archive component for structuring documentation into an archive. See package documentation for details.

Edit page
Last Updated:
Contributors: Alin Eugen Deac, alin
Next
Upgrade Guide