Skip to content

Commit c3e6366

Browse files
committed
Refactor typings
1 parent e072ab9 commit c3e6366

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+166
-319
lines changed

package.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
"url": "https://github.com/trueadm/inferno/issues"
1212
},
1313
"devDependencies": {
14-
"@types/benchmark": "^1.0.30",
1514
"@types/chai": "^3.4.34",
16-
"@types/core-js": "^0.9.35",
1715
"@types/mocha": "^2.2.33",
1816
"@types/node": "^6.0.51",
17+
"@types/path-to-regexp": "^1.0.29",
1918
"@types/sinon": "^1.16.33",
2019
"babel-cli": "^6.18.0",
2120
"babel-core": "^6.20.0",
@@ -37,7 +36,7 @@
3736
"babel-register": "^6.18.0",
3837
"buble": "^0.14.3",
3938
"chai": "^3.5.0",
40-
"concat-stream-es6": "0.0.1",
39+
"concat-stream": "^1.5.2",
4140
"convert-source-map": "^1.3.0",
4241
"coveralls": "^2.11.15",
4342
"cross-env": "^3.1.3",
@@ -130,9 +129,8 @@
130129
"exclude": [
131130
"packages",
132131
"src/DOM/devtools.ts",
133-
"src/inferno.d.ts",
134-
"src/**/*__tests__*/**",
135-
"typings"
132+
"src/typings/*.d.ts",
133+
"src/**/*__tests__*/**"
136134
],
137135
"extension": [
138136
".ts"

packages/inferno/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
createVNode
33
} from '../../../build/core/shapes';
44
import cloneVNode from '../../../build/factories/cloneVNode';
5-
import { warning, NO_OP, isBrowser, EMPTY_OBJ } from '../../../build/shared';
5+
import { warning, NO_OP, isBrowser, EMPTY_OBJ } from '../../../build/tools/shared';
66
import { render, findDOMNode, createRenderer, enableFindDOMNode } from '../../../build/DOM/rendering';
77
import { disableRecycling } from '../../../build/DOM/recycling';
88
import { initDevToolsHooks } from '../../../build/DOM/devtools';

src/DOM/__tests__/columnrender.spec.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from 'chai';
22
import { spy } from 'sinon';
33
import Component from 'inferno-component';
4-
import { isNullOrUndef } from '../../shared';
4+
import { isNullOrUndef } from '../../tools/shared';
55
import Inferno, { render } from 'inferno';
66
Inferno; // suppress ts 'never used' error
77

src/DOM/devtools.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isFunction, isNull, isUndefined } from '../shared';
1+
import { isFunction, isNull, isUndefined } from '../tools/shared';
22
import { render, roots } from './rendering';
33

44
export const devToolsStatus = {

src/DOM/hydration.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
isUndefined,
1212
throwError,
1313
EMPTY_OBJ,
14-
} from '../shared';
14+
} from '../tools/shared';
1515
import {
1616
mountElement,
1717
mountStatefulComponentCallbacks,

src/DOM/mounting.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
isUndefined,
99
throwError,
1010
EMPTY_OBJ,
11-
} from '../shared';
11+
} from '../tools/shared';
1212
import { VNodeFlags, isVNode, copyPropsTo } from '../core/shapes';
1313
import {
1414
appendChild,

src/DOM/patching.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
isStringOrNumber,
1414
isUndefined,
1515
throwError,
16-
} from '../shared';
16+
} from '../tools/shared';
1717
import {
1818
VNode,
1919
VNodeFlags,

src/DOM/recycling.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { VNode, VNodeFlags } from '../core/shapes';
22
import {
33
isNull,
44
isUndefined,
5-
} from '../shared';
5+
} from '../tools/shared';
66
import {
77
patchComponent,
88
patchElement,

src/DOM/rendering.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
isNull,
77
isNullOrUndef,
88
throwError,
9-
} from '../shared';
9+
} from '../tools/shared';
1010
import {
1111
devToolsStatus,
1212
sendRoots,

src/DOM/unmounting.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
isObject,
77
throwError,
88
isNull,
9-
} from '../shared';
9+
} from '../tools/shared';
1010
import {
1111
poolComponent,
1212
poolElement,

src/DOM/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
isUndefined,
1010
throwError,
1111
EMPTY_OBJ
12-
} from '../shared';
12+
} from '../tools/shared';
1313

1414
import cloneVNode from '../factories/cloneVNode';
1515
import { componentToDOMNodeMap, findDOMNodeEnabled } from './rendering';

