Skip to content

Commit

Permalink
fix(all): remove core-js dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Feb 25, 2016
1 parent 45591f9 commit a48268d
Show file tree
Hide file tree
Showing 28 changed files with 31 additions and 64 deletions.
4 changes: 4 additions & 0 deletions config.js
Expand Up @@ -18,6 +18,7 @@ System.config({
"aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.1.3",
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1",
"aurelia-pal-browser": "npm:aurelia-pal-browser@1.0.0-beta.1.1.2",
"aurelia-polyfills": "npm:aurelia-polyfills@0.1.2",
"aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.1.0",
"babel": "npm:babel-core@5.8.35",
"babel-runtime": "npm:babel-runtime@5.8.35",
Expand Down Expand Up @@ -51,6 +52,9 @@ System.config({
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1",
"core-js": "npm:core-js@2.0.3"
},
"npm:aurelia-polyfills@0.1.2": {
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1"
},
"npm:aurelia-task-queue@1.0.0-beta.1.1.0": {
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1"
},
Expand Down
10 changes: 4 additions & 6 deletions package.json
Expand Up @@ -29,18 +29,17 @@
"peerDependencies": {
"aurelia-metadata": "^1.0.0-beta.1.1.3",
"aurelia-pal": "^1.0.0-beta.1.1.1",
"aurelia-task-queue": "^1.0.0-beta.1.1.0",
"core-js": "^2.0.3"
"aurelia-task-queue": "^1.0.0-beta.1.1.0"
},
"dependencies": {
"aurelia-metadata": "^1.0.0-beta.1.1.3",
"aurelia-pal": "^1.0.0-beta.1.1.1",
"aurelia-task-queue": "^1.0.0-beta.1.1.0",
"core-js": "^2.0.3"
"aurelia-task-queue": "^1.0.0-beta.1.1.0"
},
"devDependencies": {
"aurelia-dependency-injection": "^1.0.0-beta.1.1.2",
"aurelia-pal-browser": "^1.0.0-beta.1.1.2",
"aurelia-polyfills": "^0.1.2",
"babel": "babel-core@^5.8.24",
"babel-runtime": "^5.8.24",
"core-js": "^2.0.3"
Expand All @@ -49,8 +48,7 @@
"dependencies": {
"aurelia-metadata": "^1.0.0-beta.1.1.3",
"aurelia-pal": "^1.0.0-beta.1.1.1",
"aurelia-task-queue": "^1.0.0-beta.1.1.0",
"core-js": "^2.0.3"
"aurelia-task-queue": "^1.0.0-beta.1.1.0"
},
"devDependencies": {
"aurelia-tools": "^0.1.12",
Expand Down
1 change: 0 additions & 1 deletion src/binding-behavior-resource.js
@@ -1,4 +1,3 @@
import 'core-js';
import {camelCase} from './camel-case';
import {metadata} from 'aurelia-metadata';

Expand Down
1 change: 0 additions & 1 deletion src/map-observation.js
@@ -1,4 +1,3 @@
import 'core-js';
import {getChangeRecords} from './map-change-records';
import {ModifyCollectionObserver} from './collection-observation';

Expand Down
1 change: 0 additions & 1 deletion src/property-observation.js
@@ -1,4 +1,3 @@
import 'core-js';
import {subscriberCollection} from './subscriber-collection';

export const propertyAccessor = {
Expand Down
1 change: 0 additions & 1 deletion src/set-observation.js
@@ -1,4 +1,3 @@
import 'core-js';
import {getChangeRecords} from './map-change-records';
import {ModifyCollectionObserver} from './collection-observation';

Expand Down
1 change: 0 additions & 1 deletion src/value-converter-resource.js
@@ -1,4 +1,3 @@
import 'core-js';
import {camelCase} from './camel-case';
import {metadata} from 'aurelia-metadata';

Expand Down
3 changes: 1 addition & 2 deletions test/access-keyed-observer.spec.js
@@ -1,3 +1,4 @@
import './setup';
import {bindingMode} from '../src/binding-mode';
import {
createElement,
Expand All @@ -6,14 +7,12 @@ import {
createObserverLocator,
getBinding
} from './shared';
import {initialize} from 'aurelia-pal-browser';
import {createScopeForTest} from '../src/scope';

describe('AccessKeyedObserver', () => {
var observerLocator;

beforeAll(() => {
initialize();
observerLocator = createObserverLocator();
});

Expand Down
4 changes: 1 addition & 3 deletions test/binding-behavior-resource.spec.js
@@ -1,9 +1,7 @@
import './setup';
import {BindingBehaviorResource} from '../src/binding-behavior-resource';
import {initialize} from 'aurelia-pal-browser';

describe('BindingBehaviorResource', () => {
beforeAll(() => initialize());

it('uses ends with BindingBehavior convention', () => {
expect(BindingBehaviorResource.convention('FooBindingBehavior')).toBeDefined();
expect(BindingBehaviorResource.convention('FooBindingBehavior') instanceof BindingBehaviorResource).toBe(true);
Expand Down
3 changes: 1 addition & 2 deletions test/call-expression.spec.js
@@ -1,3 +1,4 @@
import './setup';
import {
createElement,
fireEvent,
Expand All @@ -7,14 +8,12 @@ import {
} from './shared';
import {Parser} from '../src/parser';
import {CallExpression} from '../src/call-expression';
import {initialize} from 'aurelia-pal-browser';
import {createScopeForTest} from '../src/scope';

describe('CallExpression', () => {
let expression, viewModel, target = {}, binding;

beforeAll(() => {
initialize();
viewModel = {
arg1: 1,
arg2: { hello: 'world' },
Expand Down
3 changes: 1 addition & 2 deletions test/checked-observer.spec.js
@@ -1,3 +1,4 @@
import './setup';
import {bindingMode} from '../src/binding-mode';
import {
createElement,
Expand All @@ -6,14 +7,12 @@ import {
createObserverLocator,
getBinding
} from './shared';
import {initialize} from 'aurelia-pal-browser';
import {createScopeForTest} from '../src/scope';

describe('CheckedObserver', () => {
var observerLocator;

beforeAll(() => {
initialize();
observerLocator = createObserverLocator();
});

Expand Down
3 changes: 1 addition & 2 deletions test/class-observer.spec.js
@@ -1,15 +1,14 @@
import './setup';
import {
createObserverLocator,
createElement
} from './shared';
import {ClassObserver} from '../src/class-observer';
import {initialize} from 'aurelia-pal-browser';

describe('ClassObserver', () => {
var element, observerA, observerB;

beforeAll(() => {
initialize();
var locator = createObserverLocator();
element = createElement('<div class="foo bar"></div>');
observerA = locator.getObserver(element, 'class');
Expand Down
4 changes: 1 addition & 3 deletions test/collection-observeration.spec.js
@@ -1,11 +1,10 @@
import './setup';
import {createObserverLocator, checkDelay} from './shared';
import {ModifyCollectionObserver} from '../src/collection-observation';
import {initialize} from 'aurelia-pal-browser';

describe('collection length', () => {
var locator;
beforeAll(() => {
initialize();
locator = createObserverLocator();
});

Expand Down Expand Up @@ -43,7 +42,6 @@ describe('collection length', () => {
describe('addChangeRecord', () => {
var locator;
beforeAll(() => {
initialize();
locator = new ModifyCollectionObserver();
locator.lengthObserver = true;
locator.queued = true;
Expand Down
3 changes: 1 addition & 2 deletions test/composite-observer.spec.js
@@ -1,3 +1,4 @@
import './setup';
import {bindingMode} from '../src/binding-mode';
import {sourceContext} from '../src/connectable-binding';
import {
Expand All @@ -7,14 +8,12 @@ import {
createObserverLocator,
getBinding
} from './shared';
import {initialize} from 'aurelia-pal-browser';
import {createScopeForTest} from '../src/scope';

describe('CompositeObserver', () => {
let observerLocator;

beforeAll(() => {
initialize();
observerLocator = createObserverLocator();
});

Expand Down
4 changes: 1 addition & 3 deletions test/computed-observation.spec.js
@@ -1,11 +1,9 @@
import './setup';
import {declarePropertyDependencies} from '../src/computed-observation';
import {ComputedPropertyObserver} from '../src/computed-observation';
import {createObserverLocator, Person, Foo} from './shared';
import {initialize} from 'aurelia-pal-browser';

describe('declarePropertyDependencies', () => {
beforeAll(() => initialize());

it('should declare dependencies for properties with a getter', () => {
var dependencies = ['firstName', 'lastName'],
person = new Person();
Expand Down
4 changes: 1 addition & 3 deletions test/connect-queue.spec.js
@@ -1,13 +1,11 @@
import './setup';
import {PLATFORM, DOM} from 'aurelia-pal';
import {initialize as initializePAL} from 'aurelia-pal-browser';
import {Container} from 'aurelia-dependency-injection';
import {TaskQueue} from 'aurelia-task-queue';
import {BindingEngine} from '../src/binding-engine';
import {bindingMode} from '../src/binding-mode';
import {createOverrideContext} from '../src/scope';

initializePAL();

describe('connect-queue', () => {
let bindingEngine, taskQueue;

Expand Down
3 changes: 1 addition & 2 deletions test/dirty-checking.spec.js
@@ -1,16 +1,15 @@
import './setup';
import {DirtyCheckProperty} from '../src/dirty-checking';
import {
FooNoDep,
executeSharedPropertyObserverTests,
createObserverLocator
} from './shared';
import {initialize} from 'aurelia-pal-browser';

describe('DirtyCheckProperty', () => {
var obj, observerLocator, observer;

beforeAll(() => {
initialize();
obj = new FooNoDep();
observerLocator = createObserverLocator();
observer = observerLocator.getObserver(obj, 'bar');
Expand Down
3 changes: 1 addition & 2 deletions test/element-observation.spec.js
@@ -1,3 +1,4 @@
import './setup';
import {SetterObserver} from '../src/property-observation';
import {DirtyCheckProperty} from '../src/dirty-checking';
import {
Expand All @@ -12,7 +13,6 @@ import {
createObserverLocator,
executeSharedPropertyObserverTests
} from './shared';
import {initialize} from 'aurelia-pal-browser';

function createSvgUseElement() {
var html = [
Expand All @@ -33,7 +33,6 @@ function createSvgUseElement() {
describe('element observation', () => {
var locator;
beforeAll(() => {
initialize();
locator = createObserverLocator();
});

Expand Down
4 changes: 1 addition & 3 deletions test/event-manager.spec.js
@@ -1,10 +1,8 @@
import './setup';
import {EventManager} from '../src/event-manager';
import {createElement, createEvent} from './shared';
import {initialize} from 'aurelia-pal-browser';

describe('EventManager', () => {
beforeAll(() => initialize());

describe('getElementHandler', () => {
var em;
beforeAll(() => em = new EventManager());
Expand Down
6 changes: 1 addition & 5 deletions test/listener-expression.spec.js
@@ -1,16 +1,12 @@
import './setup';
import {fireEvent, checkDelay} from './shared';
import {Parser} from '../src/parser';
import {EventManager} from '../src/event-manager';
import {ListenerExpression} from '../src/listener-expression';
import {initialize as initializePAL} from 'aurelia-pal-browser';
import {createScopeForTest} from '../src/scope';
import {DOM} from 'aurelia-pal';

describe('ListenerExpression', () => {
beforeAll(() => {
initializePAL();
});

it('binds', () => {
let eventName = 'mousemove';

Expand Down
5 changes: 1 addition & 4 deletions test/map-observation.spec.js
@@ -1,11 +1,10 @@
import './setup';
import {TaskQueue} from 'aurelia-task-queue';
import {getMapObserver} from '../src/map-observation';
import {initialize} from 'aurelia-pal-browser';

describe('getMapObserver', () => {
let taskQueue;
beforeAll(() => {
initialize();
taskQueue = new TaskQueue();
});

Expand Down Expand Up @@ -49,7 +48,6 @@ describe('ModifyMapObserver', () => {
let observer;
let callback;
beforeAll(() => {
initialize();
taskQueue = new TaskQueue();
});

Expand Down Expand Up @@ -144,7 +142,6 @@ describe('ModifyMapObserver of extended Map', () => {
return m;
}
beforeAll(() => {
initialize();
taskQueue = new TaskQueue();
});

Expand Down
3 changes: 1 addition & 2 deletions test/observer-locator.spec.js
@@ -1,3 +1,4 @@
import './setup';
import {TestObservationAdapter} from './adapter';
import {DirtyCheckProperty} from '../src/dirty-checking';
import {SetterObserver} from '../src/property-observation';
Expand All @@ -11,13 +12,11 @@ import {SelectValueObserver} from '../src/select-value-observer';
import {CheckedObserver} from '../src/checked-observer';
import {createElement, createObserverLocator} from './shared';
import {FEATURE} from 'aurelia-pal';
import {initialize} from 'aurelia-pal-browser';

describe('ObserverLocator', () => {
var locator;

beforeAll(() => {
initialize();
locator = createObserverLocator([new TestObservationAdapter(() => locator)]);
});

Expand Down
3 changes: 1 addition & 2 deletions test/select-value-observer.spec.js
@@ -1,3 +1,4 @@
import './setup';
import {bindingMode} from '../src/binding-mode';
import {
createElement,
Expand All @@ -6,14 +7,12 @@ import {
createObserverLocator,
getBinding
} from './shared';
import {initialize} from 'aurelia-pal-browser';
import {createScopeForTest} from '../src/scope';

describe('SelectValueObserver', () => {
var observerLocator;

beforeAll(() => {
initialize();
observerLocator = createObserverLocator();
});

Expand Down

6 comments on commit a48268d

@hmarcelodn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EisenbergEffect I am experiencing an error with Core.js. Could you give me some guidance?

Should I remove corejs ? should I update Aurelia Packages?

GET http://localhost/lib/npm/core-js@0.9.18.js 404 (Not Found)q @ system.js:4(anonymous function) @ system.js:4(anonymous function) @ system.js:4(anonymous function) @ system.js:5(anonymous function) @ system.js:5(anonymous function) @ system.js:5(anonymous function) @ system.js:5(anonymous function) @ system.js:5(anonymous function) @ system.js:5(anonymous function) @ system.js:4
system.js:4 Uncaught (in promise) Error: XHR error (404 Not Found) loading http://tcms-anywhere-dv/lib/npm/core-js@0.9.18.js(…)

@EisenbergEffect
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't remove core-js until we make the new release which removes it as a core dependency and provides our own minimal set of polyfills. It looks like you have something in your config.js referencing a particular version of core-js that you don't have installed. Look to see what you have installed and then update the version in your config.js to match.

@hmarcelodn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EisenbergEffect Thanks! I will check.

@hmarcelodn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EisenbergEffect We have 3 core-js versions running. All different librearies are pointing to those versions.

"npm:core-js@0.9.18": {
  "fs": "github:jspm/nodelibs-fs@0.1.2",
  "process": "github:jspm/nodelibs-process@0.1.2",
  "systemjs-json": "github:systemjs/plugin-json@0.1.0"
},
"npm:core-js@1.2.6": {
  "fs": "github:jspm/nodelibs-fs@0.1.2",
  "path": "github:jspm/nodelibs-path@0.1.0",
  "process": "github:jspm/nodelibs-process@0.1.2",
  "systemjs-json": "github:systemjs/plugin-json@0.1.0"
},
"npm:core-js@2.1.1": {
  "fs": "github:jspm/nodelibs-fs@0.1.2",
  "path": "github:jspm/nodelibs-path@0.1.0",
  "process": "github:jspm/nodelibs-process@0.1.2",
  "systemjs-json": "github:systemjs/plugin-json@0.1.0"
},

@EisenbergEffect
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's your problem. You should never have that. Go with the latest version and update the dependencies in the config.js.

@hmarcelodn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EisenbergEffect Perfect. I fixed the Issue upgrading core-js and all aurelia packages into the latest version.

Probably next week when you release that change we should consider a general update.

Thanks a lot.

Please sign in to comment.