From 2ea01d9beb41cd7e7800b89f8800e79f32078506 Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Mon, 3 Aug 2020 19:33:21 +0300 Subject: [PATCH] Include `Chart.defaults` always (#7686) --- src/core/core.controller.js | 11 +++-------- src/index.js | 2 -- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 35267d7b3..490c4029f 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -1170,16 +1170,11 @@ class Chart { } } -Chart.version = version; - -/** - * NOTE(SB) We actually don't use this container anymore but we need to keep it - * for backward compatibility. Though, it can still be useful for plugins that - * would need to work on multiple charts?! - */ +// These are available to both, UMD and ESM packages +Chart.defaults = defaults; Chart.instances = {}; - Chart.registry = registry; +Chart.version = version; // @ts-ignore const invalidatePlugins = () => each(Chart.instances, (chart) => chart._plugins.invalidate()); diff --git a/src/index.js b/src/index.js index d8b7abf27..ac3f0d39e 100644 --- a/src/index.js +++ b/src/index.js @@ -12,7 +12,6 @@ import animator from './core/core.animator'; import animationService from './core/core.animations'; import * as controllers from './controllers'; import DatasetController from './core/core.datasetController'; -import defaults from './core/core.defaults'; import Element from './core/core.element'; import * as elements from './elements/index'; import Interaction from './core/core.interaction'; @@ -35,7 +34,6 @@ Chart.animator = animator; Chart.animationService = animationService; Chart.controllers = registry.controllers.items; Chart.DatasetController = DatasetController; -Chart.defaults = defaults; Chart.Element = Element; Chart.elements = elements; Chart.Interaction = Interaction; -- 2.47.2