Skip to content

Commit 180472f

Browse files
author
James Burnett
committed
removed clone becuase is causes issues with newer versions of react.js
1 parent 5f7211b commit 180472f

File tree

12 files changed

+90
-12
lines changed

12 files changed

+90
-12
lines changed

.gitignore

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1-
node_modules/
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# node-waf configuration
20+
.lock-wscript
21+
22+
# Compiled binary addons (http://nodejs.org/api/addons.html)
23+
build/Release
24+
25+
# Dependency directory
26+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27+
node_modules
28+
29+
# distribution
30+
dist

.istanbul.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
instrumentation:
2+
excludes: ['**/__tests__/**']

.jshintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"node": true,
33
"browser": true,
4-
"esnext": true,
5-
"laxcomma": true
4+
"esnext": true
65
}

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src

babel.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require('babel/register')({
2+
experimental: true,
3+
loose: 'all'
4+
});

package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"name": "lazy-input",
33
"version": "1.0.8",
44
"description": "A lazy React.js input field that only updates when it is told to re-render (fixes issues with Flux backed field data)",
5-
"main": "index.js",
5+
"main": "dist/LazyInput.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"build": "./scripts/build",
8+
"test": "./scripts/test",
9+
"test-cov": "./scripts/test-cov",
10+
"prepublish": "npm run build"
811
},
912
"repository": {
1013
"type": "git",
@@ -26,8 +29,12 @@
2629
"url": "https://github.com/HurricaneJames/lazy-input/issues"
2730
},
2831
"homepage": "https://github.com/HurricaneJames/lazy-input",
29-
"dependencies": {
30-
"clone": "^1.0.0",
32+
"devDependencies": {
33+
"babel": "^4.6.6",
34+
"expect.js": "^0.3.1",
35+
"istanbul": "~0.3.7",
36+
"jsdom": "^3.1.0",
37+
"mocha": "^2.0.1",
3138
"react": "^0.12.2"
3239
}
3340
}

scripts/build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
./node_modules/.bin/babel ./src --out-dir dist --loose all --experimental

scripts/test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
./node_modules/.bin/mocha --require ./babel.js --compilers jsx:babel/register --recursive ./src/__tests__

scripts/test-cov

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --require ./babel ./src/__tests__

index.js renamed to src/LazyInput.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
var React = require('react')
2-
, clone = require('clone');
1+
var React = require('react');
32

43
var LazyInput = React.createClass({
54
displayName: "LazyInput",
@@ -48,10 +47,9 @@ var LazyInput = React.createClass({
4847
this.props.onChange.apply(null, arguments);
4948
},
5049
getProps: function() {
51-
// for the most part, we are just going to pass through whatever comes in
52-
var props = clone(this.props);
50+
var props = {};
51+
for(var key in this.props) { if(key !== 'lazyLevel') { props[key] = this.props[key]; } }
5352
props.value = this.state.value;
54-
delete props.lazyLevel;
5553
if(props.onChange) { props.onChange = this.onChange; }
5654
return props;
5755
},

0 commit comments

Comments
 (0)