Socket
Socket
Sign inDemoInstall

@aurelia/kernel

Package Overview
Dependencies
Maintainers
1
Versions
1114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aurelia/kernel - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0-dev.20181013

src/di.ts

95

CHANGELOG.md

@@ -6,14 +6,99 @@ # Change Log

<a name="0.3.0"></a>
# 0.3.0 (2018-10-12)
### Features:
* **kernel:** add decoratable interface to support strongly typed decorators ([f67a414](https://github.com/aurelia/aurelia/commit/f67a414))
* **binding:** add @connectable decorator back in (strongly typed) ([f67a414](https://github.com/aurelia/aurelia/commit/f67a414))
* **all:** implement InterpolationBinding ([f67a414](https://github.com/aurelia/aurelia/commit/f67a414))
* **unparser:** implement interpolation unparsing ([f67a414](https://github.com/aurelia/aurelia/commit/f67a414))
* **kernel:** add unwrap interface ([197235c](https://github.com/aurelia/aurelia/commit/197235c))
* **ast:** add visitor interface and implement accept methods on AST ([197235c](https://github.com/aurelia/aurelia/commit/197235c))
* **expression-parser:** allow member expressions on numeric literals ([197235c](https://github.com/aurelia/aurelia/commit/197235c))
* **expression-parser:** map empty attribute value to empty string for bound properties ([7a92cd8](https://github.com/aurelia/aurelia/commit/7a92cd8))
### Bug Fixes:
* **kernel:** fix decorated interface ([f67a414](https://github.com/aurelia/aurelia/commit/f67a414))
* **binding:** wrap updatetarget/updatesource so vCurrent BBs work again ([f67a414](https://github.com/aurelia/aurelia/commit/f67a414))
* **expression-parser:** fix differentation for caching of expressions/interpolations ([f67a414](https://github.com/aurelia/aurelia/commit/f67a414))
* **iterator-binding:** correctly compile and render ForOfStatement ([f67a414](https://github.com/aurelia/aurelia/commit/f67a414))
* **debug:** correct / update unparser and debug mode ([197235c](https://github.com/aurelia/aurelia/commit/197235c))
* **expression-parser:** fix parsing error with trailing elision ([197235c](https://github.com/aurelia/aurelia/commit/197235c))
* **expression-parser:** allow AccessThis as the last element of an array ([197235c](https://github.com/aurelia/aurelia/commit/197235c))
* **expression-parser:** allow AccessThis as the condition in a conditional ([197235c](https://github.com/aurelia/aurelia/commit/197235c))
* **expression-parser:** allow AccessThis as left-hand side of binary expressions ([197235c](https://github.com/aurelia/aurelia/commit/197235c))
* **expression-parser:** reset access after parsing non-identifiers ([197235c](https://github.com/aurelia/aurelia/commit/197235c))
* **unparser:** explicitly reconstruct precedence ([197235c](https://github.com/aurelia/aurelia/commit/197235c))
* **DI:** alias registration param order and tests (#202) ([1683135](https://github.com/aurelia/aurelia/commit/1683135))
* **resources:** ensure null is returned for non-existing resources ([7a92cd8](https://github.com/aurelia/aurelia/commit/7a92cd8))
* **template-compiler:** correct a few edge cases in target and bindingMode resolution ([7a92cd8](https://github.com/aurelia/aurelia/commit/7a92cd8))
* **template-compiler:** correct handling of kebab-cased custom attributes ([7a92cd8](https://github.com/aurelia/aurelia/commit/7a92cd8))
* **repeat.for:** add missing instruction properties ([7a92cd8](https://github.com/aurelia/aurelia/commit/7a92cd8))
### Performance Improvements:
* **expression-parser:** remove unreachable branch ([f67a414](https://github.com/aurelia/aurelia/commit/f67a414))
* **expression-parser:** use explicit numeric comparisons for bitwise operators ([197235c](https://github.com/aurelia/aurelia/commit/197235c))
* **template-compiler:** index the inspect/resolve buffers directly instead of destructuring ([7a92cd8](https://github.com/aurelia/aurelia/commit/7a92cd8))
### Refactorings:
* **binding:** cleanup/shuffle some interfaces accordingly ([f67a414](https://github.com/aurelia/aurelia/commit/f67a414))
* **template-compiler:** cleanup/inline instruction classes ([f67a414](https://github.com/aurelia/aurelia/commit/f67a414))
* **binding-command:** reuse specific binding command prototype methods on the default binding command ([7a92cd8](https://github.com/aurelia/aurelia/commit/7a92cd8))
* **template-compiler:** destructure with reused object ([7a92cd8](https://github.com/aurelia/aurelia/commit/7a92cd8))
<a name="0.2.0"></a>
# 0.2.0 (2018-09-18)
### Features:
### Bug Fixes
* **di:** recurse through static registrations to find register methods in more edge cases ([6bc2d4d](https://github.com/aurelia/aurelia/commit/6bc2d4d))
* **kernel:** add fast camelCase and kebabCase functions with caching ([8debe4f](https://github.com/aurelia/aurelia/commit/8debe4f))
* **observers:** auto-enable collection observers and make the toggles idempotent ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **runtime:** convert with attribute to use render location (#64) ([5830a36](https://github.com/aurelia/aurelia/commit/5830a36))
* **runtime:** convert with attribute to use render location ([5830a36](https://github.com/aurelia/aurelia/commit/5830a36))
* **runtime:** improvements to attribute and element bindable control and common interfaces ([5830a36](https://github.com/aurelia/aurelia/commit/5830a36))
* **binding:** implement ChangeSet (#58) ([144b1c6](https://github.com/aurelia/aurelia/commit/144b1c6))
* **binding:** implement ChangeSet ([144b1c6](https://github.com/aurelia/aurelia/commit/144b1c6))
* **di:** convert invokers to an array ([#106](https://github.com/aurelia/aurelia/issues/106)) ([9236dec](https://github.com/aurelia/aurelia/commit/9236dec))
### Bug Fixes:
### Features
* **di:** invoke correct method on array strategy resolver ([6bc2d4d](https://github.com/aurelia/aurelia/commit/6bc2d4d))
* **di:** invalidate Object keys to help diagnose invalid design:paramTypes ([6bc2d4d](https://github.com/aurelia/aurelia/commit/6bc2d4d))
* **di:** add a non-any type alternative to the InterfaceSymbol<T> so that container.get() returns correctly typed instances ([6bc2d4d](https://github.com/aurelia/aurelia/commit/6bc2d4d))
* **examples:** correct versions ([1b7c764](https://github.com/aurelia/aurelia/commit/1b7c764))
* **tsconfig:** correct extends path ([797674f](https://github.com/aurelia/aurelia/commit/797674f))
* **di:** convert invokers to an array (#106) ([9236dec](https://github.com/aurelia/aurelia/commit/9236dec))
* **jit-parcel:** remove else for now, fix instructions ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **template-compiler:** wrap the nodes in a fragment ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **jit-parcel:** remove path mappings from tsconfig ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **template-compiler:** use firstElementChild instead of wrapper ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **template-compiler:** various small tweaks and fixes, make example work ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **jit-parcel:** make the example work with something simple ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **aurelia:** set isStarted=true after tasks have finished ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **e2e:** move publish into e2e job ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **ci:** fix typo ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **ci:** set the correct path before each cmd ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **ci:** try a different approach for the workspaces ([d6a10b5](https://github.com/aurelia/aurelia/commit/d6a10b5))
* **runtime:** correct observer current value update and callback ordering ([5830a36](https://github.com/aurelia/aurelia/commit/5830a36))
* **runtime:** ensure all bindable callback slots are initialized ([5830a36](https://github.com/aurelia/aurelia/commit/5830a36))
* **runtime-behavior:** remove use of Toggle in favor of simple boolean ([5830a36](https://github.com/aurelia/aurelia/commit/5830a36))
* **observation:** fix subscriber typing ([144b1c6](https://github.com/aurelia/aurelia/commit/144b1c6))
* **kernel:** scripts working ([9302580](https://github.com/aurelia/aurelia/commit/9302580))
* **all:** lots of path fixes and a few typing fixes, make sure everything builds correctly ([9302580](https://github.com/aurelia/aurelia/commit/9302580))
* **test:** make all the tests run via lerna ([9302580](https://github.com/aurelia/aurelia/commit/9302580))
* **binding:** implement ChangeSet ([#58](https://github.com/aurelia/aurelia/issues/58)) ([144b1c6](https://github.com/aurelia/aurelia/commit/144b1c6))
* **runtime:** convert with attribute to use render location ([#64](https://github.com/aurelia/aurelia/issues/64)) ([5830a36](https://github.com/aurelia/aurelia/commit/5830a36))
### Refactorings:
* **di:** append new resolvers on existing keys to a single array strategy resolver instead of nesting them ([6bc2d4d](https://github.com/aurelia/aurelia/commit/6bc2d4d))
* **bindable:** use platform.kebabCase ([8debe4f](https://github.com/aurelia/aurelia/commit/8debe4f))
* **binding:** use ChangeSet instead of TaskQueue ([144b1c6](https://github.com/aurelia/aurelia/commit/144b1c6))
* **property-observer:** make reusable decorator for setter/observer ([144b1c6](https://github.com/aurelia/aurelia/commit/144b1c6))

53

dist/index.es6.js
const camelCaseLookup = {};
const kebabCaseLookup = {};
const PLATFORM = {
// tslint:disable-next-line:no-any
global: (function () {
// Workers don’t have `window`, only `self`
// tslint:disable-next-line:no-typeof-undefined
if (typeof self !== 'undefined') {
return self;
}
// tslint:disable-next-line:no-typeof-undefined
if (typeof global !== 'undefined') {

@@ -14,2 +17,3 @@ return global;

// Use only as a last resort:
// tslint:disable-next-line:no-function-constructor-with-string-args
return new Function('return this')();

@@ -62,2 +66,3 @@ })(),

},
// tslint:disable-next-line:no-any
toArray(input) {

@@ -74,34 +79,2 @@ // benchmark: http://jsben.ch/xjsyF

return requestAnimationFrame(callback);
},
createTaskFlushRequester(onFlush) {
return function requestFlush() {
// We dispatch a timeout with a specified delay of 0 for engines that
// can reliably accommodate that request. This will usually be snapped
// to a 4 millisecond delay, but once we're flushing, there's no delay
// between events.
const timeoutHandle = setTimeout(handleFlushTimer, 0);
// However, since this timer gets frequently dropped in Firefox
// workers, we enlist an interval handle that will try to fire
// an event 20 times per second until it succeeds.
const intervalHandle = setInterval(handleFlushTimer, 50);
function handleFlushTimer() {
// Whichever timer succeeds will cancel both timers and request the
// flush.
clearTimeout(timeoutHandle);
clearInterval(intervalHandle);
onFlush();
}
};
},
createMicroTaskFlushRequestor(onFlush) {
const observer = new MutationObserver(onFlush);
const node = document.createTextNode('');
const values = Object.create(null);
let val = 'a';
values.a = 'b';
values.b = 'a';
observer.observe(node, { characterData: true });
return function requestFlush() {
node.data = val = values[val];
};
}

@@ -165,17 +138,18 @@ };

Key.register = function (container, key) {
const trueKey = key || Key;
return configure({
instance(value) {
return container.registerResolver(Key, new Resolver(key || Key, 0 /* instance */, value));
return container.registerResolver(trueKey, new Resolver(trueKey, 0 /* instance */, value));
},
singleton(value) {
return container.registerResolver(Key, new Resolver(key || Key, 1 /* singleton */, value));
return container.registerResolver(trueKey, new Resolver(trueKey, 1 /* singleton */, value));
},
transient(value) {
return container.registerResolver(Key, new Resolver(key || Key, 2 /* transient */, value));
return container.registerResolver(trueKey, new Resolver(trueKey, 2 /* transient */, value));
},
callback(value) {
return container.registerResolver(Key, new Resolver(key || Key, 3 /* callback */, value));
return container.registerResolver(trueKey, new Resolver(trueKey, 3 /* callback */, value));
},
aliasTo(destinationKey) {
return container.registerResolver(destinationKey, new Resolver(key || Key, 5 /* alias */, Key));
return container.registerResolver(trueKey, new Resolver(trueKey, 5 /* alias */, destinationKey));
},

@@ -397,3 +371,2 @@ });

}
/* tslint:disable-next-line:no-this-assignment */
let current = this;

@@ -426,3 +399,2 @@ while (current !== null) {

}
/* tslint:disable-next-line:no-this-assignment */
let current = this;

@@ -444,3 +416,2 @@ while (current !== null) {

validateKey(key);
/* tslint:disable-next-line:no-this-assignment */
let current = this;

@@ -476,3 +447,3 @@ while (current !== null) {

if (keyAsValue.register) {
return keyAsValue.register(handler, keyAsValue);
return keyAsValue.register(handler, keyAsValue) || null;
}

@@ -479,0 +450,0 @@ const resolver = new Resolver(keyAsValue, 1 /* singleton */, keyAsValue);

@@ -10,7 +10,10 @@ (function (global, factory) {

const PLATFORM = {
// tslint:disable-next-line:no-any
global: (function () {
// Workers don’t have `window`, only `self`
// tslint:disable-next-line:no-typeof-undefined
if (typeof self !== 'undefined') {
return self;
}
// tslint:disable-next-line:no-typeof-undefined
if (typeof global !== 'undefined') {

@@ -21,2 +24,3 @@ return global;

// Use only as a last resort:
// tslint:disable-next-line:no-function-constructor-with-string-args
return new Function('return this')();

@@ -69,2 +73,3 @@ })(),

},
// tslint:disable-next-line:no-any
toArray(input) {

@@ -81,34 +86,2 @@ // benchmark: http://jsben.ch/xjsyF

return requestAnimationFrame(callback);
},
createTaskFlushRequester(onFlush) {
return function requestFlush() {
// We dispatch a timeout with a specified delay of 0 for engines that
// can reliably accommodate that request. This will usually be snapped
// to a 4 millisecond delay, but once we're flushing, there's no delay
// between events.
const timeoutHandle = setTimeout(handleFlushTimer, 0);
// However, since this timer gets frequently dropped in Firefox
// workers, we enlist an interval handle that will try to fire
// an event 20 times per second until it succeeds.
const intervalHandle = setInterval(handleFlushTimer, 50);
function handleFlushTimer() {
// Whichever timer succeeds will cancel both timers and request the
// flush.
clearTimeout(timeoutHandle);
clearInterval(intervalHandle);
onFlush();
}
};
},
createMicroTaskFlushRequestor(onFlush) {
const observer = new MutationObserver(onFlush);
const node = document.createTextNode('');
const values = Object.create(null);
let val = 'a';
values.a = 'b';
values.b = 'a';
observer.observe(node, { characterData: true });
return function requestFlush() {
node.data = val = values[val];
};
}

@@ -172,17 +145,18 @@ };

Key.register = function (container, key) {
const trueKey = key || Key;
return configure({
instance(value) {
return container.registerResolver(Key, new Resolver(key || Key, 0 /* instance */, value));
return container.registerResolver(trueKey, new Resolver(trueKey, 0 /* instance */, value));
},
singleton(value) {
return container.registerResolver(Key, new Resolver(key || Key, 1 /* singleton */, value));
return container.registerResolver(trueKey, new Resolver(trueKey, 1 /* singleton */, value));
},
transient(value) {
return container.registerResolver(Key, new Resolver(key || Key, 2 /* transient */, value));
return container.registerResolver(trueKey, new Resolver(trueKey, 2 /* transient */, value));
},
callback(value) {
return container.registerResolver(Key, new Resolver(key || Key, 3 /* callback */, value));
return container.registerResolver(trueKey, new Resolver(trueKey, 3 /* callback */, value));
},
aliasTo(destinationKey) {
return container.registerResolver(destinationKey, new Resolver(key || Key, 5 /* alias */, Key));
return container.registerResolver(trueKey, new Resolver(trueKey, 5 /* alias */, destinationKey));
},

@@ -404,3 +378,2 @@ });

}
/* tslint:disable-next-line:no-this-assignment */
let current = this;

@@ -433,3 +406,2 @@ while (current !== null) {

}
/* tslint:disable-next-line:no-this-assignment */
let current = this;

@@ -451,3 +423,2 @@ while (current !== null) {

validateKey(key);
/* tslint:disable-next-line:no-this-assignment */
let current = this;

@@ -483,3 +454,3 @@ while (current !== null) {

if (keyAsValue.register) {
return keyAsValue.register(handler, keyAsValue);
return keyAsValue.register(handler, keyAsValue) || null;
}

@@ -486,0 +457,0 @@ const resolver = new Resolver(keyAsValue, 1 /* singleton */, keyAsValue);

@@ -10,2 +10,10 @@ export interface ICallable {

};
export declare type Decoratable<TOptional, TRequired> = Function & {
readonly prototype: Partial<TOptional> & Required<TRequired>;
new (...args: any[]): Partial<TOptional> & Required<TRequired>;
};
export declare type Decorated<TOptional, TRequired> = Function & {
readonly prototype: Required<TOptional> & Required<TRequired>;
new (...args: any[]): any;
};
export declare type Injectable<T = {}> = Constructable<T> & {

@@ -28,2 +36,3 @@ inject?: any[];

export declare type Primitive = undefined | null | number | boolean | symbol | string;
export declare type Unwrap<T> = T extends (infer U)[] ? U : T extends (...args: any[]) => infer U ? U : T extends Promise<infer U> ? U : T;
//# sourceMappingURL=interfaces.d.ts.map

@@ -11,5 +11,3 @@ export declare const PLATFORM: {

requestAnimationFrame(callback: (time: number) => void): number;
createTaskFlushRequester(onFlush: () => void): () => void;
createMicroTaskFlushRequestor(onFlush: () => void): () => void;
};
//# sourceMappingURL=platform.d.ts.map
{
"name": "@aurelia/kernel",
"version": "0.2.0",
"version": "0.3.0-dev.20181013",
"main": "dist/index.umd.js",

@@ -25,2 +25,3 @@ "module": "dist/index.es6.js",

"dist",
"src",
"README.md",

@@ -84,3 +85,3 @@ "CHANGELOG.md",

},
"gitHead": "712101a020943279230b68b075305246f84d1037"
"gitHead": "6ba681c5c0255796f55855f2e64b3adcc4c494c3"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc