Skip to content

Commit

Permalink
Refactor typings
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeSheard committed Dec 19, 2016
1 parent e072ab9 commit c3e6366
Show file tree
Hide file tree
Showing 47 changed files with 166 additions and 319 deletions.
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
"url": "https://github.com/trueadm/inferno/issues"
},
"devDependencies": {
"@types/benchmark": "^1.0.30",
"@types/chai": "^3.4.34",
"@types/core-js": "^0.9.35",
"@types/mocha": "^2.2.33",
"@types/node": "^6.0.51",
"@types/path-to-regexp": "^1.0.29",
"@types/sinon": "^1.16.33",
"babel-cli": "^6.18.0",
"babel-core": "^6.20.0",
Expand All @@ -37,7 +36,7 @@
"babel-register": "^6.18.0",
"buble": "^0.14.3",
"chai": "^3.5.0",
"concat-stream-es6": "0.0.1",
"concat-stream": "^1.5.2",
"convert-source-map": "^1.3.0",
"coveralls": "^2.11.15",
"cross-env": "^3.1.3",
Expand Down Expand Up @@ -130,9 +129,8 @@
"exclude": [
"packages",
"src/DOM/devtools.ts",
"src/inferno.d.ts",
"src/**/*__tests__*/**",
"typings"
"src/typings/*.d.ts",
"src/**/*__tests__*/**"
],
"extension": [
".ts"
Expand Down
2 changes: 1 addition & 1 deletion packages/inferno/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
createVNode
} from '../../../build/core/shapes';
import cloneVNode from '../../../build/factories/cloneVNode';
import { warning, NO_OP, isBrowser, EMPTY_OBJ } from '../../../build/shared';
import { warning, NO_OP, isBrowser, EMPTY_OBJ } from '../../../build/tools/shared';
import { render, findDOMNode, createRenderer, enableFindDOMNode } from '../../../build/DOM/rendering';
import { disableRecycling } from '../../../build/DOM/recycling';
import { initDevToolsHooks } from '../../../build/DOM/devtools';
Expand Down
2 changes: 1 addition & 1 deletion src/DOM/__tests__/columnrender.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import { spy } from 'sinon';
import Component from 'inferno-component';
import { isNullOrUndef } from '../../shared';
import { isNullOrUndef } from '../../tools/shared';
import Inferno, { render } from 'inferno';
Inferno; // suppress ts 'never used' error

Expand Down
2 changes: 1 addition & 1 deletion src/DOM/devtools.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isFunction, isNull, isUndefined } from '../shared';
import { isFunction, isNull, isUndefined } from '../tools/shared';
import { render, roots } from './rendering';

export const devToolsStatus = {
Expand Down
2 changes: 1 addition & 1 deletion src/DOM/hydration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
isUndefined,
throwError,
EMPTY_OBJ,
} from '../shared';
} from '../tools/shared';
import {
mountElement,
mountStatefulComponentCallbacks,
Expand Down
2 changes: 1 addition & 1 deletion src/DOM/mounting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
isUndefined,
throwError,
EMPTY_OBJ,
} from '../shared';
} from '../tools/shared';
import { VNodeFlags, isVNode, copyPropsTo } from '../core/shapes';
import {
appendChild,
Expand Down
2 changes: 1 addition & 1 deletion src/DOM/patching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
isStringOrNumber,
isUndefined,
throwError,
} from '../shared';
} from '../tools/shared';
import {
VNode,
VNodeFlags,
Expand Down
2 changes: 1 addition & 1 deletion src/DOM/recycling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { VNode, VNodeFlags } from '../core/shapes';
import {
isNull,
isUndefined,
} from '../shared';
} from '../tools/shared';
import {
patchComponent,
patchElement,
Expand Down
2 changes: 1 addition & 1 deletion src/DOM/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
isNull,
isNullOrUndef,
throwError,
} from '../shared';
} from '../tools/shared';
import {
devToolsStatus,
sendRoots,
Expand Down
2 changes: 1 addition & 1 deletion src/DOM/unmounting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
isObject,
throwError,
isNull,
} from '../shared';
} from '../tools/shared';
import {
poolComponent,
poolElement,
Expand Down
2 changes: 1 addition & 1 deletion src/DOM/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
isUndefined,
throwError,
EMPTY_OBJ
} from '../shared';
} from '../tools/shared';

import cloneVNode from '../factories/cloneVNode';
import { componentToDOMNodeMap, findDOMNodeEnabled } from './rendering';
Expand Down
2 changes: 1 addition & 1 deletion src/DOM/wrappers/InputWrapper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
EMPTY_OBJ,
isNullOrUndef
} from '../../shared';
} from '../../tools/shared';
import { wrappers } from './processElement';

