From 90953a380a1ecf4c748da825cb0ac0a402835aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 7 Nov 2019 09:55:30 -0500 Subject: [PATCH 01/45] update exclude, dynamic plugin --- .config/webpack/base.js | 4 ++-- package-lock.json | 6 +++--- package.json | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.config/webpack/base.js b/.config/webpack/base.js index ba471c134..58ea77c78 100644 --- a/.config/webpack/base.js +++ b/.config/webpack/base.js @@ -50,7 +50,7 @@ module.exports = (options = {}) => { }, { test: /\.ts(x?)$/, - exclude: /node_modules/, + exclude: /node_modules\/(?!@plotly\/dash-component-plugins)/, use: [ { loader: 'babel-loader', options: babel }, { loader: 'ts-loader', options: ts }, @@ -59,7 +59,7 @@ module.exports = (options = {}) => { }, { test: /\.js$/, - exclude: /node_modules/, + exclude: /node_modules\/(?!@plotly\/dash-component-plugins)/, use: [ { loader: 'babel-loader', options: babel }, { loader: 'webpack-preprocessor', options: JSON.stringify(preprocessor) } diff --git a/package-lock.json b/package-lock.json index 6ef1b0cb8..810826561 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2253,9 +2253,9 @@ "dev": true }, "@plotly/webpack-dash-dynamic-import": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@plotly/webpack-dash-dynamic-import/-/webpack-dash-dynamic-import-1.1.1.tgz", - "integrity": "sha512-Yrc7XZOMQuyh2TkbEMr3i6hfdAS/DMFDfvhdD3C28/G6aRWfPRTZ2Tb+IeyOhZTX41IoNmJ6YciLooME8zP5ag==", + "version": "1.1.3-rc1", + "resolved": "https://registry.npmjs.org/@plotly/webpack-dash-dynamic-import/-/webpack-dash-dynamic-import-1.1.3-rc1.tgz", + "integrity": "sha512-d0eOj6cekYSkYHc/AOvKpp4L6jJE1Jp1FTchID3KIhJNVuW2cyIgdJsSVnnm4Ugqq2t6ul7AcSk0lmbxYsZKmg==", "dev": true }, "@reach/router": { diff --git a/package.json b/package.json index 9ff8d6244..271f6a424 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@fortawesome/react-fontawesome": "^0.1.4", "@percy/storybook": "^3.2.0", "@plotly/dash-component-plugins": "^1.0.1", - "@plotly/webpack-dash-dynamic-import": "^1.1.1", + "@plotly/webpack-dash-dynamic-import": "^1.1.3-rc1", "@storybook/cli": "^5.1.11", "@storybook/react": "^5.1.11", "@types/d3-format": "^1.3.1", @@ -126,4 +126,4 @@ "node": ">=8.11.0", "npm": ">=6.1.0" } -} \ No newline at end of file +} From c7fed230345d7b2ecfe650d4c3a05339dc5fd7af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 7 Nov 2019 16:28:11 -0500 Subject: [PATCH 02/45] - es5 check on artifacts - use preset-env --- babel.config.js | 14 +- package-lock.json | 399 +++++++++++++++++++++++++++++++++++++++++++--- package.json | 6 +- 3 files changed, 379 insertions(+), 40 deletions(-) diff --git a/babel.config.js b/babel.config.js index f33e85832..0de97d1d3 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,17 +1,5 @@ const presets = [ - ['@babel/env', { - targets: { - browsers: [ - 'last 2 Chrome versions', - 'last 2 Firefox versions', - 'last 2 Safari versions', - 'last 2 Edge versions', - 'Explorer 11' - ] - }, - useBuiltIns: 'usage', - corejs: 3 - }], + '@babel/preset-env', '@babel/preset-react' ]; diff --git a/package-lock.json b/package-lock.json index 810826561..eaf3eddeb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1362,30 +1362,6 @@ "regexpu-core": "^4.5.4" } }, - "@babel/polyfill": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.6.0.tgz", - "integrity": "sha512-q5BZJI0n/B10VaQQvln1IlDK3BTBJFbADx7tv+oXDPIDZuTo37H5Adb9jhlXm/fEN4Y7/64qD9mnrJJG7rmaTw==", - "dev": true, - "requires": { - "core-js": "^2.6.5", - "regenerator-runtime": "^0.13.2" - }, - "dependencies": { - "core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", - "dev": true - }, - "regenerator-runtime": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", - "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", - "dev": true - } - } - }, "@babel/preset-env": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.6.2.tgz", @@ -3747,6 +3723,12 @@ "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", "dev": true }, + "ansi": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", + "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=", + "dev": true + }, "ansi-align": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", @@ -5420,6 +5402,25 @@ "integrity": "sha512-gcu45yfq3B7Y+WB05fOMfr0EiSlq+1u+m6rPHyJli/Wy3PVQNGaU7VA4bZE5qw+AU2UVOBR/N5g1bzADUqdvFw==", "dev": true }, + "caporal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/caporal/-/caporal-1.1.0.tgz", + "integrity": "sha512-R5qo2QGoqBM6RvzHonGhUuEJSeqEa4lD1r+cPUEY2+YsXhpQVTS2TvScfIbi6ydFdhzFCNeNUB1v0YrRBvsbdg==", + "dev": true, + "requires": { + "bluebird": "^3.4.7", + "cli-table3": "^0.5.0", + "colorette": "1.0.1", + "fast-levenshtein": "^2.0.6", + "lodash.camelcase": "^4.3.0", + "lodash.kebabcase": "^4.1.1", + "lodash.merge": "^4.6.0", + "micromist": "1.1.0", + "prettyjson": "^1.2.1", + "tabtab": "^2.2.2", + "winston": "^2.3.1" + } + }, "case-sensitive-paths-webpack-plugin": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.2.0.tgz", @@ -5831,6 +5832,12 @@ "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", "dev": true }, + "colorette": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.0.1.tgz", + "integrity": "sha512-40MnlppkzHhFjRhtXunbpqKUT+eJn0gyVGi8aQlNSG8T2CCy31NdD7yktcS0aizH1VP2OhhQCyGMeTp0a/fvaw==", + "dev": true + }, "colors": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", @@ -6448,6 +6455,12 @@ "integrity": "sha512-r4DbsyNJ7slwBSKoGesxDubRWJ71ghG8W2+1HcsDlAo12KGca9dDLv0u98tfdFw7ldBdoA7XmCnI6Q8LpAJXaQ==", "dev": true }, + "cycle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", + "dev": true + }, "cyclist": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", @@ -7606,6 +7619,25 @@ "is-regex": "^1.0.4" } }, + "es-check": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es-check/-/es-check-5.0.0.tgz", + "integrity": "sha512-30n+EZt5KjazXEvyYr2DXJCOJJWfdT1unRp5+Szlcja6uGAB3Sh3QPjRsxd2xgN9SFj4S5P8pdBISwGcDdS45Q==", + "dev": true, + "requires": { + "acorn": "6.0.4", + "caporal": "1.1.0", + "glob": "^7.1.2" + }, + "dependencies": { + "acorn": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", + "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", + "dev": true + } + } + }, "es-to-primitive": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", @@ -7997,6 +8029,12 @@ "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", "dev": true }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", + "dev": true + }, "fast-deep-equal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", @@ -8032,6 +8070,12 @@ "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", "dev": true }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, "fault": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/fault/-/fault-1.0.3.tgz", @@ -11236,30 +11280,78 @@ "integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ==", "dev": true }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, "lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", "dev": true }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", + "dev": true + }, + "lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=", + "dev": true + }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=", "dev": true }, + "lodash.pad": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.5.1.tgz", + "integrity": "sha1-QzCUmoM6fI2iLMIPaibE1Z3runA=", + "dev": true + }, + "lodash.padend": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz", + "integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=", + "dev": true + }, + "lodash.padstart": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.6.1.tgz", + "integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs=", + "dev": true + }, "lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=", "dev": true }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true + }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -11548,6 +11640,15 @@ "to-regex": "^3.0.2" } }, + "micromist": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromist/-/micromist-1.1.0.tgz", + "integrity": "sha512-+CQ76pabE9egniSEdmDuH+j2cYyIBKP97kujG8ZLZyLCRq5ExwtIy4DPHPFrq4jVbhMRBnyjuH50KU9Ohs8QCg==", + "dev": true, + "requires": { + "lodash.camelcase": "^4.3.0" + } + }, "miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", @@ -15890,6 +15991,12 @@ } } }, + "os-shim": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", + "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=", + "dev": true + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -16546,6 +16653,24 @@ "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", "dev": true }, + "prettyjson": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.1.tgz", + "integrity": "sha1-/P+rQdGcq0365eV15kJGYZsS0ok=", + "dev": true, + "requires": { + "colors": "^1.1.2", + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, "printj": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz", @@ -18749,6 +18874,16 @@ "integrity": "sha512-UyhMSmeIqZrQn2UdjYpxEkwY9JUrn8pP+7L4f91zRzOQuI8MF1FGLfYU9DKCYeLdo7LXMxwrX5zKFy7eeeVHuA==", "dev": true }, + "spawn-sync": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz", + "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", + "dev": true, + "requires": { + "concat-stream": "^1.4.7", + "os-shim": "^0.1.2" + } + }, "spdx-correct": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", @@ -18909,6 +19044,12 @@ "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", "dev": true }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, "staged-git-files": { "version": "1.1.1", "resolved": "http://registry.npmjs.org/staged-git-files/-/staged-git-files-1.1.1.tgz", @@ -19287,6 +19428,188 @@ "has-symbols": "^1.0.0" } }, + "tabtab": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tabtab/-/tabtab-2.2.2.tgz", + "integrity": "sha1-egR/FDsBC0y9MfhX6ClhUSy/ThQ=", + "dev": true, + "requires": { + "debug": "^2.2.0", + "inquirer": "^1.0.2", + "lodash.difference": "^4.5.0", + "lodash.uniq": "^4.5.0", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "npmlog": "^2.0.3", + "object-assign": "^4.1.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "external-editor": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-1.1.1.tgz", + "integrity": "sha1-Etew24UPf/fnCBuvQAVwAGDEYAs=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "spawn-sync": "^1.0.15", + "tmp": "^0.0.29" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "gauge": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz", + "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=", + "dev": true, + "requires": { + "ansi": "^0.3.0", + "has-unicode": "^2.0.0", + "lodash.pad": "^4.1.0", + "lodash.padend": "^4.1.0", + "lodash.padstart": "^4.1.0" + } + }, + "inquirer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-1.2.3.tgz", + "integrity": "sha1-TexvMvN+97sLLtPx0aXD9UUHSRg=", + "dev": true, + "requires": { + "ansi-escapes": "^1.1.0", + "chalk": "^1.0.0", + "cli-cursor": "^1.0.1", + "cli-width": "^2.0.0", + "external-editor": "^1.1.0", + "figures": "^1.3.5", + "lodash": "^4.3.0", + "mute-stream": "0.0.6", + "pinkie-promise": "^2.0.0", + "run-async": "^2.2.0", + "rx": "^4.1.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.0", + "through": "^2.3.6" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mute-stream": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.6.tgz", + "integrity": "sha1-SJYrGeFp/R38JAs/HnMXYnu8R9s=", + "dev": true + }, + "npmlog": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz", + "integrity": "sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI=", + "dev": true, + "requires": { + "ansi": "~0.3.1", + "are-we-there-yet": "~1.1.2", + "gauge": "~1.2.5" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "tmp": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", + "integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.1" + } + } + } + }, "tapable": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", @@ -20847,6 +21170,34 @@ "string-width": "^2.1.1" } }, + "winston": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.4.tgz", + "integrity": "sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q==", + "dev": true, + "requires": { + "async": "~1.0.0", + "colors": "1.0.x", + "cycle": "1.0.x", + "eyes": "0.1.x", + "isstream": "0.1.x", + "stack-trace": "0.0.x" + }, + "dependencies": { + "async": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", + "dev": true + }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + } + } + }, "worker-farm": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", diff --git a/package.json b/package.json index 271f6a424..7723464ff 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "private::test.standalone": "cypress run --browser chrome --spec 'tests/cypress/tests/standalone/**/*'", "build.watch": "webpack-dev-server --content-base dash_table --mode development --config webpack.dev.config.js", "build": "run-s private::build:js private::build:py", + "postbuild": "es-check es5 dash_table/*.js", "format": "run-s \"private::lint:ts -- --fix\"", "lint": "run-s private::lint:*", "test.server": "run-p --race private::host* private::test.server", @@ -62,7 +63,6 @@ "@babel/cli": "^7.6.2", "@babel/core": "^7.6.2", "@babel/plugin-syntax-dynamic-import": "^7.2.0", - "@babel/polyfill": "^7.6.0", "@babel/preset-env": "^7.6.2", "@babel/preset-react": "^7.0.0", "@cypress/webpack-preprocessor": "^4.1.0", @@ -82,10 +82,10 @@ "@types/react-dom": "^16.9.0", "@types/react-select": "^1.3.4", "babel-loader": "^8.0.6", - "core-js": "^3.2.1", "css-loader": "^3.2.0", "cypress": "^3.4.1", "d3-format": "^1.4.1", + "es-check": "^5.0.0", "fast-isnumeric": "^1.1.3", "file-loader": "^4.2.0", "http-server": "^0.11.1", @@ -126,4 +126,4 @@ "node": ">=8.11.0", "npm": ">=6.1.0" } -} +} \ No newline at end of file From 4543822110f77365f8016345d4b9857a89717975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 08:52:51 -0500 Subject: [PATCH 03/45] rc of @plotly/dash-component-plugins --- package-lock.json | 6 +++--- package.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index eaf3eddeb..c4a62e478 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2223,9 +2223,9 @@ } }, "@plotly/dash-component-plugins": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@plotly/dash-component-plugins/-/dash-component-plugins-1.0.1.tgz", - "integrity": "sha512-z3KTahhLhIw3RZL49OOutyV8ePn2kZLCnMBoWYPy5sr55Yd2ghL7aDDyO1yseintG+RTm72n6UB35G++mvNbpA==", + "version": "1.0.2-rc1", + "resolved": "https://registry.npmjs.org/@plotly/dash-component-plugins/-/dash-component-plugins-1.0.2-rc1.tgz", + "integrity": "sha512-ohYaUzrUGYw+EbctEaWXYN4ON2KqvbdUw4bi2NA2iM6dEzs3vFhQhx4pS+G2W7o16GgV0zp7k/5YTudjR6lYEQ==", "dev": true }, "@plotly/webpack-dash-dynamic-import": { diff --git a/package.json b/package.json index 7723464ff..85a0d0704 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@fortawesome/free-solid-svg-icons": "^5.11.2", "@fortawesome/react-fontawesome": "^0.1.4", "@percy/storybook": "^3.2.0", - "@plotly/dash-component-plugins": "^1.0.1", + "@plotly/dash-component-plugins": "^1.0.2-rc1", "@plotly/webpack-dash-dynamic-import": "^1.1.3-rc1", "@storybook/cli": "^5.1.11", "@storybook/react": "^5.1.11", @@ -126,4 +126,4 @@ "node": ">=8.11.0", "npm": ">=6.1.0" } -} \ No newline at end of file +} From 39daee37f05bb3f7c59cbd629adc9ea31ececd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 09:18:56 -0500 Subject: [PATCH 04/45] bump dash-component-plugins --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index c4a62e478..0c5f45be6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2223,9 +2223,9 @@ } }, "@plotly/dash-component-plugins": { - "version": "1.0.2-rc1", - "resolved": "https://registry.npmjs.org/@plotly/dash-component-plugins/-/dash-component-plugins-1.0.2-rc1.tgz", - "integrity": "sha512-ohYaUzrUGYw+EbctEaWXYN4ON2KqvbdUw4bi2NA2iM6dEzs3vFhQhx4pS+G2W7o16GgV0zp7k/5YTudjR6lYEQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@plotly/dash-component-plugins/-/dash-component-plugins-1.0.2.tgz", + "integrity": "sha512-KBO+rZk0MAht3/cqdzKd5GUc6EJDWj7OTPw9u6Q4HALbaO9KzvYFXN0PdiNGPv4y1bINjPBI3bw6i4smqVrrEw==", "dev": true }, "@plotly/webpack-dash-dynamic-import": { diff --git a/package.json b/package.json index 85a0d0704..2f5e4750b 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@fortawesome/free-solid-svg-icons": "^5.11.2", "@fortawesome/react-fontawesome": "^0.1.4", "@percy/storybook": "^3.2.0", - "@plotly/dash-component-plugins": "^1.0.2-rc1", + "@plotly/dash-component-plugins": "^1.0.2", "@plotly/webpack-dash-dynamic-import": "^1.1.3-rc1", "@storybook/cli": "^5.1.11", "@storybook/react": "^5.1.11", From 8e9464637dc163d56dc3d9b1b7b6fd8bf597e406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 11:41:42 -0500 Subject: [PATCH 05/45] polyfill tests --- babel.config.js | 2 +- package-lock.json | 30 +++++++++++++++++++++++++++--- package.json | 1 + tests/cypress/support/index.js | 1 + 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/babel.config.js b/babel.config.js index 0de97d1d3..dcf4bdf55 100644 --- a/babel.config.js +++ b/babel.config.js @@ -7,4 +7,4 @@ const plugins = [ '@babel/plugin-syntax-dynamic-import' ]; -module.exports = { presets }; +module.exports = { presets, plugins }; diff --git a/package-lock.json b/package-lock.json index 0c5f45be6..8c57ee659 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1362,6 +1362,30 @@ "regexpu-core": "^4.5.4" } }, + "@babel/polyfill": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.7.0.tgz", + "integrity": "sha512-/TS23MVvo34dFmf8mwCisCbWGrfhbiWZSwBo6HkADTBhUa2Q/jWltyY/tpofz/b6/RIhqaqQcquptCirqIhOaQ==", + "dev": true, + "requires": { + "core-js": "^2.6.5", + "regenerator-runtime": "^0.13.2" + }, + "dependencies": { + "core-js": { + "version": "2.6.10", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.10.tgz", + "integrity": "sha512-I39t74+4t+zau64EN1fE5v2W31Adtc/REhzWN+gWRRXg6WH5qAsZm62DHpQ1+Yhe4047T55jvzz7MUqF/dBBlA==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", + "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", + "dev": true + } + } + }, "@babel/preset-env": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.6.2.tgz", @@ -6048,9 +6072,9 @@ } }, "core-js": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.2.1.tgz", - "integrity": "sha512-Qa5XSVefSVPRxy2XfUC13WbvqkxhkwB3ve+pgCQveNgYzbM/UxZeu1dcOX/xr4UmfUd+muuvsaxilQzCyUurMw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.0.tgz", + "integrity": "sha512-lQxb4HScV71YugF/X28LtePZj9AB7WqOpcB+YztYxusvhrgZiQXPmCYfPC5LHsw/+ScEtDbXU3xbqH3CjBRmYA==", "dev": true }, "core-js-compat": { diff --git a/package.json b/package.json index 2f5e4750b..7f39654b9 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "@babel/cli": "^7.6.2", "@babel/core": "^7.6.2", "@babel/plugin-syntax-dynamic-import": "^7.2.0", + "@babel/polyfill": "^7.7.0", "@babel/preset-env": "^7.6.2", "@babel/preset-react": "^7.0.0", "@cypress/webpack-preprocessor": "^4.1.0", diff --git a/tests/cypress/support/index.js b/tests/cypress/support/index.js index 37a498fb5..59a05ba85 100644 --- a/tests/cypress/support/index.js +++ b/tests/cypress/support/index.js @@ -14,6 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: +import '@babel/polyfill'; import './commands'; // Alternatively you can use CommonJS syntax: From 8b9b76e46a0c5883e75fab99f7f2b9b782880bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 11:43:02 -0500 Subject: [PATCH 06/45] no exclude the exclude --- .config/webpack/base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/webpack/base.js b/.config/webpack/base.js index 58ea77c78..ba471c134 100644 --- a/.config/webpack/base.js +++ b/.config/webpack/base.js @@ -50,7 +50,7 @@ module.exports = (options = {}) => { }, { test: /\.ts(x?)$/, - exclude: /node_modules\/(?!@plotly\/dash-component-plugins)/, + exclude: /node_modules/, use: [ { loader: 'babel-loader', options: babel }, { loader: 'ts-loader', options: ts }, @@ -59,7 +59,7 @@ module.exports = (options = {}) => { }, { test: /\.js$/, - exclude: /node_modules\/(?!@plotly\/dash-component-plugins)/, + exclude: /node_modules/, use: [ { loader: 'babel-loader', options: babel }, { loader: 'webpack-preprocessor', options: JSON.stringify(preprocessor) } From f4d5c64d650983f8dcccb005120421e96d8e2750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 11:49:06 -0500 Subject: [PATCH 07/45] bump @plotly/webpack-dash-dynamic-import --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7f39654b9..46a478131 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "@fortawesome/react-fontawesome": "^0.1.4", "@percy/storybook": "^3.2.0", "@plotly/dash-component-plugins": "^1.0.2", - "@plotly/webpack-dash-dynamic-import": "^1.1.3-rc1", + "@plotly/webpack-dash-dynamic-import": "^1.1.3", "@storybook/cli": "^5.1.11", "@storybook/react": "^5.1.11", "@types/d3-format": "^1.3.1", @@ -127,4 +127,4 @@ "node": ">=8.11.0", "npm": ">=6.1.0" } -} +} \ No newline at end of file From 0663d8c7b06b35731116867102ad020426d77223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 12:01:41 -0500 Subject: [PATCH 08/45] @babel/polyfill in standalone tests --- .config/webpack/base.js | 5 +++-- webpack.test.config.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/webpack/base.js b/.config/webpack/base.js index ba471c134..be56b3375 100644 --- a/.config/webpack/base.js +++ b/.config/webpack/base.js @@ -9,6 +9,7 @@ const dashLibraryName = packagejson.name.replace(/-/g, '_'); module.exports = (options = {}) => { const babel = options.babel || undefined; + const entry = options.entry || []; const preprocessor = basePreprocessing(options.preprocessor); const mode = options.mode || 'development'; const ts = options.ts || {}; @@ -21,8 +22,8 @@ module.exports = (options = {}) => { return { entry: { - bundle: './src/dash-table/index.ts', - demo: ['./demo/index.html', './demo/index.js'] + bundle: [...entry, './src/dash-table/index.ts'], + demo: [...entry, './demo/index.html', './demo/index.js'] }, mode: mode, output: { diff --git a/webpack.test.config.js b/webpack.test.config.js index 4d381c983..058a9f8c3 100644 --- a/webpack.test.config.js +++ b/webpack.test.config.js @@ -1,4 +1,5 @@ const options = { + entry: ['@babel/polyfill'], ts: { transpileOnly: true }, From 2acb59e1d491a30012f2fb22a066d368912fe342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 12:12:49 -0500 Subject: [PATCH 09/45] standalone tests configuration --- webpack.test.standalone.config.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/webpack.test.standalone.config.js b/webpack.test.standalone.config.js index 67f2d692d..b0c090457 100644 --- a/webpack.test.standalone.config.js +++ b/webpack.test.standalone.config.js @@ -1,15 +1,8 @@ -const options = { - ts: { - transpileOnly: true - }, - preprocessor: { - variables: { - mode: 'eager' - }, - definitions: ['TEST', 'TEST_COPY_PASTE'] - }, - mode: 'development' -}; +const options = require('./webpack.test.standalone.config.js'); + +options.preprocessor = options.preprocessor || {}; +options.preprocessor.variables = options.preprocessor.variables || {}; +options.preprocessor.variables.mode = 'eager'; let config = require('./.config/webpack/base.js')(options); delete config.plugins; From 1587148ad915fb79ea70db8aea423db2467c3261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 12:18:29 -0500 Subject: [PATCH 10/45] npm ci --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a13704284..8775720fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,7 @@ jobs: key: deps1-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} - run: name: Install npm packages - command: npm install + command: npm ci - run: name: Cypress Install command: | @@ -60,7 +60,7 @@ jobs: key: deps1-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} - run: name: Install npm packages - command: npm install + command: npm ci - run: name: Cypress Install command: | @@ -88,7 +88,7 @@ jobs: key: deps1-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} - run: name: Install npm packages - command: npm install + command: npm ci - run: name: Cypress Install command: | @@ -206,7 +206,7 @@ jobs: python -m venv venv || virtualenv venv . venv/bin/activate pip install -r dev-requirements.txt --quiet - npm install + npm ci - run: name: Install dependencies (dash) From 24c9a8b434f7561c838d3b9c079feb12fd20a155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 12:20:15 -0500 Subject: [PATCH 11/45] update lock --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8c57ee659..ac7531101 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2253,9 +2253,9 @@ "dev": true }, "@plotly/webpack-dash-dynamic-import": { - "version": "1.1.3-rc1", - "resolved": "https://registry.npmjs.org/@plotly/webpack-dash-dynamic-import/-/webpack-dash-dynamic-import-1.1.3-rc1.tgz", - "integrity": "sha512-d0eOj6cekYSkYHc/AOvKpp4L6jJE1Jp1FTchID3KIhJNVuW2cyIgdJsSVnnm4Ugqq2t6ul7AcSk0lmbxYsZKmg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@plotly/webpack-dash-dynamic-import/-/webpack-dash-dynamic-import-1.1.3.tgz", + "integrity": "sha512-80S/drqtyPR5/5Q7JuYX6+OmNI8uCCQpn8P18srHl0w2zWBzV9ASuUAVz2zbPepcUeezVGTzl+uBbkDZF2r09g==", "dev": true }, "@reach/router": { From 1123a883e56f12b753584d21e2a51e2ed0ff8f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 12:28:53 -0500 Subject: [PATCH 12/45] revert --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ac7531101..24ad93d1d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6072,9 +6072,9 @@ } }, "core-js": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.0.tgz", - "integrity": "sha512-lQxb4HScV71YugF/X28LtePZj9AB7WqOpcB+YztYxusvhrgZiQXPmCYfPC5LHsw/+ScEtDbXU3xbqH3CjBRmYA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.2.1.tgz", + "integrity": "sha512-Qa5XSVefSVPRxy2XfUC13WbvqkxhkwB3ve+pgCQveNgYzbM/UxZeu1dcOX/xr4UmfUd+muuvsaxilQzCyUurMw==", "dev": true }, "core-js-compat": { From 64830cbbf03c93d1b63691f077b51d4e52031eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 12:43:36 -0500 Subject: [PATCH 13/45] options --- .config/webpack/base.js | 5 +---- webpack.test.standalone.config.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.config/webpack/base.js b/.config/webpack/base.js index be56b3375..0cbfe9bc8 100644 --- a/.config/webpack/base.js +++ b/.config/webpack/base.js @@ -15,10 +15,7 @@ module.exports = (options = {}) => { const ts = options.ts || {}; console.log('********** Webpack Environment Overrides **********'); - console.log('Preprocessor', JSON.stringify(preprocessor)); - console.log('mode', mode); - console.log('babel', JSON.stringify(babel)); - console.log('ts', JSON.stringify(ts)); + console.log('options', JSON.stringify(options)); return { entry: { diff --git a/webpack.test.standalone.config.js b/webpack.test.standalone.config.js index b0c090457..22c07e532 100644 --- a/webpack.test.standalone.config.js +++ b/webpack.test.standalone.config.js @@ -1,4 +1,4 @@ -const options = require('./webpack.test.standalone.config.js'); +const options = require('./webpack.test.config.js'); options.preprocessor = options.preprocessor || {}; options.preprocessor.variables = options.preprocessor.variables || {}; From 17cfa0ec674824094bdfbe6c7ad35c5da391f3a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 12:46:49 -0500 Subject: [PATCH 14/45] concat entries --- .config/webpack/base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/webpack/base.js b/.config/webpack/base.js index 0cbfe9bc8..b15636ed7 100644 --- a/.config/webpack/base.js +++ b/.config/webpack/base.js @@ -19,8 +19,8 @@ module.exports = (options = {}) => { return { entry: { - bundle: [...entry, './src/dash-table/index.ts'], - demo: [...entry, './demo/index.html', './demo/index.js'] + bundle: entry.concat(['./src/dash-table/index.ts']), + demo: entry.concat(['./demo/index.html', './demo/index.js']) }, mode: mode, output: { From e73a48fa432fd98940e30ed602fc4da5f5e73cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 12:53:35 -0500 Subject: [PATCH 15/45] ... --- webpack.test.standalone.config.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/webpack.test.standalone.config.js b/webpack.test.standalone.config.js index 22c07e532..e44f128e4 100644 --- a/webpack.test.standalone.config.js +++ b/webpack.test.standalone.config.js @@ -1,10 +1,17 @@ -const options = require('./webpack.test.config.js'); - -options.preprocessor = options.preprocessor || {}; -options.preprocessor.variables = options.preprocessor.variables || {}; -options.preprocessor.variables.mode = 'eager'; +const options = { + entry: ['@babel/polyfill'], + ts: { + transpileOnly: true + }, + preprocessor: { + definitions: ['TEST', 'TEST_COPY_PASTE'], + variable: { + mode: 'eager' + } + }, + mode: 'development' +}; let config = require('./.config/webpack/base.js')(options); -delete config.plugins; module.exports = config; \ No newline at end of file From d74a86ddfa7786dcc70424716175ef35a3203d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 13:44:30 -0500 Subject: [PATCH 16/45] @plotly/webpack-dash-dynamic-import rc --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 24ad93d1d..b9ae7bb1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2253,9 +2253,9 @@ "dev": true }, "@plotly/webpack-dash-dynamic-import": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@plotly/webpack-dash-dynamic-import/-/webpack-dash-dynamic-import-1.1.3.tgz", - "integrity": "sha512-80S/drqtyPR5/5Q7JuYX6+OmNI8uCCQpn8P18srHl0w2zWBzV9ASuUAVz2zbPepcUeezVGTzl+uBbkDZF2r09g==", + "version": "1.1.4-rc1", + "resolved": "https://registry.npmjs.org/@plotly/webpack-dash-dynamic-import/-/webpack-dash-dynamic-import-1.1.4-rc1.tgz", + "integrity": "sha512-910KMD6sAlBYax4JQjnIAn8ZbFicHgR9ijTAWL8b/bkyV+pXhhj1EKqcQTr5nEjXZ2R/85etypWd8vvwI2OmVQ==", "dev": true }, "@reach/router": { diff --git a/package.json b/package.json index 46a478131..8a0e5c191 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "@fortawesome/react-fontawesome": "^0.1.4", "@percy/storybook": "^3.2.0", "@plotly/dash-component-plugins": "^1.0.2", - "@plotly/webpack-dash-dynamic-import": "^1.1.3", + "@plotly/webpack-dash-dynamic-import": "^1.1.4-rc1", "@storybook/cli": "^5.1.11", "@storybook/react": "^5.1.11", "@types/d3-format": "^1.3.1", From 9fc72fa8cfce37cca494986fd243d7fd3c01c9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 13:54:13 -0500 Subject: [PATCH 17/45] bump @plotly/webpack-dash-dynamic-import (safe check) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8a0e5c191..efebc086a 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "@fortawesome/react-fontawesome": "^0.1.4", "@percy/storybook": "^3.2.0", "@plotly/dash-component-plugins": "^1.0.2", - "@plotly/webpack-dash-dynamic-import": "^1.1.4-rc1", + "@plotly/webpack-dash-dynamic-import": "^1.1.4", "@storybook/cli": "^5.1.11", "@storybook/react": "^5.1.11", "@types/d3-format": "^1.3.1", From 559371b97205d424494ca8bfc7b672a6d1291df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 13:54:40 -0500 Subject: [PATCH 18/45] bump @plotly/webpack-dash-dynamic-import (safe check) --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b9ae7bb1a..a550cfeff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2253,9 +2253,9 @@ "dev": true }, "@plotly/webpack-dash-dynamic-import": { - "version": "1.1.4-rc1", - "resolved": "https://registry.npmjs.org/@plotly/webpack-dash-dynamic-import/-/webpack-dash-dynamic-import-1.1.4-rc1.tgz", - "integrity": "sha512-910KMD6sAlBYax4JQjnIAn8ZbFicHgR9ijTAWL8b/bkyV+pXhhj1EKqcQTr5nEjXZ2R/85etypWd8vvwI2OmVQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@plotly/webpack-dash-dynamic-import/-/webpack-dash-dynamic-import-1.1.4.tgz", + "integrity": "sha512-inRFhwD48F8zDHKUGB8cVWlUTtZ3kDLuYMXE9XEmVhPlGUo/oMi9sU6XgPtrfGF1jWuERIDQECjTZ3AE1+rzCw==", "dev": true }, "@reach/router": { From 91bc5da1e7841e7609ae513216f4cd1b970dcce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 14:12:10 -0500 Subject: [PATCH 19/45] async test --- tests/cypress/tests/unit/exportUtils_tests.ts | 264 +++++++++--------- 1 file changed, 135 insertions(+), 129 deletions(-) diff --git a/tests/cypress/tests/unit/exportUtils_tests.ts b/tests/cypress/tests/unit/exportUtils_tests.ts index 74c437e25..2d5d03d92 100644 --- a/tests/cypress/tests/unit/exportUtils_tests.ts +++ b/tests/cypress/tests/unit/exportUtils_tests.ts @@ -1,6 +1,7 @@ import * as R from 'ramda'; import { ExportHeaders } from 'dash-table/components/Table/props'; +import 'xlsx'; /* Cheat and get the async resource pre-emptively */ import { transformMultiDimArray, getMergeRanges, createHeadings, createWorkbook } from 'dash-table/components/Export/utils'; describe('export', () => { @@ -18,27 +19,27 @@ describe('export', () => { const expectedArray = [['a'], ['b'], ['c'], ['d']]; expect(transformedArray).to.deep.equal(expectedArray); }); - it ('array with strings and strings array with same length', () => { + it('array with strings and strings array with same length', () => { const testedArray = ['a', ['b', 'c'], ['b', 'd']]; const transformedArray = transformMultiDimArray(testedArray, 2); const expectedArray = [['a', 'a'], ['b', 'c'], ['b', 'd']]; expect(transformedArray).to.deep.equal(expectedArray); }); - it ('2D strings array', () => { + it('2D strings array', () => { const testedArray = [['a', 'b', 'c'], ['b', 'c', 'd'], ['b', 'd', 'a']]; const transformedArray = transformMultiDimArray(testedArray, 3); const expectedArray = [['a', 'b', 'c'], ['b', 'c', 'd'], ['b', 'd', 'a']]; expect(transformedArray).to.deep.equal(expectedArray); }); - it ('multidimensional array', () => { + it('multidimensional array', () => { const testedArray = [['a', 'b'], ['b', 'c', 'd'], ['a', 'b', 'd', 'a']]; const transformedArray = transformMultiDimArray(testedArray, 4); const expectedArray = [['a', 'b', '', ''], ['b', 'c', 'd', ''], ['a', 'b', 'd', 'a']]; expect(transformedArray).to.deep.equal(expectedArray); }); - it ('multidimensional array with strings', () => { + it('multidimensional array with strings', () => { const testedArray = ['rows', ['a', 'b'], ['b', 'c', 'd'], ['a', 'b', 'd', 'a']]; const transformedArray = transformMultiDimArray(testedArray, 4); const expectedArray = [['rows', 'rows', 'rows', 'rows'], ['a', 'b', '', ''], ['b', 'c', 'd', ''], ['a', 'b', 'd', 'a']]; @@ -49,92 +50,92 @@ describe('export', () => { describe('getMergeRanges', () => { it('no merge', () => { const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'b', 'c', 'd'], - ['a', 'b', 'c', 'd']]; + ['a', 'b', 'c', 'd'], + ['a', 'b', 'c', 'd']]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = []; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('duplicate values - no merge', () => { const testedArray = [['a', 'b', 'c', 'a'], - ['a', 'b', 'c', 'a'], - ['a', 'b', 'c', 'a']]; + ['a', 'b', 'c', 'a'], + ['a', 'b', 'c', 'a']]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = []; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('merge 2 cells right with a different value in between', () => { const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'b', 'a', 'a'], - ['a', 'b', 'c', 'd']]; + ['a', 'b', 'a', 'a'], + ['a', 'b', 'c', 'd']]; const mergedRanges = getMergeRanges(testedArray); - const expectedRanges = [{s: {r: 1, c: 2}, e: {r: 1, c: 3}}]; + const expectedRanges = [{ s: { r: 1, c: 2 }, e: { r: 1, c: 3 } }]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('merge 2 cells left with a different value in between', () => { const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'a', 'b', 'a'], - ['a', 'b', 'c', 'd']]; + ['a', 'a', 'b', 'a'], + ['a', 'b', 'c', 'd']]; const mergedRanges = getMergeRanges(testedArray); - const expectedRanges = [{s: {r: 1, c: 0}, e: {r: 1, c: 1}}]; + const expectedRanges = [{ s: { r: 1, c: 0 }, e: { r: 1, c: 1 } }]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('2 cells merge', () => { const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'a', 'c', 'd'], - ['a', 'b', 'c', 'd']]; + ['a', 'a', 'c', 'd'], + ['a', 'b', 'c', 'd']]; const mergedRanges = getMergeRanges(testedArray); - const expectedRanges = [{s: {r: 1, c: 0}, e: {r: 1, c: 1}}]; + const expectedRanges = [{ s: { r: 1, c: 0 }, e: { r: 1, c: 1 } }]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('3 cells merge', () => { const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'a', 'a', 'd'], - ['a', 'b', 'c', 'd']]; + ['a', 'a', 'a', 'd'], + ['a', 'b', 'c', 'd']]; const mergedRanges = getMergeRanges(testedArray); - const expectedRanges = [{s: {r: 1, c: 0}, e: {r: 1, c: 2}}]; + const expectedRanges = [{ s: { r: 1, c: 0 }, e: { r: 1, c: 2 } }]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('4 cells merge', () => { const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'a', 'a', 'a'], - ['a', 'b', 'c', 'd']]; + ['a', 'a', 'a', 'a'], + ['a', 'b', 'c', 'd']]; const mergedRanges = getMergeRanges(testedArray); - const expectedRanges = [{s: {r: 1, c: 0}, e: {r: 1, c: 3}}]; + const expectedRanges = [{ s: { r: 1, c: 0 }, e: { r: 1, c: 3 } }]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('2 cells merge, 4 cells merge - same value', () => { const testedArray = [['a', 'a', 'c', 'd'], - ['a', 'a', 'a', 'a'], - ['a', 'b', 'c', 'd']]; + ['a', 'a', 'a', 'a'], + ['a', 'b', 'c', 'd']]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = [ - {s: {r: 0, c: 0}, e: {r: 0, c: 1}}, - {s: {r: 1, c: 0}, e: {r: 1, c: 3}} + { s: { r: 0, c: 0 }, e: { r: 0, c: 1 } }, + { s: { r: 1, c: 0 }, e: { r: 1, c: 3 } } ]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('2 cells merge, 4 cells merge, 3 cells merge - same value', () => { const testedArray = [['a', 'a', 'c', 'd'], - ['a', 'a', 'a', 'a'], - ['a', 'a', 'a', 'd']]; + ['a', 'a', 'a', 'a'], + ['a', 'a', 'a', 'd']]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = [ - {s: {r: 0, c: 0}, e: {r: 0, c: 1}}, - {s: {r: 1, c: 0}, e: {r: 1, c: 3}}, - {s: {r: 2, c: 0}, e: {r: 2, c: 2}} + { s: { r: 0, c: 0 }, e: { r: 0, c: 1 } }, + { s: { r: 1, c: 0 }, e: { r: 1, c: 3 } }, + { s: { r: 2, c: 0 }, e: { r: 2, c: 2 } } ]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('table with same value', () => { const testedArray = [['a', 'a', 'a', 'a'], - ['a', 'a', 'a', 'a'], - ['a', 'a', 'a', 'a']]; + ['a', 'a', 'a', 'a'], + ['a', 'a', 'a', 'a']]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = [ - {s: {r: 0, c: 0}, e: {r: 0, c: 3}}, - {s: {r: 1, c: 0}, e: {r: 1, c: 3}}, - {s: {r: 2, c: 0}, e: {r: 2, c: 3}} + { s: { r: 0, c: 0 }, e: { r: 0, c: 3 } }, + { s: { r: 1, c: 0 }, e: { r: 1, c: 3 } }, + { s: { r: 2, c: 0 }, e: { r: 2, c: 3 } } ]; expect(mergedRanges).to.deep.equal(expectedRanges); }); @@ -143,62 +144,62 @@ describe('export', () => { describe('createHeadings ', () => { it('strings 2D array input with same length for inner array', () => { const input = [['a', 'b', 'c'], - ['d', 'e', 'f'], - ['g', 'h', 'i']]; + ['d', 'e', 'f'], + ['g', 'h', 'i']]; const headings = createHeadings(input, 3); const expectHeadings = [['a', 'd', 'g'], - ['b', 'e', 'h'], - ['c', 'f', 'i']]; + ['b', 'e', 'h'], + ['c', 'f', 'i']]; expect(headings).to.deep.equal(expectHeadings); }); it('strings 2D array input with one different length for inner array', () => { const input = [['a', 'b', 'c'], - ['d', 'e', 'f'], - ['g', 'h', 'i', 'j']]; + ['d', 'e', 'f'], + ['g', 'h', 'i', 'j']]; const headings = createHeadings(input, 4); const expectHeadings = [['a', 'd', 'g'], - ['b', 'e', 'h'], - ['c', 'f', 'i'], - ['' , '', 'j']]; + ['b', 'e', 'h'], + ['c', 'f', 'i'], + ['', '', 'j']]; expect(headings).to.deep.equal(expectHeadings); }); it('strings 2D array input with multi different length for inner array', () => { const input = [['a', 'b', 'c'], - ['d', 'e', 'f', '1'], - ['g', 'h', 'i', 'j', 'k']]; + ['d', 'e', 'f', '1'], + ['g', 'h', 'i', 'j', 'k']]; const headings = createHeadings(input, 5); const expectHeadings = [['a', 'd', 'g'], - ['b', 'e', 'h'], - ['c', 'f', 'i'], - ['' , '1', 'j'], - ['', '', 'k']]; + ['b', 'e', 'h'], + ['c', 'f', 'i'], + ['', '1', 'j'], + ['', '', 'k']]; expect(headings).to.deep.equal(expectHeadings); }); it('strings and string[] array with same length for inner array', () => { const input = ['rows', - ['d', 'e', 'f'], - ['g', 'h', 'i']]; + ['d', 'e', 'f'], + ['g', 'h', 'i']]; const headings = createHeadings(input, 3); const expectHeadings = [['rows', 'd', 'g'], - ['rows', 'e', 'h'], - ['rows', 'f', 'i']]; + ['rows', 'e', 'h'], + ['rows', 'f', 'i']]; expect(headings).to.deep.equal(expectHeadings); }); it('strings and string[] array with different length for inner array', () => { const input = ['rows', - ['d', 'e', 'f', 'g'], - ['g', 'h', 'i']]; + ['d', 'e', 'f', 'g'], + ['g', 'h', 'i']]; const headings = createHeadings(input, 4); const expectHeadings = [['rows', 'd', 'g'], - ['rows', 'e', 'h'], - ['rows', 'f', 'i'], - ['rows', 'g', '']]; + ['rows', 'e', 'h'], + ['rows', 'f', 'i'], + ['rows', 'g', '']]; expect(headings).to.deep.equal(expectHeadings); }); it('strings array', () => { const input = ['1', - '2', - '3']; + '2', + '3']; const headings = createHeadings(input, 1); const expectHeadings = [['1', '2', '3']]; expect(headings).to.deep.equal(expectHeadings); @@ -231,32 +232,33 @@ describe('export', () => { const wsDisplay = await createWorkbook(Headings, data, columnID, ExportHeaders.Display, true); const wsDisplayNoMerge = await createWorkbook(Headings, data, columnID, ExportHeaders.Display, false); const expectedWS = { - A1: {t: 's', v: 'rows'}, - A2: {t: 's', v: 'rows'}, - A3: {t: 's', v: 'rows'}, - A4: {t: 's', v: 'rows'}, - A5: {t: 'n', v: 1}, - A6: {t: 'n', v: 2}, - A7: {t: 'n', v: 1}, - B1: {t: 's', v: 'rows'}, - B2: {t: 's', v: 'c'}, - B3: {t: 's', v: 'e'}, - B4: {t: 's', v: 'rows'}, - B5: {t: 'n', v: 2}, - B6: {t: 'n', v: 3}, - B7: {t: 'n', v: 2}, - C1: {t: 's', v: 'b'}, - C2: {t: 's', v: 'c'}, - C3: {t: 's', v: 'f'}, - C4: {t: 's', v: 'rows'}, - C5: {t: 'n', v: 3}, - C6: {t: 'n', v: 4}, - C7: {t: 'n', v: 3}}; + A1: { t: 's', v: 'rows' }, + A2: { t: 's', v: 'rows' }, + A3: { t: 's', v: 'rows' }, + A4: { t: 's', v: 'rows' }, + A5: { t: 'n', v: 1 }, + A6: { t: 'n', v: 2 }, + A7: { t: 'n', v: 1 }, + B1: { t: 's', v: 'rows' }, + B2: { t: 's', v: 'c' }, + B3: { t: 's', v: 'e' }, + B4: { t: 's', v: 'rows' }, + B5: { t: 'n', v: 2 }, + B6: { t: 'n', v: 3 }, + B7: { t: 'n', v: 2 }, + C1: { t: 's', v: 'b' }, + C2: { t: 's', v: 'c' }, + C3: { t: 's', v: 'f' }, + C4: { t: 's', v: 'rows' }, + C5: { t: 'n', v: 3 }, + C6: { t: 'n', v: 4 }, + C7: { t: 'n', v: 3 } + }; expectedWS['!ref'] = 'A1:C7'; const expectedWSDisplay = R.clone(expectedWS); - expectedWSDisplay['!merges'] = [ {s: {r: 0, c: 0}, e: {r: 0, c: 1}}, - {s: {r: 1, c: 1}, e: {r: 1, c: 2}}, - {s: {r: 3, c: 0}, e: {r: 3, c: 2}} ]; + expectedWSDisplay['!merges'] = [{ s: { r: 0, c: 0 }, e: { r: 0, c: 1 } }, + { s: { r: 1, c: 1 }, e: { r: 1, c: 2 } }, + { s: { r: 3, c: 0 }, e: { r: 3, c: 2 } }]; expect(wsName.Sheets.SheetJS).to.deep.equal(expectedWS); expect(wsDisplayNoMerge.Sheets.SheetJS).to.deep.equal(expectedWS); expect(wsDisplay.Sheets.SheetJS).to.deep.equal(expectedWSDisplay); @@ -264,61 +266,65 @@ describe('export', () => { it('create sheet with column ids as headers', async () => { const ws = await createWorkbook(Headings, data, columnID, ExportHeaders.Ids, true); const expectedWS = { - A1: {t: 's', v: 'col1'}, - A2: {t: 'n', v: 1}, - A3: {t: 'n', v: 2}, - A4: {t: 'n', v: 1}, - B1: {t: 's', v: 'col2'}, - B2: {t: 'n', v: 2}, - B3: {t: 'n', v: 3}, - B4: {t: 'n', v: 2}, - C1: {t: 's', v: 'col4'}, - C2: {t: 'n', v: 3}, - C3: {t: 'n', v: 4}, - C4: {t: 'n', v: 3}}; + A1: { t: 's', v: 'col1' }, + A2: { t: 'n', v: 1 }, + A3: { t: 'n', v: 2 }, + A4: { t: 'n', v: 1 }, + B1: { t: 's', v: 'col2' }, + B2: { t: 'n', v: 2 }, + B3: { t: 'n', v: 3 }, + B4: { t: 'n', v: 2 }, + C1: { t: 's', v: 'col4' }, + C2: { t: 'n', v: 3 }, + C3: { t: 'n', v: 4 }, + C4: { t: 'n', v: 3 } + }; expectedWS['!ref'] = 'A1:C4'; expect(ws.Sheets.SheetJS).to.deep.equal(expectedWS); }); it('create sheet with no headers', async () => { const ws = await createWorkbook([], data, columnID, ExportHeaders.None, true); const expectedWS = { - A1: {t: 'n', v: 1}, - A2: {t: 'n', v: 2}, - A3: {t: 'n', v: 1}, - B1: {t: 'n', v: 2}, - B2: {t: 'n', v: 3}, - B3: {t: 'n', v: 2}, - C1: {t: 'n', v: 3}, - C2: {t: 'n', v: 4}, - C3: {t: 'n', v: 3}}; + A1: { t: 'n', v: 1 }, + A2: { t: 'n', v: 2 }, + A3: { t: 'n', v: 1 }, + B1: { t: 'n', v: 2 }, + B2: { t: 'n', v: 3 }, + B3: { t: 'n', v: 2 }, + C1: { t: 'n', v: 3 }, + C2: { t: 'n', v: 4 }, + C3: { t: 'n', v: 3 } + }; expectedWS['!ref'] = 'A1:C3'; expect(ws.Sheets.SheetJS).to.deep.equal(expectedWS); }); it('create sheet with undefined column for clearable columns', async () => { const newData = [ - {col2: 2, col4: 3}, - {col2: 3, col4: 4}, - {col2: 2, col4: 3} + { col2: 2, col4: 3 }, + { col2: 3, col4: 4 }, + { col2: 2, col4: 3 } ]; const ws = await createWorkbook(Headings, newData, columnID, ExportHeaders.Display, false); - const expectedWS = {A1: {t: 's', v: 'rows'}, - A2: {t: 's', v: 'rows'}, - A3: {t: 's', v: 'rows'}, - A4: {t: 's', v: 'rows'}, - B1: {t: 's', v: 'rows'}, - B2: {t: 's', v: 'c'}, - B3: {t: 's', v: 'e'}, - B4: {t: 's', v: 'rows'}, - B5: {t: 'n', v: 2}, - B6: {t: 'n', v: 3}, - B7: {t: 'n', v: 2}, - C1: {t: 's', v: 'b'}, - C2: {t: 's', v: 'c'}, - C3: {t: 's', v: 'f'}, - C4: {t: 's', v: 'rows'}, - C5: {t: 'n', v: 3}, - C6: {t: 'n', v: 4}, - C7: {t: 'n', v: 3}}; + const expectedWS = { + A1: { t: 's', v: 'rows' }, + A2: { t: 's', v: 'rows' }, + A3: { t: 's', v: 'rows' }, + A4: { t: 's', v: 'rows' }, + B1: { t: 's', v: 'rows' }, + B2: { t: 's', v: 'c' }, + B3: { t: 's', v: 'e' }, + B4: { t: 's', v: 'rows' }, + B5: { t: 'n', v: 2 }, + B6: { t: 'n', v: 3 }, + B7: { t: 'n', v: 2 }, + C1: { t: 's', v: 'b' }, + C2: { t: 's', v: 'c' }, + C3: { t: 's', v: 'f' }, + C4: { t: 's', v: 'rows' }, + C5: { t: 'n', v: 3 }, + C6: { t: 'n', v: 4 }, + C7: { t: 'n', v: 3 } + }; expectedWS['!ref'] = 'A1:C7'; expect(ws.Sheets.SheetJS).to.deep.equal(expectedWS); }); From 078eba4306dc183328f90a5d3e275f99de597b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 14:55:14 -0500 Subject: [PATCH 20/45] update docker --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8775720fb..d1c21c49f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2 jobs: "server-test": docker: - - image: circleci/python:3.6.7-node-browsers + - image: circleci/python:3.6-node-browsers - image: cypress/base:10 steps: @@ -51,7 +51,7 @@ jobs: "standalone-test": docker: - - image: circleci/python:3.6.7-node-browsers + - image: circleci/python:3.6-node-browsers - image: cypress/base:10 steps: @@ -79,7 +79,7 @@ jobs: "unit-test": docker: - - image: circleci/python:3.6.7-node-browsers + - image: circleci/python:3.6-node-browsers - image: cypress/base:10 steps: @@ -148,7 +148,7 @@ jobs: "node": docker: - - image: circleci/python:3.6.7-node + - image: circleci/python:3.6-node steps: - checkout @@ -185,7 +185,7 @@ jobs: "python-3.6": docker: - - image: circleci/python:3.6.7-stretch-node-browsers + - image: circleci/python:3.6-stretch-node-browsers environment: PERCY_ENABLED: True From 64c7125553a885f08d07bcef2a9ff209ddee63e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 15:06:08 -0500 Subject: [PATCH 21/45] revert for standalone --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d1c21c49f..0814f4aad 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,7 +51,7 @@ jobs: "standalone-test": docker: - - image: circleci/python:3.6-node-browsers + - image: circleci/python:3.6.7-node-browsers - image: cypress/base:10 steps: From e8e5198d3270aaed3db8e953437fdcf58ce40781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 15:19:41 -0500 Subject: [PATCH 22/45] update cypress to 3.6.0 --- .circleci/config.yml | 2 +- package-lock.json | 26 ++++++++++++++++++++------ package.json | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0814f4aad..d1c21c49f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,7 +51,7 @@ jobs: "standalone-test": docker: - - image: circleci/python:3.6.7-node-browsers + - image: circleci/python:3.6-node-browsers - image: cypress/base:10 steps: diff --git a/package-lock.json b/package-lock.json index a550cfeff..9725ea90c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3452,6 +3452,12 @@ } } }, + "@types/sizzle": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz", + "integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==", + "dev": true + }, "@webassemblyjs/ast": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", @@ -6492,13 +6498,14 @@ "dev": true }, "cypress": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.4.1.tgz", - "integrity": "sha512-1HBS7t9XXzkt6QHbwfirWYty8vzxNMawGj1yI+Fu6C3/VZJ8UtUngMW6layqwYZzLTZV8tiDpdCNBypn78V4Dg==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.6.0.tgz", + "integrity": "sha512-ODhbOrH1XZx0DUoYmJSvOSbEQjycNOpFYe7jOnHkT1+sdsn2+uqwAjZ1x982q3H4R/5iZjpSd50gd/iw2bofzg==", "dev": true, "requires": { "@cypress/listr-verbose-renderer": "0.4.1", "@cypress/xvfb": "1.2.4", + "@types/sizzle": "2.3.2", "arch": "2.1.1", "bluebird": "3.5.0", "cachedir": "1.3.0", @@ -6525,6 +6532,7 @@ "request-progress": "3.0.0", "supports-color": "5.5.0", "tmp": "0.1.0", + "untildify": "3.0.3", "url": "0.11.0", "yauzl": "2.10.0" }, @@ -6644,9 +6652,9 @@ } }, "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -20295,6 +20303,12 @@ } } }, + "untildify": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", + "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", + "dev": true + }, "upath": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", diff --git a/package.json b/package.json index efebc086a..41a21e625 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "@types/react-select": "^1.3.4", "babel-loader": "^8.0.6", "css-loader": "^3.2.0", - "cypress": "^3.4.1", + "cypress": "^3.6.0", "d3-format": "^1.4.1", "es-check": "^5.0.0", "fast-isnumeric": "^1.1.3", From ff1f6a0ca854e57b0b2e4e237966b24d811747ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 15:27:37 -0500 Subject: [PATCH 23/45] increase timeout: tests are unstable for unknown reasons --- cypress.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress.json b/cypress.json index e1c77a7a3..25cf1bbc6 100644 --- a/cypress.json +++ b/cypress.json @@ -6,5 +6,6 @@ "screenshotsFolder": "./tests/cypress/screenshots", "supportFile": "./tests/cypress/support/index.js", "videoFolder": "./tests/cypress/videos", - "numTestsKeptInMemory": 0 + "numTestsKeptInMemory": 0, + "defaultCommandTimeout": 10000 } \ No newline at end of file From 168b93faa8b3e68e87d384d1908811262277b2f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 15:36:55 -0500 Subject: [PATCH 24/45] 3.6.7 --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d1c21c49f..8775720fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2 jobs: "server-test": docker: - - image: circleci/python:3.6-node-browsers + - image: circleci/python:3.6.7-node-browsers - image: cypress/base:10 steps: @@ -51,7 +51,7 @@ jobs: "standalone-test": docker: - - image: circleci/python:3.6-node-browsers + - image: circleci/python:3.6.7-node-browsers - image: cypress/base:10 steps: @@ -79,7 +79,7 @@ jobs: "unit-test": docker: - - image: circleci/python:3.6-node-browsers + - image: circleci/python:3.6.7-node-browsers - image: cypress/base:10 steps: @@ -148,7 +148,7 @@ jobs: "node": docker: - - image: circleci/python:3.6-node + - image: circleci/python:3.6.7-node steps: - checkout @@ -185,7 +185,7 @@ jobs: "python-3.6": docker: - - image: circleci/python:3.6-stretch-node-browsers + - image: circleci/python:3.6.7-stretch-node-browsers environment: PERCY_ENABLED: True From 747f6cb677310293d6fa4bc4607027e663af1d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 8 Nov 2019 15:45:37 -0500 Subject: [PATCH 25/45] 3.6 once again? insane timeout.. can this ever pass correctly? --- .circleci/config.yml | 10 +++++----- cypress.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8775720fb..d1c21c49f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2 jobs: "server-test": docker: - - image: circleci/python:3.6.7-node-browsers + - image: circleci/python:3.6-node-browsers - image: cypress/base:10 steps: @@ -51,7 +51,7 @@ jobs: "standalone-test": docker: - - image: circleci/python:3.6.7-node-browsers + - image: circleci/python:3.6-node-browsers - image: cypress/base:10 steps: @@ -79,7 +79,7 @@ jobs: "unit-test": docker: - - image: circleci/python:3.6.7-node-browsers + - image: circleci/python:3.6-node-browsers - image: cypress/base:10 steps: @@ -148,7 +148,7 @@ jobs: "node": docker: - - image: circleci/python:3.6.7-node + - image: circleci/python:3.6-node steps: - checkout @@ -185,7 +185,7 @@ jobs: "python-3.6": docker: - - image: circleci/python:3.6.7-stretch-node-browsers + - image: circleci/python:3.6-stretch-node-browsers environment: PERCY_ENABLED: True diff --git a/cypress.json b/cypress.json index 25cf1bbc6..c61cf2fff 100644 --- a/cypress.json +++ b/cypress.json @@ -7,5 +7,5 @@ "supportFile": "./tests/cypress/support/index.js", "videoFolder": "./tests/cypress/videos", "numTestsKeptInMemory": 0, - "defaultCommandTimeout": 10000 + "defaultCommandTimeout": 60000 } \ No newline at end of file From 9564405682079b89986c62a4ca7c3e4727fb4fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 12 Nov 2019 08:47:04 -0500 Subject: [PATCH 26/45] undo cypress settings changes --- cypress.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cypress.json b/cypress.json index c61cf2fff..e1c77a7a3 100644 --- a/cypress.json +++ b/cypress.json @@ -6,6 +6,5 @@ "screenshotsFolder": "./tests/cypress/screenshots", "supportFile": "./tests/cypress/support/index.js", "videoFolder": "./tests/cypress/videos", - "numTestsKeptInMemory": 0, - "defaultCommandTimeout": 60000 + "numTestsKeptInMemory": 0 } \ No newline at end of file From 29732d44416416fe445de1064a92335665b2bb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 12 Nov 2019 13:19:13 -0500 Subject: [PATCH 27/45] selectively apply focus --- src/core/browser/DOM.ts | 15 ++++++ .../components/CellDropdown/index.tsx | 5 +- src/dash-table/components/CellFactory.tsx | 14 +++-- src/dash-table/components/CellInput/index.tsx | 5 +- src/dash-table/components/CellLabel/index.tsx | 5 +- .../components/ControlledTable/index.tsx | 11 ++-- src/dash-table/components/Table/index.tsx | 54 +++++++++++++------ src/dash-table/components/Table/props.ts | 12 ++--- src/dash-table/dash/Sanitizer.ts | 6 ++- src/dash-table/derived/cell/contents.tsx | 8 ++- 10 files changed, 89 insertions(+), 46 deletions(-) diff --git a/src/core/browser/DOM.ts b/src/core/browser/DOM.ts index 04be859e4..85320145e 100644 --- a/src/core/browser/DOM.ts +++ b/src/core/browser/DOM.ts @@ -15,4 +15,19 @@ export default class DOM { } } } + + public static getParentById(element: HTMLElement, id: string): HTMLElement | undefined { + let current: HTMLElement = element; + while (current) { + if (current.id === id) { + return current; + } + + if (current.parentElement !== null) { + current = current.parentElement; + } else { + return; + } + } + } } \ No newline at end of file diff --git a/src/dash-table/components/CellDropdown/index.tsx b/src/dash-table/components/CellDropdown/index.tsx index 801d4e521..30ae7a184 100644 --- a/src/dash-table/components/CellDropdown/index.tsx +++ b/src/dash-table/components/CellDropdown/index.tsx @@ -12,6 +12,7 @@ import { IDropdownValue } from '../Table/props'; interface IProps { active: boolean; + applyFocus: boolean; clearable?: boolean; dropdown?: IDropdownValue[]; onChange: (e: ChangeEvent) => void; @@ -64,14 +65,14 @@ export default class CellDropdown extends PureComponent { } private setFocus() { - const { active } = this.props; + const { active, applyFocus } = this.props; if (!active) { return; } const dropdown = this.refs.dropdown as any; - if (dropdown && document.activeElement !== dropdown) { + if (applyFocus && dropdown && document.activeElement !== dropdown) { // Limitation. If React >= 16 --> Use React.createRef instead to pass parent ref to child const tdParent = DOM.getFirstParentOfType(dropdown.wrapper, 'td'); if (tdParent) { diff --git a/src/dash-table/components/CellFactory.tsx b/src/dash-table/components/CellFactory.tsx index bafb906fd..e35fc19e9 100644 --- a/src/dash-table/components/CellFactory.tsx +++ b/src/dash-table/components/CellFactory.tsx @@ -15,8 +15,6 @@ import { IEdgesMatrices } from 'dash-table/derived/edges/type'; import { memoizeOne } from 'core/memoizer'; import memoizerCache from 'core/cache/memoizer'; -import dataLoading from 'dash-table/derived/table/data_loading'; - export default class CellFactory { private get props() { @@ -38,12 +36,14 @@ export default class CellFactory { public createCells(dataEdges: IEdgesMatrices | undefined, dataOpEdges: IEdgesMatrices | undefined) { const { active_cell, + applyFocus, dropdown_conditional, dropdown, data, dropdown_data, id, is_focused, + loading_state, row_deletable, row_selectable, selected_cells, @@ -54,8 +54,7 @@ export default class CellFactory { style_data, style_data_conditional, virtualized, - visibleColumns, - loading_state + visibleColumns } = this.props; const relevantStyles = this.relevantStyles( @@ -118,26 +117,25 @@ export default class CellFactory { selected_cells ); - const data_loading = dataLoading(loading_state); - const partialCellContents = this.cellContents.partialGet( visibleColumns, virtualized.data, virtualized.offset, !!is_focused, dropdowns, - data_loading + loading_state ); const cellContents = this.cellContents.get( partialCellContents, active_cell, + applyFocus || false, visibleColumns, virtualized.data, virtualized.offset, !!is_focused, dropdowns, - data_loading + loading_state ); const ops = this.getDataOpCells( diff --git a/src/dash-table/components/CellInput/index.tsx b/src/dash-table/components/CellInput/index.tsx index 3e3b32344..5c02ab2e8 100644 --- a/src/dash-table/components/CellInput/index.tsx +++ b/src/dash-table/components/CellInput/index.tsx @@ -12,6 +12,7 @@ import { interface ICellProps { active: boolean; + applyFocus: boolean; className: string; focused: boolean; onChange: (e: ChangeEvent) => void; @@ -115,14 +116,14 @@ export default class CellInput extends PureComponent { } private setFocus() { - const { active } = this.props; + const { active, applyFocus } = this.props; if (!active) { return; } const input = this.refs.textInput as HTMLInputElement; - if (input && document.activeElement !== input) { + if (applyFocus && input && document.activeElement !== input) { input.focus(); input.setSelectionRange(0, input.value ? input.value.length : 0); } diff --git a/src/dash-table/components/CellLabel/index.tsx b/src/dash-table/components/CellLabel/index.tsx index 23da68414..03ff5f96b 100644 --- a/src/dash-table/components/CellLabel/index.tsx +++ b/src/dash-table/components/CellLabel/index.tsx @@ -4,6 +4,7 @@ import React, { interface IProps { active: boolean; + applyFocus: boolean; className: string; value: any; } @@ -35,14 +36,14 @@ export default class CellLabel extends PureComponent { } private setFocus() { - const { active } = this.props; + const { active, applyFocus } = this.props; if (!active) { return; } const el = this.refs.el as HTMLDivElement; - if (el && document.activeElement !== el) { + if (applyFocus && el && document.activeElement !== el) { el.focus(); } } diff --git a/src/dash-table/components/ControlledTable/index.tsx b/src/dash-table/components/ControlledTable/index.tsx index da46d47d3..e536cf8e9 100644 --- a/src/dash-table/components/ControlledTable/index.tsx +++ b/src/dash-table/components/ControlledTable/index.tsx @@ -35,7 +35,6 @@ import TableTooltip from './fragments/TableTooltip'; import queryLexicon from 'dash-table/syntax-tree/lexicon/query'; -import dataLoading from 'dash-table/derived/table/data_loading'; import reconcile from 'dash-table/type/reconcile'; import PageNavigation from 'dash-table/components/PageNavigation'; @@ -591,15 +590,15 @@ export default class ControlledTable extends PureComponent data, editable, filter_query, + loading_state, setProps, sort_by, viewport, visibleColumns, - include_headers_on_copy_paste, - loading_state + include_headers_on_copy_paste } = this.props; - if (!editable || !active_cell || dataLoading(loading_state)) { + if (!editable || !active_cell || loading_state) { return; } @@ -738,8 +737,6 @@ export default class ControlledTable extends PureComponent visibleColumns } = this.props; - const isLoading = dataLoading(loading_state); - const fragmentClasses = [ [ fixed_rows && fixed_columns ? 'dash-fixed-row dash-fixed-column' : '', @@ -771,7 +768,7 @@ export default class ControlledTable extends PureComponent ...(virtualized.data.length ? [] : ['dash-no-data']), ...(filter_action !== TableAction.None ? [] : ['dash-no-filter']), ...(fill_width ? ['dash-fill-width'] : []), - ...(isLoading ? ['dash-loading'] : []) + ...(loading_state ? ['dash-loading'] : []) ]; const containerClasses = ['dash-spreadsheet-container', ...classes]; diff --git a/src/dash-table/components/Table/index.tsx b/src/dash-table/components/Table/index.tsx index f20893e7a..0a5dca565 100644 --- a/src/dash-table/components/Table/index.tsx +++ b/src/dash-table/components/Table/index.tsx @@ -26,6 +26,7 @@ import derivedFilterMap from 'dash-table/derived/filter/map'; import controlledPropsHelper from './controlledPropsHelper'; import derivedPropsHelper from './derivedPropsHelper'; +import DOM from 'core/browser/DOM'; const DERIVED_REGEX = /^derived_/; @@ -49,24 +50,45 @@ export default class Table extends Component { - const { workFilter: { map: currentMap, value } } = state; - - if (value !== nextProps.filter_query) { - const map = this.filterMap( - currentMap, - nextProps.filter_query, - nextProps.visibleColumns - ); - - return map !== currentMap ? { workFilter: { map, value} } : null; - } else { - return null; + const { applyFocus: currentApplyFocus, workFilter: { map: currentMap, value } } = state; + + const nextState: Partial = {}; + + // state for filter + if (nextProps.filter_query !== this.props.filter_query) { + if (value !== nextProps.filter_query) { + const map = this.filterMap( + currentMap, + nextProps.filter_query, + nextProps.visibleColumns + ); + + if (map !== currentMap) { + nextState.workFilter = { map, value }; + } + } + } + + // state for applying focus + if (nextProps.active_cell !== this.props.active_cell) { + if (!currentApplyFocus) { + nextState.applyFocus = true; + } + } else if (nextProps.loading_state !== this.props.loading_state) { + let applyFocus = false; + + const activeElement = document.activeElement as HTMLElement; + if (activeElement) { + applyFocus = !!DOM.getParentById(activeElement, this.props.id); + } + + if (applyFocus !== currentApplyFocus) { + nextState.applyFocus = applyFocus; + } } + + return R.keysIn(nextState).length ? nextState as any : null; }); } diff --git a/src/dash-table/components/Table/props.ts b/src/dash-table/components/Table/props.ts index fe380e40a..6d727a791 100644 --- a/src/dash-table/components/Table/props.ts +++ b/src/dash-table/components/Table/props.ts @@ -84,7 +84,7 @@ export interface ICellCoordinates { export type ColumnId = string; export type Columns = IColumn[]; export type Data = Datum[]; -export type Datum = IDatumObject | any; +export type Datum = IDatumObject | any; export type Indices = number[]; export type RowId = string | number; export type SelectedCells = ICellCoordinates[]; @@ -172,7 +172,7 @@ export interface IDatetimeColumn extends ITypeColumn { export interface IBaseColumn { clearable?: boolean | boolean[] | 'first' | 'last'; - deletable?: boolean | boolean[] | 'first' |'last'; + deletable?: boolean | boolean[] | 'first' | 'last'; editable: boolean; hideable?: boolean | boolean[] | 'first' | 'last'; renamable?: boolean | boolean[] | 'first' | 'last'; @@ -256,6 +256,7 @@ export interface IUSerInterfaceTooltip { export interface IState { activeMenu?: 'show/hide'; + applyFocus?: boolean; currentTooltip?: IUSerInterfaceTooltip; forcedResizeOnly: boolean; rawFilterQuery: string; @@ -410,6 +411,7 @@ export type SanitizedProps = Omit, 'locale_format'>, @@ -429,8 +431,6 @@ export type ControlledTableProps = SanitizedProps & IState & { virtual: IDerivedData; virtual_selected_rows: Indices; virtualized: IVirtualizedDerivedData; - - loading_state: ILoadingState | undefined; }; export type SetFilter = ( @@ -462,6 +462,7 @@ export type HeaderFactoryProps = ControlledTableProps & { export interface ICellFactoryProps { active_cell: ICellCoordinates; + applyFocus?: boolean; dropdown: StaticDropdowns; dropdown_conditional: ConditionalDropdowns; dropdown_data: DataDropdowns; @@ -474,6 +475,7 @@ export interface ICellFactoryProps { fixed_rows: number; id: string; is_focused?: boolean; + loading_state: boolean; paginator: IPaginator; row_deletable: boolean; row_selectable: Selection; @@ -498,6 +500,4 @@ export interface ICellFactoryProps { virtualization: boolean; virtualized: IVirtualizedDerivedData; visibleColumns: Columns; - - loading_state?: ILoadingState; } diff --git a/src/dash-table/dash/Sanitizer.ts b/src/dash-table/dash/Sanitizer.ts index f6609504a..72c6d618d 100644 --- a/src/dash-table/dash/Sanitizer.ts +++ b/src/dash-table/dash/Sanitizer.ts @@ -18,6 +18,7 @@ import { } from 'dash-table/components/Table/props'; import headerRows from 'dash-table/derived/header/headerRows'; import resolveFlag from 'dash-table/derived/cell/resolveFlag'; +import dataLoading from 'dash-table/derived/table/data_loading'; const D3_DEFAULT_LOCALE: INumberLocale = { symbol: ['$', ''], @@ -81,8 +82,8 @@ export default class Sanitizer { const visibleColumns = this.getVisibleColumns(columns, props.hidden_columns); let headerFormat = props.export_headers; - if (props.export_format === ExportFormat.Xlsx && R.isNil(headerFormat)) { - headerFormat = ExportHeaders.Names; + if (props.export_format === ExportFormat.Xlsx && R.isNil(headerFormat)) { + headerFormat = ExportHeaders.Names; } else if (props.export_format === ExportFormat.Csv && R.isNil(headerFormat)) { headerFormat = ExportHeaders.Ids; } @@ -92,6 +93,7 @@ export default class Sanitizer { export_headers: headerFormat, fixed_columns: getFixedColumns(props.fixed_columns, props.row_deletable, props.row_selectable), fixed_rows: getFixedRows(props.fixed_rows, props.columns, props.filter_action), + loading_state: dataLoading(props.loading_state), locale_format, visibleColumns }); diff --git a/src/dash-table/derived/cell/contents.tsx b/src/dash-table/derived/cell/contents.tsx index 51b5664ed..6af61a434 100644 --- a/src/dash-table/derived/cell/contents.tsx +++ b/src/dash-table/derived/cell/contents.tsx @@ -71,6 +71,7 @@ class Contents { return mapData( (datum, rowIndex) => mapRow( (column, columnIndex) => this.getContent( + false, false, isFocused, column, @@ -86,6 +87,7 @@ class Contents { get = memoizeOne(( contents: JSX.Element[][], activeCell: ICellCoordinates | undefined, + applyFocus: boolean, columns: Columns, data: Data, offset: IViewportOffset, @@ -110,6 +112,7 @@ class Contents { contents = shallowClone(contents); contents[i][j] = this.getContent( true, + applyFocus || false, isFocused, columns[j], dropdowns && dropdowns[i][j], @@ -123,7 +126,7 @@ class Contents { return contents; }); - private getContent(active: boolean, isFocused: boolean, column: IColumn, dropdown: IDropdown | undefined, columnIndex: number, rowIndex: number, datum: any, formatters: ((value: any) => any)[], data_loading: boolean) { + private getContent(active: boolean, applyFocus: boolean, isFocused: boolean, column: IColumn, dropdown: IDropdown | undefined, columnIndex: number, rowIndex: number, datum: any, formatters: ((value: any) => any)[], data_loading: boolean) { const className = [ ...(active ? ['input-active'] : []), @@ -138,6 +141,7 @@ class Contents { return ( Date: Tue, 12 Nov 2019 14:39:20 -0500 Subject: [PATCH 28/45] fix test - pressing a release:false key presses it again in cypress 3.6 (vs 3.4) --- tests/cypress/tests/server/select_props_test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/cypress/tests/server/select_props_test.ts b/tests/cypress/tests/server/select_props_test.ts index f018dd180..43e124ba8 100644 --- a/tests/cypress/tests/server/select_props_test.ts +++ b/tests/cypress/tests/server/select_props_test.ts @@ -115,7 +115,6 @@ describe('select row', () => { expectCellSelection([1, 2, 3], [3001, 3002, 3003], [0, 1], [0, 1], [2, 1], [2, 1]); // shrink the selection - DOM.focused.type(Key.Shift, { release: false }); DashTable.getCell(2, 1).click(); expectCellSelection([2, 3], [3002, 3003], [1], [1], [1, 0], [1, 0]); From 5b21efa0393e7de9823ecb6f292f7d4b80b7481b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 12 Nov 2019 15:21:28 -0500 Subject: [PATCH 29/45] old standalone --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d1c21c49f..0814f4aad 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,7 +51,7 @@ jobs: "standalone-test": docker: - - image: circleci/python:3.6-node-browsers + - image: circleci/python:3.6.7-node-browsers - image: cypress/base:10 steps: From 9d3d97c7beedcf8721e5a72d4c634909a52a2890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 12 Nov 2019 15:58:55 -0500 Subject: [PATCH 30/45] undo cypress 3.6.0 -> 3.4.1 --- package-lock.json | 20 +++----------------- package.json | 4 ++-- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9725ea90c..f4be4d8a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3452,12 +3452,6 @@ } } }, - "@types/sizzle": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz", - "integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==", - "dev": true - }, "@webassemblyjs/ast": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", @@ -6498,14 +6492,13 @@ "dev": true }, "cypress": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.6.0.tgz", - "integrity": "sha512-ODhbOrH1XZx0DUoYmJSvOSbEQjycNOpFYe7jOnHkT1+sdsn2+uqwAjZ1x982q3H4R/5iZjpSd50gd/iw2bofzg==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.4.1.tgz", + "integrity": "sha512-1HBS7t9XXzkt6QHbwfirWYty8vzxNMawGj1yI+Fu6C3/VZJ8UtUngMW6layqwYZzLTZV8tiDpdCNBypn78V4Dg==", "dev": true, "requires": { "@cypress/listr-verbose-renderer": "0.4.1", "@cypress/xvfb": "1.2.4", - "@types/sizzle": "2.3.2", "arch": "2.1.1", "bluebird": "3.5.0", "cachedir": "1.3.0", @@ -6532,7 +6525,6 @@ "request-progress": "3.0.0", "supports-color": "5.5.0", "tmp": "0.1.0", - "untildify": "3.0.3", "url": "0.11.0", "yauzl": "2.10.0" }, @@ -20303,12 +20295,6 @@ } } }, - "untildify": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", - "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", - "dev": true - }, "upath": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", diff --git a/package.json b/package.json index 41a21e625..5cccdb875 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "@types/react-select": "^1.3.4", "babel-loader": "^8.0.6", "css-loader": "^3.2.0", - "cypress": "^3.6.0", + "cypress": "3.4.1", "d3-format": "^1.4.1", "es-check": "^5.0.0", "fast-isnumeric": "^1.1.3", @@ -127,4 +127,4 @@ "node": ">=8.11.0", "npm": ">=6.1.0" } -} \ No newline at end of file +} From 45f04c2689dc633f7c5da2b3b194afbd484a597f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 12 Nov 2019 16:10:23 -0500 Subject: [PATCH 31/45] ^3.4.1 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5cccdb875..efebc086a 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "@types/react-select": "^1.3.4", "babel-loader": "^8.0.6", "css-loader": "^3.2.0", - "cypress": "3.4.1", + "cypress": "^3.4.1", "d3-format": "^1.4.1", "es-check": "^5.0.0", "fast-isnumeric": "^1.1.3", @@ -127,4 +127,4 @@ "node": ">=8.11.0", "npm": ">=6.1.0" } -} +} \ No newline at end of file From ad7600b205c0714bf920e157a4a3f09350917de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 12 Nov 2019 16:26:09 -0500 Subject: [PATCH 32/45] cypress 3.6.1 --- .circleci/config.yml | 2 +- package-lock.json | 20 +++++++++++++++++--- package.json | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0814f4aad..d1c21c49f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,7 +51,7 @@ jobs: "standalone-test": docker: - - image: circleci/python:3.6.7-node-browsers + - image: circleci/python:3.6-node-browsers - image: cypress/base:10 steps: diff --git a/package-lock.json b/package-lock.json index f4be4d8a2..a0e7cdb3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3452,6 +3452,12 @@ } } }, + "@types/sizzle": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz", + "integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==", + "dev": true + }, "@webassemblyjs/ast": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", @@ -6492,13 +6498,14 @@ "dev": true }, "cypress": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.4.1.tgz", - "integrity": "sha512-1HBS7t9XXzkt6QHbwfirWYty8vzxNMawGj1yI+Fu6C3/VZJ8UtUngMW6layqwYZzLTZV8tiDpdCNBypn78V4Dg==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.6.1.tgz", + "integrity": "sha512-6n0oqENdz/oQ7EJ6IgESNb2M7Bo/70qX9jSJsAziJTC3kICfEMmJUlrAnP9bn+ut24MlXQST5nRXhUP5nRIx6A==", "dev": true, "requires": { "@cypress/listr-verbose-renderer": "0.4.1", "@cypress/xvfb": "1.2.4", + "@types/sizzle": "2.3.2", "arch": "2.1.1", "bluebird": "3.5.0", "cachedir": "1.3.0", @@ -6525,6 +6532,7 @@ "request-progress": "3.0.0", "supports-color": "5.5.0", "tmp": "0.1.0", + "untildify": "3.0.3", "url": "0.11.0", "yauzl": "2.10.0" }, @@ -20295,6 +20303,12 @@ } } }, + "untildify": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", + "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", + "dev": true + }, "upath": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", diff --git a/package.json b/package.json index efebc086a..3614b115c 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "@types/react-select": "^1.3.4", "babel-loader": "^8.0.6", "css-loader": "^3.2.0", - "cypress": "^3.4.1", + "cypress": "^3.6.1", "d3-format": "^1.4.1", "es-check": "^5.0.0", "fast-isnumeric": "^1.1.3", From 4127bd911feb9cdbff70e2d611c6363bc5c3ee8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 12 Nov 2019 17:05:39 -0500 Subject: [PATCH 33/45] old cypress for standalone --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d1c21c49f..c5e8706c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -74,7 +74,10 @@ jobs: - run: name: Run tests - command: npm run test.standalone + command: | + rm -rf node_modules/cypress + npm i cypress@3.4.1 + npm run test.standalone "unit-test": From aaf950b68990402499a4a39e0cb5bcf002cec810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 12 Nov 2019 17:15:47 -0500 Subject: [PATCH 34/45] legacy standalone all the way --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c5e8706c1..f10a9a705 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,7 +51,7 @@ jobs: "standalone-test": docker: - - image: circleci/python:3.6-node-browsers + - image: circleci/python:3.6.7-node-browsers - image: cypress/base:10 steps: From 62891430e1cbfbaeb8ac7d63c0b3a67f5d923382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 12 Nov 2019 17:31:01 -0500 Subject: [PATCH 35/45] update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d527f173..c0b1ca499 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] +### Fixes +- [#637](https://github.com/plotly/dash-table/pull/637) Fix multiple issues + - Fix IE11 compatibility issues and add ES5 compatibility and validation + - Fix a bug with `loading_state` being handled incorrectly, causing the table to steal focus + ## [4.5.0] - 2019-10-29 ### Changed - [#554](https://github.com/plotly/dash-table/pull/554) Async loading of `xlsx` library on export From 28c73dd0f967b7a5ed23092a95a4f7509567d307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 12 Nov 2019 17:59:59 -0500 Subject: [PATCH 36/45] use dash from 1003-dash-ie11 --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f10a9a705..5f8c41bd7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,7 +31,7 @@ jobs: python -m venv venv || virtualenv venv . venv/bin/activate pip install -r dev-requirements.txt --quiet - git clone --depth 1 git@github.com:plotly/dash.git dash-main + git clone --depth 1 -b 1003-dash-ie11 git@github.com:plotly/dash.git dash-main pip install -e ./dash-main[dev] --quiet - run: @@ -110,7 +110,7 @@ jobs: python -m venv venv || virtualenv venv . venv/bin/activate pip install -r dev-requirements.txt --quiet - git clone --depth 1 git@github.com:plotly/dash.git dash-main + git clone --depth 1 -b 1003-dash-ie11 git@github.com:plotly/dash.git dash-main pip install -e ./dash-main[dev] --quiet - run: @@ -215,7 +215,7 @@ jobs: name: Install dependencies (dash) command: | . venv/bin/activate - git clone --depth 1 git@github.com:plotly/dash.git dash-main + git clone --depth 1 -b 1003-dash-ie11 git@github.com:plotly/dash.git dash-main pip install -e ./dash-main[dev,testing] --quiet cd dash-main/dash-renderer && npm run build && pip install -e . && cd ../.. From ae4e680265444d59d5494f7728467f6d85f6fecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Wed, 13 Nov 2019 08:24:14 -0500 Subject: [PATCH 37/45] clean up applyFocus logic --- src/core/browser/DOM.ts | 8 ++++---- src/dash-table/components/Table/index.tsx | 21 +++++++++------------ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/core/browser/DOM.ts b/src/core/browser/DOM.ts index 85320145e..510ff0f92 100644 --- a/src/core/browser/DOM.ts +++ b/src/core/browser/DOM.ts @@ -1,8 +1,8 @@ export default class DOM { - public static getFirstParentOfType(element: HTMLElement, type: string): HTMLElement | undefined { + public static getFirstParentOfType(element: HTMLElement | undefined, type: string): HTMLElement | undefined { type = type.toUpperCase(); - let current: HTMLElement = element; + let current: HTMLElement | undefined = element; while (current) { if (current.tagName.toUpperCase() === type) { return current; @@ -16,8 +16,8 @@ export default class DOM { } } - public static getParentById(element: HTMLElement, id: string): HTMLElement | undefined { - let current: HTMLElement = element; + public static getParentById(element: HTMLElement | undefined, id: string): HTMLElement | undefined { + let current: HTMLElement | undefined = element; while (current) { if (current.id === id) { return current; diff --git a/src/dash-table/components/Table/index.tsx b/src/dash-table/components/Table/index.tsx index 0a5dca565..251d0139b 100644 --- a/src/dash-table/components/Table/index.tsx +++ b/src/dash-table/components/Table/index.tsx @@ -72,20 +72,17 @@ export default class Table extends Component Date: Wed, 13 Nov 2019 08:30:34 -0500 Subject: [PATCH 38/45] loading_state changes --- src/dash-table/components/Table/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dash-table/components/Table/index.tsx b/src/dash-table/components/Table/index.tsx index 251d0139b..927fd3386 100644 --- a/src/dash-table/components/Table/index.tsx +++ b/src/dash-table/components/Table/index.tsx @@ -73,7 +73,7 @@ export default class Table extends Component Date: Wed, 13 Nov 2019 08:46:22 -0500 Subject: [PATCH 39/45] alignment --- tests/cypress/tests/unit/exportUtils_tests.ts | 168 +++++++++++------- 1 file changed, 103 insertions(+), 65 deletions(-) diff --git a/tests/cypress/tests/unit/exportUtils_tests.ts b/tests/cypress/tests/unit/exportUtils_tests.ts index 2d5d03d92..5a44f623c 100644 --- a/tests/cypress/tests/unit/exportUtils_tests.ts +++ b/tests/cypress/tests/unit/exportUtils_tests.ts @@ -49,65 +49,81 @@ describe('export', () => { describe('getMergeRanges', () => { it('no merge', () => { - const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'b', 'c', 'd'], - ['a', 'b', 'c', 'd']]; + const testedArray = [ + ['a', 'b', 'c', 'd'], + ['a', 'b', 'c', 'd'], + ['a', 'b', 'c', 'd'] + ]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = []; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('duplicate values - no merge', () => { - const testedArray = [['a', 'b', 'c', 'a'], - ['a', 'b', 'c', 'a'], - ['a', 'b', 'c', 'a']]; + const testedArray = [ + ['a', 'b', 'c', 'a'], + ['a', 'b', 'c', 'a'], + ['a', 'b', 'c', 'a'] + ]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = []; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('merge 2 cells right with a different value in between', () => { - const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'b', 'a', 'a'], - ['a', 'b', 'c', 'd']]; + const testedArray = [ + ['a', 'b', 'c', 'd'], + ['a', 'b', 'a', 'a'], + ['a', 'b', 'c', 'd'] + ]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = [{ s: { r: 1, c: 2 }, e: { r: 1, c: 3 } }]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('merge 2 cells left with a different value in between', () => { - const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'a', 'b', 'a'], - ['a', 'b', 'c', 'd']]; + const testedArray = [ + ['a', 'b', 'c', 'd'], + ['a', 'a', 'b', 'a'], + ['a', 'b', 'c', 'd'] + ]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = [{ s: { r: 1, c: 0 }, e: { r: 1, c: 1 } }]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('2 cells merge', () => { - const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'a', 'c', 'd'], - ['a', 'b', 'c', 'd']]; + const testedArray = [ + ['a', 'b', 'c', 'd'], + ['a', 'a', 'c', 'd'], + ['a', 'b', 'c', 'd'] + ]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = [{ s: { r: 1, c: 0 }, e: { r: 1, c: 1 } }]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('3 cells merge', () => { - const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'a', 'a', 'd'], - ['a', 'b', 'c', 'd']]; + const testedArray = [ + ['a', 'b', 'c', 'd'], + ['a', 'a', 'a', 'd'], + ['a', 'b', 'c', 'd'] + ]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = [{ s: { r: 1, c: 0 }, e: { r: 1, c: 2 } }]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('4 cells merge', () => { - const testedArray = [['a', 'b', 'c', 'd'], - ['a', 'a', 'a', 'a'], - ['a', 'b', 'c', 'd']]; + const testedArray = [ + ['a', 'b', 'c', 'd'], + ['a', 'a', 'a', 'a'], + ['a', 'b', 'c', 'd'] + ]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = [{ s: { r: 1, c: 0 }, e: { r: 1, c: 3 } }]; expect(mergedRanges).to.deep.equal(expectedRanges); }); it('2 cells merge, 4 cells merge - same value', () => { - const testedArray = [['a', 'a', 'c', 'd'], - ['a', 'a', 'a', 'a'], - ['a', 'b', 'c', 'd']]; + const testedArray = [ + ['a', 'a', 'c', 'd'], + ['a', 'a', 'a', 'a'], + ['a', 'b', 'c', 'd'] + ]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = [ { s: { r: 0, c: 0 }, e: { r: 0, c: 1 } }, @@ -116,9 +132,11 @@ describe('export', () => { expect(mergedRanges).to.deep.equal(expectedRanges); }); it('2 cells merge, 4 cells merge, 3 cells merge - same value', () => { - const testedArray = [['a', 'a', 'c', 'd'], - ['a', 'a', 'a', 'a'], - ['a', 'a', 'a', 'd']]; + const testedArray = [ + ['a', 'a', 'c', 'd'], + ['a', 'a', 'a', 'a'], + ['a', 'a', 'a', 'd'] + ]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = [ { s: { r: 0, c: 0 }, e: { r: 0, c: 1 } }, @@ -128,9 +146,11 @@ describe('export', () => { expect(mergedRanges).to.deep.equal(expectedRanges); }); it('table with same value', () => { - const testedArray = [['a', 'a', 'a', 'a'], - ['a', 'a', 'a', 'a'], - ['a', 'a', 'a', 'a']]; + const testedArray = [ + ['a', 'a', 'a', 'a'], + ['a', 'a', 'a', 'a'], + ['a', 'a', 'a', 'a'] + ]; const mergedRanges = getMergeRanges(testedArray); const expectedRanges = [ { s: { r: 0, c: 0 }, e: { r: 0, c: 3 } }, @@ -143,63 +163,81 @@ describe('export', () => { describe('createHeadings ', () => { it('strings 2D array input with same length for inner array', () => { - const input = [['a', 'b', 'c'], - ['d', 'e', 'f'], - ['g', 'h', 'i']]; + const input = [ + ['a', 'b', 'c'], + ['d', 'e', 'f'], + ['g', 'h', 'i'] + ]; const headings = createHeadings(input, 3); - const expectHeadings = [['a', 'd', 'g'], - ['b', 'e', 'h'], - ['c', 'f', 'i']]; + const expectHeadings = [ + ['a', 'd', 'g'], + ['b', 'e', 'h'], + ['c', 'f', 'i'] + ]; expect(headings).to.deep.equal(expectHeadings); }); it('strings 2D array input with one different length for inner array', () => { - const input = [['a', 'b', 'c'], - ['d', 'e', 'f'], - ['g', 'h', 'i', 'j']]; + const input = [ + ['a', 'b', 'c'], + ['d', 'e', 'f'], + ['g', 'h', 'i', 'j'] + ]; const headings = createHeadings(input, 4); - const expectHeadings = [['a', 'd', 'g'], - ['b', 'e', 'h'], - ['c', 'f', 'i'], - ['', '', 'j']]; + const expectHeadings = [ + ['a', 'd', 'g'], + ['b', 'e', 'h'], + ['c', 'f', 'i'], + ['', '', 'j'] + ]; expect(headings).to.deep.equal(expectHeadings); }); it('strings 2D array input with multi different length for inner array', () => { - const input = [['a', 'b', 'c'], - ['d', 'e', 'f', '1'], - ['g', 'h', 'i', 'j', 'k']]; + const input = [ + ['a', 'b', 'c'], + ['d', 'e', 'f', '1'], + ['g', 'h', 'i', 'j', 'k'] + ]; const headings = createHeadings(input, 5); - const expectHeadings = [['a', 'd', 'g'], - ['b', 'e', 'h'], - ['c', 'f', 'i'], - ['', '1', 'j'], - ['', '', 'k']]; + const expectHeadings = [ + ['a', 'd', 'g'], + ['b', 'e', 'h'], + ['c', 'f', 'i'], + ['', '1', 'j'], + ['', '', 'k'] + ]; expect(headings).to.deep.equal(expectHeadings); }); it('strings and string[] array with same length for inner array', () => { - const input = ['rows', + const input = [ + 'rows', ['d', 'e', 'f'], - ['g', 'h', 'i']]; + ['g', 'h', 'i'] + ]; const headings = createHeadings(input, 3); - const expectHeadings = [['rows', 'd', 'g'], - ['rows', 'e', 'h'], - ['rows', 'f', 'i']]; + const expectHeadings = [ + ['rows', 'd', 'g'], + ['rows', 'e', 'h'], + ['rows', 'f', 'i'] + ]; expect(headings).to.deep.equal(expectHeadings); }); it('strings and string[] array with different length for inner array', () => { - const input = ['rows', + const input = [ + 'rows', ['d', 'e', 'f', 'g'], - ['g', 'h', 'i']]; + ['g', 'h', 'i'] + ]; const headings = createHeadings(input, 4); - const expectHeadings = [['rows', 'd', 'g'], - ['rows', 'e', 'h'], - ['rows', 'f', 'i'], - ['rows', 'g', '']]; + const expectHeadings = [ + ['rows', 'd', 'g'], + ['rows', 'e', 'h'], + ['rows', 'f', 'i'], + ['rows', 'g', ''] + ]; expect(headings).to.deep.equal(expectHeadings); }); it('strings array', () => { - const input = ['1', - '2', - '3']; + const input = ['1', '2', '3']; const headings = createHeadings(input, 1); const expectHeadings = [['1', '2', '3']]; expect(headings).to.deep.equal(expectHeadings); From eb268c061820288511b77f77417a79c1b1d56fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Wed, 13 Nov 2019 13:41:25 -0500 Subject: [PATCH 40/45] - additional tests to make sure the table neither loses or yanks focus on callback completion --- .../tests/server/loading_uneditable_test.ts | 44 ++++++++++++++----- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/tests/cypress/tests/server/loading_uneditable_test.ts b/tests/cypress/tests/server/loading_uneditable_test.ts index ecc166293..4efc90957 100644 --- a/tests/cypress/tests/server/loading_uneditable_test.ts +++ b/tests/cypress/tests/server/loading_uneditable_test.ts @@ -8,7 +8,7 @@ describe('loading states uneditable', () => { cy.visit('http://localhost:8084'); }); - it('does not permit editing when data are loading', () => { + it('prevents editing while loading', () => { // Table is editable DashTable .getCell(0, 0) @@ -22,34 +22,56 @@ describe('loading states uneditable', () => { // Table is not editable DashTable .getCell(0, 0, State.Loading) - .click() - .find('.dash-input-cell-value-container > input').should('have.length', 0); - - DOM.focused.type(`Hello${Key.Enter}`); - DashTable.getCell(1, 0, State.Any).click(); + .click(); + DOM.focused.type(`Hello`); DashTable .getCell(0, 0, State.Any) .within(() => cy.get('.dash-cell-value') - .should('not.have.html', 'Hello')); + .should('not.have.value', 'Hello')); cy.wait(5000); // Table is editable + DashTable.getCell(0, 0, State.Ready); + + DOM.focused.type(`Hello`); DashTable .getCell(0, 0) - .click() - .find('.dash-input-cell-value-container > input').should('have.length', 1); + .within(() => cy.get('.dash-cell-value') + .should('have.value', 'Hello')); + }); - DOM.focused.type(`Hello${Key.Enter}`); - DashTable.getCell(1, 0).click(); + it('keeps focus on callback completion', () => { + cy.get('#change-data-property').click(); + DOM.focused.type(`change_data${Key.Enter}`); + + DashTable.getCell(0, 0, State.Loading).click(); + cy.wait(5000); + DashTable.getCell(0, 0, State.Ready); + DOM.focused.type(`Hello${Key.Enter}`); DashTable .getCell(0, 0) .within(() => cy.get('.dash-cell-value') .should('have.html', 'Hello')); }); + it('does not steal focus on callback completion', () => { + DashTable.getCell(0, 0, State.Ready).click(); + + cy.get('#change-data-property').click(); + DOM.focused.type(`change_data${Key.Enter}`); + + DashTable.getCell(0, 0, State.Loading); + DOM.focused.should('have.id', 'change-data-property'); + + cy.wait(5000); + + DashTable.getCell(0, 0, State.Ready); + DOM.focused.should('have.id', 'change-data-property'); + }); + it('permits editing when a non-data prop is being changed', () => { // Table is editable DashTable From 66c7294ebc8477c1cf304d741432c8aedcd6eff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Wed, 13 Nov 2019 14:32:47 -0500 Subject: [PATCH 41/45] revert test change // fails in cypress 3.6.1 --- .../tests/server/loading_uneditable_test.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/cypress/tests/server/loading_uneditable_test.ts b/tests/cypress/tests/server/loading_uneditable_test.ts index 4efc90957..2f9a918da 100644 --- a/tests/cypress/tests/server/loading_uneditable_test.ts +++ b/tests/cypress/tests/server/loading_uneditable_test.ts @@ -8,7 +8,7 @@ describe('loading states uneditable', () => { cy.visit('http://localhost:8084'); }); - it('prevents editing while loading', () => { + it.only('prevents editing while loading', () => { // Table is editable DashTable .getCell(0, 0) @@ -22,24 +22,29 @@ describe('loading states uneditable', () => { // Table is not editable DashTable .getCell(0, 0, State.Loading) - .click(); + .click() + .find('.dash-input-cell-value-container > input').should('have.length', 0); - DOM.focused.type(`Hello`); DashTable .getCell(0, 0, State.Any) - .within(() => cy.get('.dash-cell-value') - .should('not.have.value', 'Hello')); + .within(() => cy.get('.dash-cell-value').should('not.have.html', 'Hello')); + + cy.get('#change-data-property').should('have.value', 'change_data'); cy.wait(5000); // Table is editable - DashTable.getCell(0, 0, State.Ready); + DashTable + .getCell(0, 0, State.Ready) + .click() + .find('.dash-input-cell-value-container > input').should('have.length', 1); + + DOM.focused.type(`Hello${Key.Enter}`); - DOM.focused.type(`Hello`); DashTable .getCell(0, 0) .within(() => cy.get('.dash-cell-value') - .should('have.value', 'Hello')); + .should('have.html', 'Hello')); }); it('keeps focus on callback completion', () => { From 1e4d14071fb374f312c9586b83fbd39d425c956e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Wed, 13 Nov 2019 14:33:53 -0500 Subject: [PATCH 42/45] it.only --- tests/cypress/tests/server/loading_uneditable_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/tests/server/loading_uneditable_test.ts b/tests/cypress/tests/server/loading_uneditable_test.ts index 2f9a918da..494dba2f8 100644 --- a/tests/cypress/tests/server/loading_uneditable_test.ts +++ b/tests/cypress/tests/server/loading_uneditable_test.ts @@ -8,7 +8,7 @@ describe('loading states uneditable', () => { cy.visit('http://localhost:8084'); }); - it.only('prevents editing while loading', () => { + it('prevents editing while loading', () => { // Table is editable DashTable .getCell(0, 0) From d16c8780ba43016d6482d2a9ca058e98a20c77bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Wed, 13 Nov 2019 15:36:48 -0500 Subject: [PATCH 43/45] babel-plugin-transform-regenerator --- .storybook/babel.config.js | 6 +++++- package-lock.json | 6 +++--- package.json | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.storybook/babel.config.js b/.storybook/babel.config.js index fd1727561..1befb89e6 100644 --- a/.storybook/babel.config.js +++ b/.storybook/babel.config.js @@ -6,4 +6,8 @@ const presets = [ '@babel/preset-react' ]; -module.exports = { presets }; +const plugins = [ + '@babel/plugin-transform-regenerator' +]; + +module.exports = { presets, plugins }; diff --git a/package-lock.json b/package-lock.json index a0e7cdb3a..bfb777da7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1256,9 +1256,9 @@ } }, "@babel/plugin-transform-regenerator": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz", - "integrity": "sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.0.tgz", + "integrity": "sha512-AXmvnC+0wuj/cFkkS/HFHIojxH3ffSXE+ttulrqWjZZRaUOonfJc60e1wSNT4rV8tIunvu/R3wCp71/tLAa9xg==", "dev": true, "requires": { "regenerator-transform": "^0.14.0" diff --git a/package.json b/package.json index 3614b115c..7c0d257cd 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "@babel/cli": "^7.6.2", "@babel/core": "^7.6.2", "@babel/plugin-syntax-dynamic-import": "^7.2.0", + "@babel/plugin-transform-regenerator": "^7.7.0", "@babel/polyfill": "^7.7.0", "@babel/preset-env": "^7.6.2", "@babel/preset-react": "^7.0.0", @@ -127,4 +128,4 @@ "node": ">=8.11.0", "npm": ">=6.1.0" } -} \ No newline at end of file +} From 145db8d9ba354bc0433483147feeb02fb22062ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 14 Nov 2019 10:00:09 -0500 Subject: [PATCH 44/45] undo -b 1003-dash-ie11 --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f8c41bd7..f10a9a705 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,7 +31,7 @@ jobs: python -m venv venv || virtualenv venv . venv/bin/activate pip install -r dev-requirements.txt --quiet - git clone --depth 1 -b 1003-dash-ie11 git@github.com:plotly/dash.git dash-main + git clone --depth 1 git@github.com:plotly/dash.git dash-main pip install -e ./dash-main[dev] --quiet - run: @@ -110,7 +110,7 @@ jobs: python -m venv venv || virtualenv venv . venv/bin/activate pip install -r dev-requirements.txt --quiet - git clone --depth 1 -b 1003-dash-ie11 git@github.com:plotly/dash.git dash-main + git clone --depth 1 git@github.com:plotly/dash.git dash-main pip install -e ./dash-main[dev] --quiet - run: @@ -215,7 +215,7 @@ jobs: name: Install dependencies (dash) command: | . venv/bin/activate - git clone --depth 1 -b 1003-dash-ie11 git@github.com:plotly/dash.git dash-main + git clone --depth 1 git@github.com:plotly/dash.git dash-main pip install -e ./dash-main[dev,testing] --quiet cd dash-main/dash-renderer && npm run build && pip install -e . && cd ../.. From eff508d19eb6199112f4bd3c7f3d21309d0820f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 14 Nov 2019 10:11:44 -0500 Subject: [PATCH 45/45] build.watch, babel polyfills --- demo/App.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demo/App.tsx b/demo/App.tsx index 6a7ce3121..843638280 100644 --- a/demo/App.tsx +++ b/demo/App.tsx @@ -1,6 +1,7 @@ /* eslint no-magic-numbers: 0 */ +import '@babel/polyfill/noConflict'; import * as R from 'ramda'; -import React, {Component} from 'react'; +import React, { Component } from 'react'; import { DataTable } from 'dash-table/index'; import Environment from 'core/environment'; import { memoizeOne } from 'core/memoizer';