]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Remove moment from dependencies (#6745)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Fri, 15 Nov 2019 18:13:33 +0000 (10:13 -0800)
committerEvert Timberg <evert.timberg+github@gmail.com>
Fri, 15 Nov 2019 18:13:33 +0000 (13:13 -0500)
* Remove moment from dependencies
* Remove version number in docs

docs/axes/cartesian/time.md
docs/getting-started/integration.md
docs/getting-started/v3-migration.md
package-lock.json
package.json

index df51f00a111172c3f45022e7971d6b9e4339989c..faa89a9e796be125556367e94580fec869f6eb1e 100644 (file)
@@ -4,7 +4,7 @@ The time scale is used to display times and dates. When building its ticks, it w
 
 ## Date Adapters
 
-The time scale requires both a date library and corresponding adapter to be present. By default, Chart.js includes an adapter for Moment.js. You may wish to [exclude moment](../../getting-started/integration.md) and choose from [other available adapters](https://github.com/chartjs/awesome#adapters) instead.
+The time scale requires both a date library and corresponding adapter to be present. By default, Chart.js includes an adapter for Moment.js. You may wish to choose from [other available adapters](https://github.com/chartjs/awesome#adapters) instead.
 
 ## Data Sets
 
index e07a4c747831a1167590369550935106822058d2..83301191a32d984eee6fbc0ab84a3342d76afba8 100644 (file)
@@ -25,26 +25,6 @@ import Chart from 'chart.js';
 var myChart = new Chart(ctx, {...});
 ```
 
-**Note:** Moment.js is installed along Chart.js as dependency. If you don't want to use Moment.js (either because you use a different date adapter or simply because don't need time functionalities), you will have to configure your bundler to exclude this dependency (e.g. using [`externals` for Webpack](https://webpack.js.org/configuration/externals/) or [`external` for Rollup](https://rollupjs.org/guide/en#peer-dependencies)).
-
-```javascript
-// Webpack
-{
-    externals: {
-        moment: 'moment'
-    }
-}
-```
-
-```javascript
-// Rollup
-{
-    external: {
-        ['moment']
-    }
-}
-```
-
 ## Require JS
 
 **Important:** RequireJS [can **not** load CommonJS module as is](https://requirejs.org/docs/commonjs.html#intro), so be sure to require one of the UMD builds instead (i.e. `dist/Chart.js`, `dist/Chart.min.js`, etc.).
@@ -55,7 +35,7 @@ require(['path/to/chartjs/dist/Chart.min.js'], function(Chart){
 });
 ```
 
-**Note:** starting v2.8, Moment.js is an optional dependency for `Chart.js` and `Chart.min.js`. In order to use the time scale with Moment.js, you need to make sure Moment.js is fully loaded **before** requiring Chart.js. You can either use a shim:
+**Note:** in order to use the time scale, you need to make sure [one of the available date adapters](https://github.com/chartjs/awesome#adapters) and corresponding date library are fully loaded **before** requiring Chart.js. The date adapter for Moment.js is included with Chart.js, but you still need to include Moment.js itself if this is the date adapter you choose to use. You can either use a shim:
 
 ```javascript
 require.config({
index b16a3066b3d187dcf622aa1c98f6edbfb6068d37..d247f60c80daa5c7c42c44f521ac3bf927dc58f7 100644 (file)
@@ -2,11 +2,12 @@
 
 Chart.js 3.0 introduces a number of breaking changes. Chart.js 2.0 was released in April 2016. In the years since then, as Chart.js has grown in popularity and feature set, we've learned some lessons about how to better create a charting library. In order to improve performance, offer new features, and improve maintainability it was necessary to break backwards compatibility, but we aimed to do so only when necessary.
 
-## Setup
+## End user migration
 
-Chart.js is no longer providing the `Chart.bundle.js` and `Chart.bundle.min.js`. Please see the [installation](installation.md) and [integration](integration.md) docs for details on the recommended way to setup Chart.js if you were using these builds.
+### Setup and installation
 
-## End user migration
+* Chart.js is no longer providing the `Chart.bundle.js` and `Chart.bundle.min.js`. Please see the [installation](installation.md) and [integration](integration.md) docs for details on the recommended way to setup Chart.js if you were using these builds.
+* `moment` is no longer specified as an npm dependency. If you are using the time scale, you must include one of [the available adapters](https://github.com/chartjs/awesome#adapters) and corresponding date library. If you are using a date library other than moment, you no longer need to exclude moment from your build.
 
 ### Ticks
 
index 52b96edcea3072e90ac1a1ff6501a57a6f05ab13..842fca6971a794fbe22a307afd77559a1a6423b6 100644 (file)
     "moment": {
       "version": "2.24.0",
       "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
-      "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
+      "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==",
+      "dev": true
     },
     "ms": {
       "version": "2.1.2",
index 5a6f4eb1abd9341133c193f9eae14933f68f5640..5aa150628017693018f4f851d4be45361cbd6b2e 100644 (file)
@@ -61,6 +61,7 @@
     "karma-rollup-preprocessor": "^7.0.0",
     "karma-safari-private-launcher": "^1.0.0",
     "merge-stream": "^1.0.1",
+    "moment": "^2.10.2",
     "pixelmatch": "^5.0.0",
     "rollup": "^1.0.0",
     "rollup-plugin-babel": "^4.3.3",
@@ -71,7 +72,6 @@
     "yargs": "^14.0.0"
   },
   "dependencies": {
-    "chartjs-color": "^2.1.0",
-    "moment": "^2.10.2"
+    "chartjs-color": "^2.1.0"
   }
 }