Coder Social home page Coder Social logo

core's Introduction

Dojo 2 core

Build Status codecov.io npm version

This package provides a set of language helpers, utility functions, and classes for writing TypeScript applications. It includes APIs for feature detection, asynchronous and streaming operations, basic event handling, and making HTTP requests.

Installation

This package is currently in Alpha with a initial stable release scheduled for later this year. You can download the Alpha by cloning or downloading this repository.

Usage

TypeScript

To access modules use after cloning or downloading the repository, you can reference it by:

import * as lang from 'src/lang'; // this imports all exports of the module as the object lang

import { lateBind, mixin } from 'src/lang'; // this imports lateBind and mixin from the module

Compile To JavaScript

Once downloaded, you can compile the TypesScript files by first installing the project dependencies with:

npm install

The by running this command:

grunt dev

This will run the grunt 'dev' task.

Features

Feature Detection

Using the latest Web technologies isn't always as straightforward as developers would like due to differing support across platforms. dojo-core/has provides a simple feature detection API that makes it easy to detect which platforms support which features.

Language Utilities

The core package provides modules offering language utilities. Some of these are heavily based on methods in the ES2015 proposal; others are additional APIs for commonly-performed tasks.

array

The dojo-core/array module contains analogues to some of the ES2015 Array APIs.

lang

The dojo-core/lang module contains various utility functions for tasks such as copying objects and creating late-bound or partially applied functions.

math

The dojo-core/math module contains analogues to a number of ES2015 APIs, including many trigonometric and logarithmic functions.

string

The dojo-core/string module contains analogues to the some of the ES2015 String APIs.

UrlSearchParams

The dojo-core/UrlSearchParams class can be used to parse and generate URL query strings.

Event handling

The dojo-core/on module contains methods to handle events across types of listeners. It also includes methods to handle different event use cases including only firing once and pauseable events.

HTTP requests

The dojo-core/request module contains methods to simplify making http requests. It can handle making requests in both node and the browser through the same methods.

Promises and Asynchronous Operations

Promise

The dojo-core/Promise class is an implementation of the ES2015 Promise API that also includes static state inspection and a finally method for cleanup actions.

dojo-core/async contains a number of classes and utility modules to simplify working with asynchronous operations.

Task

The dojo-core/async/Task class is an extension of dojo-core/Promise that provides cancelation support.

Data Structures

Map

The dojo-core/Map class is an implementation of the ES2015 Map specification without iterators for use in older browsers.

WeakMap

The dojo-core/WeakMap class is an implementation of the ES2015 WeakMap specification without iterators for use in older browsers. The main difference between WeakMap and Map is that WeakMap's keys can only be objects and that the store has a weak reference to the key/value pair. This allows for the garbage collector to remove pairs.

Look at Map for more information on how to use WeakMap.

How do I contribute?

We appreciate your interest! Please see the Dojo 2 Meta Repository for the Contributing Guidelines and Style Guide.

Dojo core's continuous integration tests use the BrowserStack cloud.

BrowserStack

Licensing information

ยฉ 2004โ€“2015 Dojo Foundation & contributors. New BSD license.

Some string functions (codePointAt, fromCodePoint, and repeat) adopted from polyfills by Mathias Bynens, under the MIT license.

See LICENSE for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.