src/DOM/wrappers/InputWrapper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
EMPTY_OBJ,
33
isNullOrUndef
4-
} from '../../shared';
4+
} from '../../tools/shared';
55
import { wrappers } from './processElement';
66

77
function isCheckedType(type) {

src/DOM/wrappers/SelectWrapper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
isArray,
33
EMPTY_OBJ,
44
isNullOrUndef
5-
} from '../../shared';
5+
} from '../../tools/shared';
66
import { wrappers } from './processElement';
77
import { isVNode } from '../../core/shapes';
88

src/DOM/wrappers/TextareaWrapper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
EMPTY_OBJ,
33
isNullOrUndef
4-
} from '../../shared';
4+
} from '../../tools/shared';
55
import { wrappers } from './processElement';
66

77
function isControlled(props) {

src/component/createClass.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isFunction, isNullOrUndef, isUndefined } from '../shared';
1+
import { isFunction, isNullOrUndef, isUndefined } from '../tools/shared';
22

33
import Component from 'inferno-component';
44
import { ComponentSpec } from './es2015';

src/component/es2015.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
isNullOrUndef,
77
throwError,
88
ERROR_MSG
9-
} from '../shared';
9+
} from '../tools/shared';
1010
import {
1111
Props,
1212
VNode,

src/core/shapes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
isUndefined,
88
isString,
99
isNull
10-
} from '../shared';
10+
} from '../tools/shared';
1111

1212
import cloneVNode from '../factories/cloneVNode';
1313

src/factories/cloneVNode.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
isNullOrUndef,
1313
isUndefined,
1414
isInvalid
15-
} from '../shared';
15+
} from '../tools/shared';
1616

1717
export default function cloneVNode(vNodeToClone: VNode, props?: Props, ..._children: InfernoChildren[]): VNode {
1818
let children: any = _children;

src/factories/createElement.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
isUndefined,
1313
isObject,
1414
isStatefulComponent
15-
} from '../shared';
15+
} from '../tools/shared';
1616

1717
const componentHooks = {
1818
onComponentWillMount: true,

src/factories/hyperscript.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
isString,
1111
isStringOrNumber,
1212
isUndefined,
13-
} from '../shared';
13+
} from '../tools/shared';
1414

1515
const classIdSplit = /([.#]?[a-zA-Z0-9_:-]+)/;
1616
const notClassId = /^\.|#/;

src/factories/isValidElement.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
import {
66
isNull,
77
isObject
8-
} from '../shared';
8+
} from '../tools/shared';
99

1010
export default function isValidElement(obj: VNode): boolean {
1111
const isNotANullObject = isObject(obj) && isNull(obj) === false;

src/inferno.d.ts

-137
This file was deleted.

src/mobx/Provider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Component from 'inferno-component';
2-
import { warning } from '../shared';
2+
import { warning } from '../tools/shared';
33

44
const specialKeys = {
55
children: true,

src/mobx/__tests__/makeReactive.spec.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('MobX Observer', () => {
1010
let container;
1111
let store = {
1212
todos: observable(['one', 'two']),
13-
extra: observable({ test: 'observable!' })
13+
extra: observable({ test: 'observable!' }) as any // TOOD: {LukeSheard} Fix this hack
1414
};
1515

1616
beforeEach(() => {
@@ -65,7 +65,9 @@ describe('MobX Observer', () => {
6565
});
6666

6767
render(<FlatList extra={ store.extra }/>, container);
68-
store.extra = toJS({ test: 'XXX' });
68+
store.extra = toJS({
69+
test: 'XXX'
70+
});
6971
render(<FlatList extra={ store.extra }/>, container);
7072
extendObservable(store, {
7173
test: 'new entry'

src/mobx/connect.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Component from 'inferno-component';
22
import createClass from 'inferno-create-class';
33
import inject from './inject';
44
import makeReactive from './makeReactive';
5-
import { throwError } from '../shared';
5+
import { throwError } from '../tools/shared';
66

77
/**
88
* Wraps a component and provides stores as props

src/mobx/makeReactive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Reaction, extras, isObservable } from 'mobx';
22

33
import Component from 'inferno-component';
44
import EventEmitter from './EventEmitter';
5-
import { throwError } from '../shared';
5+
import { throwError } from '../tools/shared';
66

77
/**
88
* Dev tools support

src/redux/Provider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { warning } from './utils';
33
import {
44
isNullOrUndef,
55
toArray
6-
} from '../shared';
6+
} from '../tools/shared';
77

88
let didWarnAboutReceivingStore = false;
99
function warnAboutReceivingStore() {

0 commit comments

Comments
 (0)