function isCheckedType(type) {
Expand Down
2 changes: 1 addition & 1 deletion src/DOM/wrappers/SelectWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
isArray,
EMPTY_OBJ,
isNullOrUndef
} from '../../shared';
} from '../../tools/shared';
import { wrappers } from './processElement';
import { isVNode } from '../../core/shapes';

Expand Down
2 changes: 1 addition & 1 deletion src/DOM/wrappers/TextareaWrapper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
EMPTY_OBJ,
isNullOrUndef
} from '../../shared';
} from '../../tools/shared';
import { wrappers } from './processElement';

function isControlled(props) {
Expand Down
2 changes: 1 addition & 1 deletion src/component/createClass.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isFunction, isNullOrUndef, isUndefined } from '../shared';
import { isFunction, isNullOrUndef, isUndefined } from '../tools/shared';

import Component from 'inferno-component';
import { ComponentSpec } from './es2015';
Expand Down
2 changes: 1 addition & 1 deletion src/component/es2015.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
isNullOrUndef,
throwError,
ERROR_MSG
} from '../shared';
} from '../tools/shared';
import {
Props,
VNode,
Expand Down
2 changes: 1 addition & 1 deletion src/core/shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
isUndefined,
isString,
isNull
} from '../shared';
} from '../tools/shared';

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

Expand Down
2 changes: 1 addition & 1 deletion src/factories/cloneVNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
isNullOrUndef,
isUndefined,
isInvalid
} from '../shared';
} from '../tools/shared';

export default function cloneVNode(vNodeToClone: VNode, props?: Props, ..._children: InfernoChildren[]): VNode {
let children: any = _children;
Expand Down
2 changes: 1 addition & 1 deletion src/factories/createElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
isUndefined,
isObject,
isStatefulComponent
} from '../shared';
} from '../tools/shared';

const componentHooks = {
onComponentWillMount: true,
Expand Down
2 changes: 1 addition & 1 deletion src/factories/hyperscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
isString,
isStringOrNumber,
isUndefined,
} from '../shared';
} from '../tools/shared';

const classIdSplit = /([.#]?[a-zA-Z0-9_:-]+)/;
const notClassId = /^\.|#/;
Expand Down
2 changes: 1 addition & 1 deletion src/factories/isValidElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import {
isNull,
isObject
} from '../shared';
} from '../tools/shared';

export default function isValidElement(obj: VNode): boolean {
const isNotANullObject = isObject(obj) && isNull(obj) === false;
Expand Down
137 changes: 0 additions & 137 deletions src/inferno.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/mobx/Provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Component from 'inferno-component';
import { warning } from '../shared';
import { warning } from '../tools/shared';

const specialKeys = {
children: true,
Expand Down
6 changes: 4 additions & 2 deletions src/mobx/__tests__/makeReactive.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('MobX Observer', () => {
let container;
let store = {
todos: observable(['one', 'two']),
extra: observable({ test: 'observable!' })
extra: observable({ test: 'observable!' }) as any // TOOD: {LukeSheard} Fix this hack
};

beforeEach(() => {
Expand Down Expand Up @@ -65,7 +65,9 @@ describe('MobX Observer', () => {
});

render(<FlatList extra={ store.extra }/>, container);
store.extra = toJS({ test: 'XXX' });
store.extra = toJS({
test: 'XXX'
});
render(<FlatList extra={ store.extra }/>, container);
extendObservable(store, {
test: 'new entry'
Expand Down
2 changes: 1 addition & 1 deletion src/mobx/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Component from 'inferno-component';
import createClass from 'inferno-create-class';
import inject from './inject';
import makeReactive from './makeReactive';
import { throwError } from '../shared';
import { throwError } from '../tools/shared';

/**
* Wraps a component and provides stores as props
Expand Down
2 changes: 1 addition & 1 deletion src/mobx/makeReactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Reaction, extras, isObservable } from 'mobx';

import Component from 'inferno-component';
import EventEmitter from './EventEmitter';
import { throwError } from '../shared';
import { throwError } from '../tools/shared';

/**
* Dev tools support
Expand Down
2 changes: 1 addition & 1 deletion src/redux/Provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { warning } from './utils';
import {
isNullOrUndef,
toArray
} from '../shared';
} from '../tools/shared';

let didWarnAboutReceivingStore = false;
function warnAboutReceivingStore() {
Expand Down
Loading

0 comments on commit c3e6366

Please sign in to comment.