Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f94aa45

Browse files
committed
strict no longer a partial bundle - generate at build step
1 parent 867c98b commit f94aa45

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"use-draftlogs": "node tasks/use_draftlogs.js",
3333
"empty-draftlogs": "node tasks/empty_draftlogs.js",
3434
"empty-dist": "node tasks/empty_dist.js",
35-
"build": "npm run empty-dist && npm run preprocess && npm run find-strings && npm run bundle && npm run extra-bundles basic && npm run extra-bundles cartesian && npm run extra-bundles geo && npm run extra-bundles gl2d && npm run extra-bundles gl3d && npm run extra-bundles mapbox && npm run extra-bundles finance && npm run extra-bundles strict && npm run locales && npm run schema dist && npm run stats",
35+
"build": "npm run empty-dist && npm run preprocess && npm run find-strings && npm run bundle && npm run extra-bundles basic && npm run extra-bundles cartesian && npm run extra-bundles geo && npm run extra-bundles gl2d && npm run extra-bundles gl3d && npm run extra-bundles mapbox && npm run extra-bundles finance && npm run locales && npm run schema dist && npm run stats",
3636
"regl-codegen": "node devtools/regl_codegen/server.js",
3737
"cibuild": "npm run empty-dist && npm run preprocess && node tasks/cibundle.js",
3838
"watch": "node tasks/watch.js",

tasks/bundle.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ var pathToPlotlyDist = constants.pathToPlotlyDist;
1010
var pathToPlotlyIndex = constants.pathToPlotlyIndex;
1111
var pathToPlotlyDistMin = constants.pathToPlotlyDistMin;
1212
var pathToPlotlyDistWithMeta = constants.pathToPlotlyDistWithMeta;
13+
14+
var pathToPlotlyStrict = constants.pathToPlotlyStrict;
15+
var pathToPlotlyStrictDist = constants.pathToPlotlyStrictDist;
16+
var pathToPlotlyStrictDistMin = constants.pathToPlotlyStrictDistMin;
17+
1318
var pathToPlotlyGeoAssetsSrc = constants.pathToPlotlyGeoAssetsSrc;
1419
var pathToPlotlyGeoAssetsDist = constants.pathToPlotlyGeoAssetsDist;
1520

@@ -39,6 +44,19 @@ tasks.push(function(done) {
3944
});
4045
});
4146

47+
// Browserify plotly.js-strict
48+
tasks.push(function(done) {
49+
_bundle(pathToPlotlyStrict, pathToPlotlyStrictDist, {
50+
standalone: 'Plotly',
51+
pathToMinBundle: pathToPlotlyStrictDistMin
52+
}, function() {
53+
prependFile(pathToPlotlyStrictDist, header, common.throwOnError);
54+
prependFile(pathToPlotlyStrictDistMin, header, common.throwOnError);
55+
56+
done();
57+
});
58+
});
59+
4260
// Browserify the geo assets
4361
tasks.push(function(done) {
4462
_bundle(pathToPlotlyGeoAssetsSrc, pathToPlotlyGeoAssetsDist, {

tasks/stats.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function getMainBundleInfo() {
123123
'> The minified version of each partial bundle is also published to npm in a separate "dist-min" package.',
124124
'',
125125
[
126-
'> The strict partial bundle includes everything except the traces that require function constructors.',
126+
'> The strict partial bundle now includes all traces, noting that for regl-based traces the functions are provided inside the bundle.',
127127
'Over time we hope to include more of the remaining trace types here, after which we intend to work on other strict CSP issues',
128128
'such as inline CSS that we may not be able to include in the main bundle.',
129129
].join(' '),

tasks/util/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ module.exports = {
200200
pathToPlotlyDist: path.join(pathToDist, 'plotly.js'),
201201
pathToPlotlyDistMin: path.join(pathToDist, 'plotly.min.js'),
202202
pathToPlotlyDistWithMeta: path.join(pathToDist, 'plotly-with-meta.js'),
203+
pathToPlotlyStrictDist: path.join(pathToDist, 'plotly-strict.js'),
204+
pathToPlotlyStrictDistMin: path.join(pathToDist, 'plotly-strict.min.js'),
203205

204206
pathToSchemaDiff: path.join(pathToTest, 'plot-schema.json'),
205207
pathToSchemaDist: path.join(pathToDist, 'plot-schema.json'),

0 commit comments

Comments
 (0)