Skip to content

Commit

Permalink
"RC" version, updated to latest typescript, fixed build on node 8, tw…
Browse files Browse the repository at this point in the history
…eaked map/set code
  • Loading branch information
dsehnal committed Jul 18, 2017
1 parent 9c89d59 commit d4c0ea6
Show file tree
Hide file tree
Showing 27 changed files with 112 additions and 338 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
###################
node_modules/
build/
debug.log
debug.log
package-lock.json
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This a global changelog that outlines overal changes in LiteMol.
Each component also has its separate changelog
([Core](src/lib/Core/CHANGELOG.md), [Visualization](src/lib/Visualization/CHANGELOG.md), [Bootstrap](src/lib/Bootstrap/CHANGELOG.md), [Plugin](src/lib/Plugin/CHANGELOG.md), [Viewer](src/Viewer/CHANGELOG.md)).


2.4.0-preview
-----------

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

[![Version](https://img.shields.io/badge/Version-2.4.0_preview-blue.svg?style=flat)](CHANGELOG.md)
[![Version](https://img.shields.io/badge/Version-2.4.0_rc-blue.svg?style=flat)](CHANGELOG.md)
[![Latest Release](https://img.shields.io/badge/Latest%20Release-1.0-blue.svg?style=flat)](https://github.com/dsehnal/LiteMol/releases/tag/v1.0)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat)](https://github.com/dsehnal/LiteMol/blob/master/LICENSE)

Expand Down Expand Up @@ -129,7 +129,7 @@ Releases

The latest stable release of LiteMol is the [version 1.0](https://github.com/dsehnal/LiteMol/releases/tag/v1.0).

Currently, the version 2.0 is being developed and is in a "preview" phase, meaning that a number of breaking changes will be introduced.
Currently, the version 2.0 is being developed and is in a "release candidate" phase and should be released soon.
Migration summary can be found [here](docs/migrating/1-to-2.md).

Short term goals
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.0-preview
2.4.0-rc
77 changes: 3 additions & 74 deletions dist/js/LiteMol-core.d.ts
Original file line number Diff line number Diff line change
@@ -1,74 +1,4 @@



// Project: https://github.com/jakearchibald/ES6-Promise
// Definitions by: François de Campredon <https://github.com/fdecampredon/>, vvakame <https://github.com/vvakame>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace __Promise {
interface Thenable<T> {
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
catch<U>(onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
}

class Promise<T> implements Thenable<T> {
/**
* If you call resolve in the body of the callback passed to the constructor,
* your promise is fulfilled with result object passed to resolve.
* If you call reject your promise is rejected with the object passed to reject.
* For consistency and debugging (eg stack traces), obj should be an instanceof Error.
* Any errors thrown in the constructor callback will be implicitly passed to reject().
*/
constructor(callback: (resolve: (value?: T | Thenable<T>) => void, reject: (error?: any) => void) => void);

/**
* onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects.
* Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called.
* Both callbacks have a single parameter , the fulfillment value or rejection reason.
* "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve.
* If an error is thrown in the callback, the returned promise rejects with that error.
*
* @param onFulfilled called when/if "promise" resolves
* @param onRejected called when/if "promise" rejects
*/
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => void): Promise<U>;

/**
* Sugar for promise.then(undefined, onRejected)
*
* @param onRejected called when/if "promise" rejects
*/
catch<U>(onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
}

namespace Promise {
/**
* Make a new promise from the thenable.
* A thenable is promise-like in as far as it has a "then" method.
*/
function resolve<T>(value?: T | Thenable<T>): Promise<T>;

/**
* Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error
*/
function reject(error: any): Promise<any>;
function reject<T>(error: T): Promise<T>;

/**
* Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects.
* the array passed to all can be a mixture of promise-like objects and other objects.
* The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value.
*/
function all<T>(promises: (T | Thenable<T>)[]): Promise<T[]>;

/**
* Make a Promise that fulfills when any item fulfills, and rejects if any item rejects.
*/
function race<T>(promises: (T | Thenable<T>)[]): Promise<T>;
}
}
// DefinitelyTyped: partial

// This file contains common part of defintions for rx.d.ts and rx.lite.d.ts
Expand Down Expand Up @@ -1511,8 +1441,7 @@ declare module 'CIFTools' {
}

declare namespace LiteMol {
type Promise<T> = __Promise.Promise<T>;
const Promise: typeof __Promise.Promise;
const Promise: PromiseConstructor;
}
declare namespace LiteMol.Core {
export import Rx = __LiteMolRx;
Expand All @@ -1531,7 +1460,7 @@ declare namespace LiteMol.Core {
function computation<A>(c: (ctx: Computation.Context) => Promise<A>): Computation<A>;
class Computation<A> {
private computation;
run(ctx?: Computation.Context): __Promise.Promise<A>;
run(ctx?: Computation.Context): Promise<A>;
runWithContext(ctx?: Computation.Context): Computation.Running<A>;
constructor(computation: (ctx: Computation.Context) => Promise<A>);
}
Expand Down Expand Up @@ -1614,7 +1543,7 @@ declare namespace LiteMol.Core.Utils {
/**
* Create a map from an array of the form [[key, value], ...]
*/
function ofArray<K extends string | number, V>(data: (K | V)[][]): FastMap<K, V>;
function ofArray<K extends string | number, V>(data: [K, V][]): FastMap<K, V>;
/**
* Create a map from an object of the form { key: value, ... }
*/
Expand Down
10 changes: 2 additions & 8 deletions dist/js/LiteMol-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -11165,6 +11165,7 @@ var CIFTools;
*/
var LiteMol;
(function (LiteMol) {
//export type Promise<T> = GlobalPromise<T>;// __Promise.Promise<T>;
LiteMol.Promise = __LiteMolPromise;
})(LiteMol || (LiteMol = {}));
(function (LiteMol) {
Expand Down Expand Up @@ -11399,11 +11400,8 @@ var LiteMol;
var FastMap;
(function (FastMap) {
function forEach(data, f, ctx) {
var hasOwn = Object.prototype.hasOwnProperty;
for (var _i = 0, _a = Object.keys(data); _i < _a.length; _i++) {
var key = _a[_i];
if (!hasOwn.call(data, key))
continue;
var v = data[key];
if (v === void 0)
continue;
Expand Down Expand Up @@ -11465,11 +11463,8 @@ var LiteMol;
*/
function ofObject(data) {
var ret = create();
var hasOwn = Object.prototype.hasOwnProperty;
for (var _i = 0, _a = Object.keys(data); _i < _a.length; _i++) {
var key = _a[_i];
if (!hasOwn.call(data, key))
continue;
var v = data[key];
ret.set(key, v);
}
Expand All @@ -11480,10 +11475,9 @@ var LiteMol;
var FastSet;
(function (FastSet) {
function forEach(data, f, ctx) {
var hasOwn = Object.prototype.hasOwnProperty;
for (var _i = 0, _a = Object.keys(data); _i < _a.length; _i++) {
var p = _a[_i];
if (!hasOwn.call(data, p) || data[p] !== null)
if (data[p] !== null)
continue;
f(p, ctx);
}
Expand Down
Loading

0 comments on commit d4c0ea6

Please sign in to comment.