Skip to content

Commit c07a8e0

Browse files
authored
Merge pull request #5697 from plotly/res5692-no-longer-latest-cdn
No longer publish or overwrite any "latest" bundles on CDN
2 parents 4759b7e + 1f2ff1f commit c07a8e0

File tree

3 files changed

+12
-32
lines changed

3 files changed

+12
-32
lines changed

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,25 @@ var Plotly = require('plotly.js-dist')
4646

4747
### Use the plotly.js CDN hosted by Fastly
4848

49+
#### A minified plotly.js X.Y.Z release
4950
```html
50-
<!-- Latest compiled and minified plotly.js JavaScript -->
51-
<script src="https://cdn.plot.ly/plotly-latest.min.js" charset="utf-8"></script>
52-
53-
<!-- OR use a specific plotly.js release (e.g. version 1.52.3) -->
54-
<script src="https://cdn.plot.ly/plotly-1.52.3.min.js" charset="utf-8"></script>
51+
<script src="https://cdn.plot.ly/plotly-1.58.4.min.js" charset="utf-8"></script>
52+
```
5553

56-
<!-- OR an un-minified version is also available -->
57-
<script src="https://cdn.plot.ly/plotly-latest.js" charset="utf-8"></script>
54+
#### An un-minified version is also available
55+
```html
56+
<script src="https://cdn.plot.ly/plotly-1.58.4.js" charset="utf-8"></script>
5857
```
5958

6059
and use the `Plotly` object in the window scope.
6160

61+
##### Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.4. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.
62+
6263
Fastly supports Plotly.js with free CDN service. Read more at <https://www.fastly.com/open-source>
6364

64-
### Download the latest release
65+
### Download the latest release or a release candidate (rc)
6566

66-
[Latest Release on GitHub](https://github.com/plotly/plotly.js/releases/)
67+
[Latest and rc releases on GitHub](https://github.com/plotly/plotly.js/releases/)
6768

6869
and use the plotly.js `dist` file(s). More info [here](https://github.com/plotly/plotly.js/blob/master/dist/README.md).
6970

tasks/cdn_publish.sh

-14
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@ fi
88

99
# get plotly.js version from its package json
1010
version=$(node -e "console.log(require('./package.json').version);")
11-
major=$(node -e "console.log(require('./package.json').version.split('.')[0]);")
12-
13-
# read tag either latest or rc
14-
baseTag=$(node -e "var rc = require('./package.json').version.split('-')[1]; console.log(rc ? rc.split('.')[0] : 'latest');")
15-
16-
# if not v1 add major version to the tag e.g. latest-v2
17-
tag=$baseTag
18-
if [ $major -ne 1 ]; then tag=$tag-v$major; fi
19-
echo $tag
20-
2111
dist=dist
2212
sync=build/sync
2313

@@ -36,10 +26,6 @@ for path in `ls $dist/plotly*`; do
3626
fi
3727

3828
cp $path "$sync/${name}-${version}.$ext"
39-
40-
if [ $baseTag = "latest" ]; then
41-
cp $path "$sync/${name}-${tag}.$ext"
42-
fi
4329
done
4430

4531
# copy topojson files over to the sync folder

tasks/stats.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ var prettySize = require('prettysize');
77
var common = require('./util/common');
88
var constants = require('./util/constants');
99
var pkgVersion = require('../package.json').version;
10-
var majorVersion = pkgVersion.split('.')[0];
11-
var theLatest = 'latest' + (
12-
(majorVersion === '1') ? '' : ('-v' + majorVersion)
13-
);
1410

1511
var pathDistREADME = path.join(constants.pathToDist, 'README.md');
1612
var cdnRoot = 'https://cdn.plot.ly/plotly-';
@@ -81,7 +77,6 @@ function getInfoContent() {
8177
'Plotly.js defaults to US English (en-US) and includes British English (en) in the standard bundle.',
8278
'Many other localizations are available - here is an example using Swiss-German (de-CH),',
8379
'see the contents of this directory for the full list.',
84-
'They are also available on our CDN as ' + cdnRoot + 'locale-de-ch-' + theLatest + '.js OR ' + cdnRoot + 'locale-de-ch-' + pkgVersion + '.js',
8580
'Note that the file names are all lowercase, even though the region is uppercase when you apply a locale.',
8681
'',
8782
'*After* the plotly.js script tag, add:',
@@ -116,12 +111,12 @@ function getMainBundleInfo() {
116111
'',
117112
'It be can imported as minified javascript',
118113
'- using dist file `dist/plotly.min.js`',
119-
'- using CDN URL ' + cdnRoot + theLatest + MINJS + ' OR ' + cdnRoot + pkgVersion + MINJS,
114+
'- using CDN URL ' + cdnRoot + pkgVersion + MINJS,
120115
'',
121116
'or as raw javascript:',
122117
'- using the `plotly.js-dist` npm package (starting in `v1.39.0`)',
123118
'- using dist file `dist/plotly.js`',
124-
'- using CDN URL ' + cdnRoot + theLatest + JS + ' OR ' + cdnRoot + pkgVersion + JS,
119+
'- using CDN URL ' + cdnRoot + pkgVersion + JS,
125120
'- using CommonJS with `require(\'plotly.js\')`',
126121
'',
127122
'If you would like to have access to the attribute meta information ' +
@@ -192,8 +187,6 @@ function makeBundleInfo(pathObj) {
192187
'',
193188
'| Flavor | URL |',
194189
'| ------ | --- |',
195-
'| Latest | ' + cdnRoot + name + '-' + theLatest + JS + ' |',
196-
'| Latest minified | ' + cdnRoot + name + '-' + theLatest + MINJS + ' |',
197190
'| Tagged | ' + cdnRoot + name + '-' + pkgVersion + JS + ' |',
198191
'| Tagged minified | ' + cdnRoot + name + '-' + pkgVersion + MINJS + ' |',
199192
'',

0 commit comments

Comments
 (0)