mirror of
https://github.com/chartjs/Chart.js
synced 2025-04-29 15:57:22 +08:00
Drop legacy browser support (#8009)
* Drop legacy browser support * Docs * Use rollup-plugin-istanbul for coverage * exclude node_modules from coverage * No cleanup() when doing coverage
This commit is contained in:
parent
988c865599
commit
910158055f
@ -1,4 +1,4 @@
|
||||
> 0.5%
|
||||
last 2 versions
|
||||
Firefox ESR
|
||||
not dead
|
||||
defaults
|
||||
not IE 11
|
||||
not IE_Mob 11
|
||||
maintained node versions
|
||||
|
@ -7,8 +7,6 @@ env:
|
||||
browser: true
|
||||
node: true
|
||||
|
||||
parser: babel-eslint
|
||||
|
||||
parserOptions:
|
||||
ecmaVersion: 7
|
||||
sourceType: module
|
||||
|
@ -1,19 +0,0 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env", {
|
||||
"loose": true
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": [
|
||||
"@babel/plugin-transform-object-assign"
|
||||
],
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": [
|
||||
"istanbul"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -22,13 +22,14 @@ Latest builds are available for testing at:
|
||||
|
||||
## Browser support
|
||||
|
||||
Chart.js offers support for the following browsers:
|
||||
All modern and up-to-date browsers are supported, including, but not limited to:
|
||||
|
||||
- Chrome 50+
|
||||
- Firefox 45+
|
||||
- Internet Explorer 11
|
||||
- Edge 14+
|
||||
- Safari 9+
|
||||
Chrome
|
||||
Edge
|
||||
Firefox
|
||||
Safari
|
||||
|
||||
As of version 3, we have dropped Internet Explorer 11 support.
|
||||
|
||||
Browser support for the canvas element is available in all modern & major mobile browsers. [CanIUse](https://caniuse.com/#feat=canvas)
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* eslint-disable import/no-commonjs */
|
||||
|
||||
const commonjs = require('@rollup/plugin-commonjs');
|
||||
const istanbul = require('rollup-plugin-istanbul');
|
||||
const json = require('@rollup/plugin-json');
|
||||
const resolve = require('@rollup/plugin-node-resolve').default;
|
||||
const builds = require('./rollup.config');
|
||||
const yargs = require('yargs');
|
||||
|
||||
|
||||
module.exports = function(karma) {
|
||||
const args = yargs
|
||||
.option('verbose', {default: false})
|
||||
@ -22,6 +22,14 @@ module.exports = function(karma) {
|
||||
const regex = karma.autoWatch ? /chart\.js$/ : /chart\.min\.js$/;
|
||||
const build = builds.filter(v => v.output.file && v.output.file.match(regex))[0];
|
||||
|
||||
if (args.coverage) {
|
||||
build.plugins = [
|
||||
json(),
|
||||
resolve(),
|
||||
istanbul({exclude: ['node_modules/**/*.js', 'package.json']})
|
||||
];
|
||||
}
|
||||
|
||||
karma.set({
|
||||
frameworks: ['jasmine'],
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
@ -101,11 +109,6 @@ module.exports = function(karma) {
|
||||
browserDisconnectTolerance: 3
|
||||
});
|
||||
|
||||
// https://swizec.com/blog/how-to-run-javascript-tests-in-chrome-on-travis/swizec/6647
|
||||
if (process.env.TRAVIS) {
|
||||
karma.customLaunchers.chrome.flags.push('--no-sandbox');
|
||||
}
|
||||
|
||||
if (args.coverage) {
|
||||
karma.reporters.push('coverage');
|
||||
karma.coverageReporter = {
|
||||
|
2241
package-lock.json
generated
2241
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -44,16 +44,11 @@
|
||||
"typedoc": "npx typedoc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.3",
|
||||
"@babel/plugin-transform-object-assign": "^7.12.1",
|
||||
"@babel/preset-env": "^7.12.1",
|
||||
"@kurkle/color": "^0.1.9",
|
||||
"@rollup/plugin-commonjs": "^16.0.0",
|
||||
"@rollup/plugin-inject": "^4.0.2",
|
||||
"@rollup/plugin-json": "^4.1.0",
|
||||
"@rollup/plugin-node-resolve": "^10.0.0",
|
||||
"babel-plugin-istanbul": "^6.0.0",
|
||||
"babel-preset-es2015-rollup": "^3.0.0",
|
||||
"chartjs-adapter-moment": "^0.1.2",
|
||||
"concurrently": "^5.3.0",
|
||||
"coveralls": "^3.1.0",
|
||||
@ -76,12 +71,10 @@
|
||||
"karma-safari-private-launcher": "^1.0.0",
|
||||
"moment": "^2.29.1",
|
||||
"pixelmatch": "^5.2.1",
|
||||
"promise-polyfill": "^8.2.0",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"rollup": "^2.33.1",
|
||||
"rollup-plugin-babel": "^4.4.0",
|
||||
"rollup-plugin-cleanup": "^3.2.1",
|
||||
"rollup-plugin-dts": "^1.4.13",
|
||||
"rollup-plugin-istanbul": "^2.0.1",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"typedoc": "^0.19.2",
|
||||
"typescript": "^4.0.5",
|
||||
|
@ -1,10 +1,8 @@
|
||||
/* eslint-disable import/no-commonjs */
|
||||
/* eslint-env es6 */
|
||||
|
||||
const babel = require('rollup-plugin-babel');
|
||||
const cleanup = require('rollup-plugin-cleanup');
|
||||
const dts = require('rollup-plugin-dts').default;
|
||||
const inject = require('@rollup/plugin-inject');
|
||||
const json = require('@rollup/plugin-json');
|
||||
const resolve = require('@rollup/plugin-node-resolve').default;
|
||||
const terser = require('rollup-plugin-terser').terser;
|
||||
@ -34,13 +32,8 @@ module.exports = [
|
||||
{
|
||||
input,
|
||||
plugins: [
|
||||
inject({
|
||||
ResizeObserver: 'resize-observer-polyfill',
|
||||
Promise: 'promise-polyfill'
|
||||
}),
|
||||
json(),
|
||||
resolve(),
|
||||
babel(),
|
||||
cleanup({
|
||||
sourcemap: true
|
||||
})
|
||||
@ -56,13 +49,8 @@ module.exports = [
|
||||
{
|
||||
input,
|
||||
plugins: [
|
||||
inject({
|
||||
ResizeObserver: 'resize-observer-polyfill',
|
||||
Promise: 'promise-polyfill'
|
||||
}),
|
||||
json(),
|
||||
resolve(),
|
||||
babel(),
|
||||
terser({
|
||||
output: {
|
||||
preamble: banner
|
||||
|
@ -345,10 +345,7 @@ export class Legend extends Element {
|
||||
ctx.lineWidth = lineWidth;
|
||||
ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);
|
||||
|
||||
if (ctx.setLineDash) {
|
||||
// IE 9 and 10 do not support line dash
|
||||
ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));
|
||||
}
|
||||
ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));
|
||||
|
||||
if (labelOpts && labelOpts.usePointStyle) {
|
||||
// Recalculate x and y for drawPoint() because its expecting
|
||||
|
Loading…
x
Reference in New Issue
Block a user