diff --git a/devtools/test_dashboard/index-strict.html b/devtools/test_dashboard/index-strict.html new file mode 100644 index 00000000000..8319eea4a41 --- /dev/null +++ b/devtools/test_dashboard/index-strict.html @@ -0,0 +1,28 @@ + + + + + Plotly.js "strict" Devtools + + + + + +
+ + + + +
+ +
+
+
+
+
+ + + + + + diff --git a/devtools/test_dashboard/server.js b/devtools/test_dashboard/server.js index 81fd1f4b0a4..eb3bbb59e04 100644 --- a/devtools/test_dashboard/server.js +++ b/devtools/test_dashboard/server.js @@ -4,13 +4,15 @@ var http = require('http'); var ecstatic = require('ecstatic'); var open = require('open'); var browserify = require('browserify'); +var minimist = require('minimist'); var constants = require('../../tasks/util/constants'); var makeWatchifiedBundle = require('../../tasks/util/watchified_bundle'); var shortcutPaths = require('../../tasks/util/shortcut_paths'); -var PORT = process.argv[2] || 3000; - +var args = minimist(process.argv.slice(2), {}); +var PORT = args.port || 3000; +var strict = args.strict; // Create server var server = http.createServer(ecstatic({ @@ -21,9 +23,9 @@ var server = http.createServer(ecstatic({ })); // Make watchified bundle for plotly.js -var bundlePlotly = makeWatchifiedBundle(function() { +var bundlePlotly = makeWatchifiedBundle(strict, function() { // open up browser window on first bundle callback - open('http://localhost:' + PORT + '/devtools/test_dashboard/index.html'); + open('http://localhost:' + PORT + '/devtools/test_dashboard/index' + (strict ? '-strict' : '') + '.html'); }); // Bundle devtools code diff --git a/draftlogs/5865_fix.md b/draftlogs/5865_fix.md new file mode 100644 index 00000000000..f7fb29ea9b3 --- /dev/null +++ b/draftlogs/5865_fix.md @@ -0,0 +1 @@ + - Do not include `parcoords`, `splom`, `scattergl` and `scatterpolargl` in the "strict" bundle [[#5865](https://github.com/plotly/plotly.js/pull/5865)] diff --git a/lib/index-strict.js b/lib/index-strict.js index e57d825d435..487175d0789 100644 --- a/lib/index-strict.js +++ b/lib/index-strict.js @@ -23,9 +23,6 @@ Plotly.register([ require('./funnelarea'), require('./scattergeo'), require('./choropleth'), - require('./scattergl'), - require('./splom'), - require('./parcoords'), require('./parcats'), require('./scattermapbox'), require('./choroplethmapbox'), @@ -39,7 +36,6 @@ Plotly.register([ require('./ohlc'), require('./candlestick'), require('./scatterpolar'), - require('./scatterpolargl'), require('./barpolar'), // transforms diff --git a/package.json b/package.json index 1521f8e6ff3..4978e5455b2 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "test-requirejs": "node tasks/test_requirejs.js", "test-plain-obj": "node tasks/test_plain_obj.js", "test": "npm run test-jasmine -- --nowatch && npm run test-bundle && npm run test-image && npm run test-export && npm run test-syntax && npm run lint", + "strict": "node devtools/test_dashboard/server.js --strict", "start": "node devtools/test_dashboard/server.js", "baseline": "node test/image/make_baseline.js", "noci-baseline": "npm run cibuild && ./tasks/noci_test.sh image && git checkout dist && echo 'Please do not commit unless the change was expected!'", diff --git a/tasks/util/constants.js b/tasks/util/constants.js index f2ac0550618..68a2d79a559 100644 --- a/tasks/util/constants.js +++ b/tasks/util/constants.js @@ -17,6 +17,7 @@ function startsWithLowerCase(v) { } var pathToPlotlyIndex = path.join(pathToLib, 'index.js'); +var pathToPlotlyStrict = path.join(pathToLib, 'index-strict.js'); var mainIndex = fs.readFileSync(pathToPlotlyIndex, 'utf-8'); var allTraces = fs.readdirSync(path.join(pathToSrc, 'traces')) .filter(startsWithLowerCase); @@ -128,18 +129,14 @@ var partialBundleTraces = { 'indicator', 'ohlc', 'parcats', - 'parcoords', 'pie', 'sankey', 'scatter', 'scattercarpet', 'scattergeo', - 'scattergl', 'scattermapbox', 'scatterpolar', - 'scatterpolargl', 'scatterternary', - 'splom', 'sunburst', 'table', 'treemap', @@ -179,6 +176,7 @@ module.exports = { allTraces: allTraces, mainIndex: mainIndex, pathToPlotlyIndex: pathToPlotlyIndex, + pathToPlotlyStrict: pathToPlotlyStrict, pathToPlotlyCore: path.join(pathToSrc, 'core.js'), pathToPlotlyVersion: path.join(pathToSrc, 'version.js'), pathToPlotlyBuild: path.join(pathToBuild, 'plotly.js'), diff --git a/tasks/util/watchified_bundle.js b/tasks/util/watchified_bundle.js index f57dfa23326..d9652bf2ce9 100644 --- a/tasks/util/watchified_bundle.js +++ b/tasks/util/watchified_bundle.js @@ -17,8 +17,8 @@ var common = require('./common'); * @param {function} onFirstBundleCallback executed when first bundle is completed * */ -module.exports = function makeWatchifiedBundle(onFirstBundleCallback) { - var b = browserify(constants.pathToPlotlyIndex, { +module.exports = function makeWatchifiedBundle(strict, onFirstBundleCallback) { + var b = browserify(strict ? constants.pathToPlotlyStrict : constants.pathToPlotlyIndex, { debug: true, standalone: 'Plotly', ignoreTransform: './tasks/compress_attributes.js', diff --git a/tasks/watch.js b/tasks/watch.js index 784ac7d7cbf..c89da5394c5 100644 --- a/tasks/watch.js +++ b/tasks/watch.js @@ -2,5 +2,5 @@ var makeWatchifiedBundle = require('./util/watchified_bundle'); var noop = function() {}; // make a watchified bundle for plotly.js and run it! -var watchifiedBundle = makeWatchifiedBundle(noop); +var watchifiedBundle = makeWatchifiedBundle(false, noop); watchifiedBundle();