From 64f88e7df50ce422eda03d32c1c4940c6e0bcd71 Mon Sep 17 00:00:00 2001 From: archmoj Date: Fri, 15 Jan 2021 15:59:18 -0500 Subject: [PATCH 1/2] add strict bundle which includes everything that - does not depend on function constructors --- dist/plotly-strict.js | 6 ++++ dist/plotly-strict.min.js | 6 ++++ lib/index-strict.js | 72 +++++++++++++++++++++++++++++++++++++++ tasks/stats.js | 2 ++ tasks/util/constants.js | 2 +- 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 dist/plotly-strict.js create mode 100644 dist/plotly-strict.min.js create mode 100644 lib/index-strict.js diff --git a/dist/plotly-strict.js b/dist/plotly-strict.js new file mode 100644 index 00000000000..1efa6297113 --- /dev/null +++ b/dist/plotly-strict.js @@ -0,0 +1,6 @@ +/** +* plotly.js (strict) v2.0.0 +* Copyright 2012-2021, Plotly, Inc. +* All rights reserved. +* Licensed under the MIT license +*/ diff --git a/dist/plotly-strict.min.js b/dist/plotly-strict.min.js new file mode 100644 index 00000000000..1efa6297113 --- /dev/null +++ b/dist/plotly-strict.min.js @@ -0,0 +1,6 @@ +/** +* plotly.js (strict) v2.0.0 +* Copyright 2012-2021, Plotly, Inc. +* All rights reserved. +* Licensed under the MIT license +*/ diff --git a/lib/index-strict.js b/lib/index-strict.js new file mode 100644 index 00000000000..6648652f7bb --- /dev/null +++ b/lib/index-strict.js @@ -0,0 +1,72 @@ +/** +* Copyright 2012-2021, Plotly, Inc. +* All rights reserved. +* +* This source code is licensed under the MIT license found in the +* LICENSE file in the root directory of this source tree. +*/ + +'use strict'; + +var Plotly = require('./core'); + +// traces +Plotly.register([ + require('./bar'), + require('./box'), + require('./heatmap'), + require('./histogram'), + require('./histogram2d'), + require('./histogram2dcontour'), + require('./contour'), + require('./scatterternary'), + require('./violin'), + require('./funnel'), + require('./waterfall'), + require('./image'), + + require('./pie'), + require('./sunburst'), + require('./treemap'), + require('./funnelarea'), + + require('./scattergeo'), + require('./choropleth'), + + require('./parcoords'), + require('./parcats'), + + require('./scattermapbox'), + require('./choroplethmapbox'), + require('./densitymapbox'), + + require('./sankey'), + require('./indicator'), + + require('./table'), + + require('./carpet'), + require('./scattercarpet'), + require('./contourcarpet'), + + require('./ohlc'), + require('./candlestick'), + + require('./scatterpolar'), + require('./barpolar') +]); + +// transforms +Plotly.register([ + require('./aggregate'), + require('./filter'), + require('./groupby'), + require('./sort') +]); + +// components +Plotly.register([ + require('./calendars') +]); + +module.exports = Plotly; diff --git a/tasks/stats.js b/tasks/stats.js index dbb535bebe0..34c57be02e9 100644 --- a/tasks/stats.js +++ b/tasks/stats.js @@ -136,6 +136,8 @@ function getMainBundleInfo() { 'Starting in `v1.39.0`, each plotly.js partial bundle has a corresponding npm package with no dependencies.', '', 'Starting in `v1.50.0`, the minified version of each partial bundle is also published to npm in a separate "dist min" package.', + '', + 'Starting in `v2.0.0`, the strict partial bundle includes everything except the traces that require function constructor.', '' ]; } diff --git a/tasks/util/constants.js b/tasks/util/constants.js index 9180c8406f5..cd6f968bfa2 100644 --- a/tasks/util/constants.js +++ b/tasks/util/constants.js @@ -25,7 +25,7 @@ try { } var partialBundleNames = [ - 'basic', 'cartesian', 'geo', 'gl3d', 'gl2d', 'mapbox', 'finance' + 'basic', 'cartesian', 'geo', 'gl3d', 'gl2d', 'mapbox', 'finance', 'strict' ]; var partialBundlePaths = partialBundleNames.map(function(name) { From c0a3d92aacc804b927844b956fc38122f16ea538 Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 19 Jan 2021 13:18:36 -0500 Subject: [PATCH 2/2] update strict bundle info --- tasks/stats.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/stats.js b/tasks/stats.js index 34c57be02e9..8310b515533 100644 --- a/tasks/stats.js +++ b/tasks/stats.js @@ -137,7 +137,9 @@ function getMainBundleInfo() { '', 'Starting in `v1.50.0`, the minified version of each partial bundle is also published to npm in a separate "dist min" package.', '', - 'Starting in `v2.0.0`, the strict partial bundle includes everything except the traces that require function constructor.', + 'Starting in `v2.0.0`, the strict partial bundle includes everything except the traces that require function constructors.', + 'Over time we hope to include more of the remaining trace types here, after which we intend to work on other strict CSP issues ', + 'such as inline CSS that we may not be able to include in the main bundle.', '' ]; }