Skip to content

Commit

Permalink
Removing the built-in Promise implementation.
Browse files Browse the repository at this point in the history
This will cause the browser tests to blow up since Phantom doesn't
do promises. Will need to fix that, but I also intend to push out
this code first separately.
  • Loading branch information
fskreuz committed Dec 2, 2016
1 parent d1b5e64 commit 843ae62
Show file tree
Hide file tree
Showing 14 changed files with 8 additions and 271 deletions.
2 changes: 0 additions & 2 deletions package.json
Expand Up @@ -22,7 +22,6 @@
"karma-phantomjs-launcher": "~1.0",
"karma-qunit": "~1.2",
"phantomjs-prebuilt": "~2.1",
"promises-aplus-tests": "^2.1.0",
"qunit-cli": "^0.2.0",
"qunitjs": "~2.0",
"rollup": "^0.36.0",
Expand All @@ -37,7 +36,6 @@
"lint:src": "eslint src/ --ext .js",
"lint:test": "eslint test/node-tests/ test/browser-tests/ --ext .js",
"test": "sh ./scripts/test.sh",
"promises-aplus-tests": "./scripts/promises-aplus-tests.js",
"build": "sh ./scripts/build.sh",
"fakebuild": "sh ./scripts/build.sh --fake",
"release": "sh ./scripts/release.sh",
Expand Down
39 changes: 0 additions & 39 deletions scripts/promises-aplus-tests.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/Ractive.js
Expand Up @@ -4,7 +4,6 @@ import interpolators from './Ractive/static/interpolators';
import { magic, svg, win } from './config/environment';
import { defineProperties, extend as extendObj } from './utils/object';
import proto from './Ractive/prototype';
import Promise from './utils/Promise';
import extend from './extend/_extend';
import parse from './parse/_parse';
import getNodeInfo from './Ractive/static/getNodeInfo';
Expand Down Expand Up @@ -58,9 +57,6 @@ defineProperties( Ractive, {
unescapeKey: { value: unescapeKey },
getCSS: { value: getCSS },

// namespaced constructors
Promise: { value: Promise },

// support
enhance: { writable: true, value: false },
svg: { value: svg },
Expand Down
1 change: 0 additions & 1 deletion src/Ractive/prototype/animate.js
@@ -1,6 +1,5 @@
import runloop from '../../global/runloop';
import interpolate from '../../shared/interpolate';
import Promise from '../../utils/Promise';
import { defineProperty } from '../../utils/object';
import { isEqual } from '../../utils/is';
import { splitKeypath } from '../../shared/keypaths';
Expand Down
1 change: 0 additions & 1 deletion src/Ractive/prototype/teardown.js
@@ -1,5 +1,4 @@
import Hook from '../../events/Hook';
import Promise from '../../utils/Promise';
import { removeFromArray } from '../../utils/array';
import { cancel } from '../../shared/methodCallers';
import { warnIfDebug } from '../../utils/log';
Expand Down
1 change: 0 additions & 1 deletion src/Ractive/prototype/unrender.js
@@ -1,6 +1,5 @@
import Hook from '../../events/Hook';
import { warnIfDebug } from '../../utils/log';
import Promise from '../../utils/Promise';
import { removeFromArray } from '../../utils/array';
import runloop from '../../global/runloop';

Expand Down
1 change: 0 additions & 1 deletion src/global/runloop.js
@@ -1,6 +1,5 @@
import Hook from '../events/Hook';
import { addToArray, removeFromArray } from '../utils/array';
import Promise from '../utils/Promise';
import TransitionManager from './TransitionManager';

const changeHook = new Hook( 'change' );
Expand Down
1 change: 0 additions & 1 deletion src/model/Model.js
Expand Up @@ -2,7 +2,6 @@ import ModelBase, { maybeBind, shuffle } from './ModelBase';
import LinkModel from './LinkModel'; // eslint-disable-line no-unused-vars
import KeypathModel from './specials/KeypathModel';
import { capture } from '../global/capture';
import Promise from '../utils/Promise';
import { isArray, isEqual, isNumeric, isObjectLike } from '../utils/is';
import { handleChange, mark, marked, teardown } from '../shared/methodCallers';
import Ticker from '../shared/Ticker';
Expand Down
212 changes: 0 additions & 212 deletions src/utils/Promise.js

This file was deleted.

1 change: 0 additions & 1 deletion src/view/items/element/Transition.js
Expand Up @@ -10,7 +10,6 @@ import { findInViewHierarchy } from '../../../shared/registry';
import { visible } from '../../../config/visibility';
import createTransitions from './transitions/createTransitions';
import resetStyle from './transitions/resetStyle';
import Promise from '../../../utils/Promise';
import { rebindMatch } from '../../../shared/rebind';
import { setupArgsFn, teardownArgsFn } from '../shared/directiveArgs';
import noop from '../../../utils/noop';
Expand Down
4 changes: 2 additions & 2 deletions test/browser-tests/getCSS.js
Expand Up @@ -6,7 +6,7 @@ export default function() {

function createIsolatedEnv () {

return new Ractive.Promise((resolve, reject) => {
return new Promise((resolve, reject) => {

const frame = document.createElement('iframe');

Expand Down Expand Up @@ -90,7 +90,7 @@ export default function() {
const done5 = t.async();

// Simulate two separate Ractive environments using iframes
Ractive.Promise.all([ createIsolatedEnv(), createIsolatedEnv() ]).then(envs => {
Promise.all([ createIsolatedEnv(), createIsolatedEnv() ]).then(envs => {

const ComponentA = createComponentDefinition(envs[ 0 ].Ractive);
const ComponentB = createComponentDefinition(envs[ 1 ].Ractive);
Expand Down
2 changes: 1 addition & 1 deletion test/browser-tests/methods/animate.js
Expand Up @@ -97,7 +97,7 @@ export default function() {
step: () => barSteps += 1
});

Ractive.Promise.all([ p1, p2 ]).then( () => {
Promise.all([ p1, p2 ]).then( () => {
// slightly non-deterministic, so we fuzz it –
// important thing is that computation doesn't
// update for all changes to both foo and bar
Expand Down
4 changes: 2 additions & 2 deletions test/browser-tests/methods/toCSS.js
Expand Up @@ -6,7 +6,7 @@ export default function() {

function createIsolatedEnv() {

return new Ractive.Promise( ( resolve, reject ) => {
return new Promise( ( resolve, reject ) => {

const frame = document.createElement( 'iframe' );

Expand Down Expand Up @@ -150,7 +150,7 @@ export default function() {
const done5 = t.async();

// Simulate two separate Ractive environments using iframes
Ractive.Promise.all( [ createIsolatedEnv(), createIsolatedEnv() ] ).then( envs => {
Promise.all( [ createIsolatedEnv(), createIsolatedEnv() ] ).then( envs => {

const ComponentA = createComponentDefinition( envs[ 0 ].Ractive );
const ComponentB = createComponentDefinition( envs[ 1 ].Ractive );
Expand Down

0 comments on commit 843ae62

Please sign in to comment.