Repository: infernojs/inferno
Pull request #1227 (2017-10-16 14:44:14)

dont silence rollup warning, fix deprecated rollup attributes
`rollup` deprecated a bunch of attribute names. Also please don't silence warnings

coveralls: 
[![Coverage Status](https://coveralls.io/builds/13736397/badge)](https://coveralls.io/builds/13736397)

Coverage remained the same at 91.244% when pulling **8f0bdc711e9e88c3973c8519ba14918ba785d692 on longlho:dev** into **072323200ad5a86589a4bd02824ade4bf9ba1195 on infernojs:dev**.

Havunen: LGTM :)

Patch:
diff --git a/.gitignore b/.gitignore
index ebf2acb3d..719931b99 100755
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,5 @@ node_modules
 packages/*/dist
 package-lock.json
 
+.rpt2_cache_development
+.rpt2_cache_production
diff --git a/package.json b/package.json
index 0cfee4e86..7650d399c 100644
--- a/package.json
+++ b/package.json
@@ -73,12 +73,12 @@
   "devDependencies": {
     "@types/history": "^4.6.0",
     "@types/jest": "^20.0.8",
-    "@types/node": "^8.0.28",
+    "@types/node": "^8.0.34",
     "babel-cli": "^6.26.0",
     "babel-core": "^6.26.0",
-    "babel-jest": "^21.0.2",
+    "babel-jest": "^21.2.0",
     "babel-loader": "^7.1.2",
-    "babel-plugin-inferno": "^3.2.0",
+    "babel-plugin-inferno": "^3.3.0",
     "babel-plugin-module-resolver": "^2.7.1",
     "babel-plugin-syntax-jsx": "^6.18.0",
     "babel-plugin-syntax-object-rest-spread": "^6.13.0",
@@ -94,12 +94,12 @@
     "babel-preset-stage-2": "^6.24.1",
     "cli-table": "^0.3.1",
     "concat-stream-es6": "0.0.1",
-    "coveralls": "^2.13.1",
+    "coveralls": "^2.13.3",
     "cross-env": "^5.0.5",
     "dts-bundle": "^0.7.3",
     "history": "^4.7.2",
     "jest": "^21.1.0",
-    "jsdom": "^11.2.0",
+    "jsdom": "^11.3.0",
     "lerna": "2.2.0",
     "lint-staged": "^4.2.1",
     "madge": "^2.2.0",
@@ -117,12 +117,12 @@
     "rollup-plugin-replace": "^2.0.0",
     "rollup-plugin-typescript2": "0.5.2",
     "rollup-plugin-uglify": "^2.0.1",
-    "sinon": "^3.2.1",
+    "sinon": "^3.3.0",
     "ts-jest": "^21.0.1",
     "tslint": "^5.7.0",
     "tslint-config-prettier": "^1.5.0",
     "typedoc": "^0.8.0",
     "typedoc-plugin-external-module-name": "^1.0.9",
-    "typescript": "^2.5.2"
+    "typescript": "^2.5.3"
   }
 }
diff --git a/packages/inferno/src/DOM/wrappers/InputWrapper.ts b/packages/inferno/src/DOM/wrappers/InputWrapper.ts
index ee85f17f3..324d7d5a0 100644
--- a/packages/inferno/src/DOM/wrappers/InputWrapper.ts
+++ b/packages/inferno/src/DOM/wrappers/InputWrapper.ts
@@ -11,9 +11,9 @@ export function isCheckedType(type) {
 
 const onTextInputChange = createWrappedFunction("onInput", applyValue);
 
-const wrappedOnChange = createWrappedFunction("onChange");
+const wrappedOnChange = createWrappedFunction("onChange", applyValue);
 
-const onCheckboxChange = createWrappedFunction("onClick", applyValue);
+const onCheckboxChange = createWrappedFunction("onClick");
 
 export function processInput(
   vNode,
@@ -28,12 +28,12 @@ export function processInput(
 
     if (mounting) {
       if (isCheckedType(nextPropsOrEmpty.type)) {
-        dom.onclick = onCheckboxChange;
+        dom.onchange = wrappedOnChange;
       } else {
         dom.oninput = onTextInputChange;
       }
-      if (nextPropsOrEmpty.onChange) {
-        dom.onchange = wrappedOnChange;
+      if (nextPropsOrEmpty.onClick) {
+        dom.onclick = onCheckboxChange;
       }
     }
   }
diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js
index 583776c37..6f5bdb94c 100644
--- a/scripts/rollup/build.js
+++ b/scripts/rollup/build.js
@@ -35,7 +35,6 @@ mkdir(join(cwd, "dist"), err => {
   const bundle = createBundle(options);
 
   rollup
-    .catch()
     .then(bundle)
     .then(() => {
       console.log(`${pkgJSON.name} in ${options.format} is DONE`);
diff --git a/scripts/rollup/bundle.js b/scripts/rollup/bundle.js
index d0f99a026..0f7595495 100644
--- a/scripts/rollup/bundle.js
+++ b/scripts/rollup/bundle.js
@@ -24,12 +24,12 @@ module.exports = function(options) {
     : ""}.js`;
 
   const bundleOptions = {
-    dest: `dist/${filename}`,
+    file: `dist/${filename}`,
     format: options.format,
     globals: Object.assign(moduleGlobals, rollupConfig.moduleGlobals),
     indent: true,
-    moduleName: rollupConfig.moduleName,
-    sourceMap: false
+    name: rollupConfig.moduleName,
+    sourcemap: false
   };
 
   if (options.format === "cjs") {
diff --git a/scripts/rollup/rollup.js b/scripts/rollup/rollup.js
index 745c31ab0..5eec15390 100644
--- a/scripts/rollup/rollup.js
+++ b/scripts/rollup/rollup.js
@@ -15,13 +15,8 @@ module.exports = function(options) {
   const plugins = createPlugins(version, options);
 
   return rollup({
-    entry: join(cwd, "src/index.ts"),
+    input: join(cwd, "src/index.ts"),
     external,
-    onwarn(warning) {
-      if (warning.code === "MISSING_EXPORTS") {
-        return;
-      }
-    },
     plugins
   });
 };


Test patch:
diff --git a/packages/inferno/__tests__/input.spec.js b/packages/inferno/__tests__/input.spec.js
new file mode 100644
index 000000000..804632835
--- /dev/null
+++ b/packages/inferno/__tests__/input.spec.js
@@ -0,0 +1,105 @@
+import { render } from "inferno";
+import { innerHTML, triggerEvent } from "inferno-utils";
+
+describe("Input type checkbox", () => {
+  let container;
+
+  beforeEach(function() {
+    container = document.createElement("div");
+    document.body.appendChild(container);
+  });
+
+  afterEach(function() {
+    render(null, container);
+    container.innerHTML = "";
+    document.body.removeChild(container);
+  });
+
+  it("Checked attribute should be false", function() {
+    render(<input type="checkbox" checked={false} />, container);
+    const input = container.firstChild;
+
+    expect(input.checked).toBe(false);
+  });
+
+  it("Checked attribute after Click", function() {
+    let clickChecked = null;
+    let changeChecked = null;
+
+    render(
+      <input
+        type="checkbox"
+        checked={false}
+        onclick={e => {
+          clickChecked = e.target.checked;
+        }}
+        onchange={e => {
+          changeChecked = e.target.checked;
+        }}
+      />,
+      container
+    );
+    const input = container.firstChild;
+
+    triggerEvent("click", input);
+
+    expect(input.checked).toBe(false);
+    expect(clickChecked).toBe(true);
+    expect(changeChecked).toBe(true);
+  });
+});
+
+describe("Input type Radio", () => {
+  let container;
+
+  beforeEach(function() {
+    container = document.createElement("div");
+    document.body.appendChild(container);
+  });
+
+  afterEach(function() {
+    render(null, container);
+    container.innerHTML = "";
+    document.body.removeChild(container);
+  });
+
+  it("Controlled radio, checked=false", function() {
+    render(<input type="radio" checked={false} value="magic" />, container);
+    const input = container.firstChild;
+
+    expect(input.checked).toBe(false);
+  });
+
+  it("Checked attribute after Click", function() {
+    let clickChecked = null;
+    let changeChecked = null;
+
+    render(
+      <input
+        type="radio"
+        checked={false}
+        value="magic"
+        onclick={e => {
+          clickChecked = e.target.checked;
+        }}
+        onchange={e => {
+          changeChecked = e.target.checked;
+        }}
+      />,
+      container
+    );
+    const input = container.firstChild;
+
+    triggerEvent("click", input);
+
+    expect(clickChecked).toBe(true);
+	// check is jsdom
+    if (window.name === 'nodejs') {
+        expect(input.checked).toBe(true);
+        expect(changeChecked).toBe(null);
+    } else {
+        expect(input.checked).toBe(false);
+        expect(changeChecked).toBe(true);
+    }
+  });
+});
\ No newline at end of file