Commit Graph

42 Commits

Author SHA1 Message Date
Dan Onoshko
8283ad5867
fix: move @kurkle/color to dependencies (#10917)
fixes #10915
2022-11-30 09:31:43 -05:00
Dan Onoshko
51441272a7
refactor: move to esm in sources (#10879) 2022-11-17 08:08:44 -05:00
Dan Onoshko
47cb9e1f76
feat: typescript node next support (#10661) 2022-09-14 06:44:57 -04:00
Dan Onoshko
2031cdf051
Preparing the project for TypeScript (#10595)
* Add Typescript to the build
* Converts the `helpers.core` to Typescript as an example
* Converts the `core.element` to Typescript
2022-08-22 11:58:57 -04:00
Dan Onoshko
3123a133fe
build: emit sourcemaps (#10568) 2022-08-07 13:23:35 -04:00
Jacco van den Berg
3df687a87c
Remove destroy hook (#10549)
* remove destroy hook

* revert package-lock.json changes

* update test

* add migration guide note

* fix karma failing test

* change way of importing package.json
2022-08-05 19:51:14 +03:00
Ben McCann
e798defcde
Use ESM config file for Rollup (#10564) 2022-08-05 08:00:01 -04:00
Dan Onoshko
ce375a6876
feat: add ESM support (#10525)
* feat: add ESM support

* build: rename UMD bundle

* chore: edit supbackages description

* style: disable es/no-import-meta linter rule

* test: dynamic import in cjs module

* docs: edit integrations page

* docs: review fixes

* chore: remove useless regex in webpack config

* ci: test size-limit only for ESM bundle
2022-08-04 18:43:26 -04:00
Dan Onoshko
a4de430d99
fix: treeshaking (#10504)
* fix: treeshaking
* refactor: DatasetController.datasetElementType and DatasetController.dataElementType as static props
2022-08-04 09:17:40 -04:00
Ben McCann
6feb48b5ef
Allow ESM files to be used in Node.js (#10479)
Allow ESM files to be used in Node.js
2022-07-30 11:25:23 -04:00
Josh Kelley
3671c01c26
Distribute types as is (#8720)
I had initially seen some oddities around type augmentation for type definitions in subdirectories of `types`, and using Rollup seemed to help with that. However, now that all of Chart.js's main types are directly under `types`, there seems to be no need for this.

This simplifies the build process, since it no longer needs to use rollup-plugin-dts.

It also improves some third-party tools. For example, I'm in the habit of using WebStorm's "Go To Declaration or Usages" hotkey with third-party TypeScript definitions as a quick way of getting more information about an API. With the Rollup-generate types, that works poorly; WebStorm goes to the imported-and-re-exported symbol within the barely-readable machine-generated dist/chart.esm.d.ts file, and I have to navigate two more hops to find the actual definitions.
2021-03-25 15:08:00 -04:00
Jukka Kurkela
1460477989
Add rollup-plugin-analyzer (#8690) 2021-03-21 17:07:09 -04:00
Jukka Kurkela
49b902aeab
Remove rollup-plugin-size (vulnerability) (#8624) 2021-03-13 08:03:45 -05:00
Jukka Kurkela
7c8ee6e77f
Add rollup-plugin-size and shave couple of bytes (#8618)
* Add rollup-plugin-size

* Shave couple of bytes
2021-03-11 16:20:54 -05:00
Jukka Kurkela
c96c167074
Update .editorconfig and fix conf indents (#8442) 2021-02-17 08:11:40 -05:00
Jukka Kurkela
910158055f
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
2020-11-16 21:01:33 +02:00
Samuel Gratzl
391e4b6f2e
flat helpers (#7806)
* generate a flat helpers package
* move helpers built files to dist
* upgrade docs for flat helpers
2020-09-28 09:11:55 -04:00
Jukka Kurkela
da33b1bb27
Fix shared option handling (#7731)
Fix shared option handling
2020-08-27 09:14:08 -04:00
Samuel Gratzl
4eeed6e876
WIP: TypeScript types (#7668)
First version of types
2020-08-04 16:52:57 -04:00
Jukka Kurkela
40e9029a59
ESM build, with helpers separated (#7400)
* ESM build, with helpers separated
* Remove umd environment
* Include the chunks in package
2020-06-23 19:02:51 -04:00
Jukka Kurkela
690d07ba9b
Update packages (#7463) 2020-06-04 19:51:34 -04:00
Jukka Kurkela
f472a3f9a7
Remove proposal and obsolete features (#7425) 2020-05-26 19:16:23 -04:00
Jukka Kurkela
986f72f933
Rename dist/Chart* to dist/chart* (#7416)
* Rename dist/Chart* to dist/chart*
* Add a note to migration docs
* Review update
2020-05-25 16:54:22 -04:00
Jukka Kurkela
319a6a40b9
Use @rollup/plugin-inject for ResizeObserver poly (#7360) 2020-05-15 17:17:59 -04:00
Jukka Kurkela
1228981e4f
Fix couple of small issues (#7268) 2020-04-13 19:33:15 -04:00
Ben McCann
7051410d4e
Only polyfill ResizeObserver for UMD builds (#7208) 2020-03-22 13:40:26 -04:00
Jukka Kurkela
df3c73cc5e
Give the boot to chartjs-adapter-moment (#7155)
Remove default of using chartjs-adapter-moment
2020-02-27 19:40:31 -05:00
Jukka Kurkela
564c027a1e
Output ES6 from babel (#7136) 2020-02-21 18:55:53 -05:00
Ben McCann
7b9a0a775c
Rollup plugins live in new location (#7134) 2020-02-20 18:19:59 -05:00
Jukka Kurkela
65425a5cb6
Include version in Chart (#7129)
* Include version in Chart
* Remove commonjs
2020-02-20 09:41:47 -05:00
Ben McCann
28e03946a1
No need to use rollup commonjs plugin (#7122) 2020-02-19 20:51:01 -05:00
Jukka Kurkela
bfe34214ac
Use ResizeObserver and MutationObserver to detect detach/attach/resize (#7104)
* Use Resize/MutationObserver to detect detach/attach/resize
* Cleanup
* Review update
* Restore infinite resize detection (#6011)
2020-02-17 11:00:03 -05:00
Evert Timberg
8245da44f5
Strip comments from ESM build otherwise the TS compiler breaks (#7102)
* Strip comments from ESM build otherwise the TS compiler breaks
* Cleanup no ESM build as well
2020-02-14 14:11:24 -05:00
Jukka Kurkela
7c1fb37c61
Babel @kurkle/color for IE support (#7099)
Babel @kurkle/color for IE support
2020-02-14 12:29:33 -05:00
Chris Lamb
c4483d1864 Make the build reproducible (#6817)
Whilst working on the Reproducible Builds effort [0] we noticed that
Chart.js could not be built reproducibly.

This is because it was embedding another build date in a "banner"
comment. This patch uses the value from SOURCE_DATE_EPOCH [1] if
present.

This was originally filed in Debian as #946333 [2].

 [0] https://reproducible-builds.org/
 [1] https://reproducible-builds.org/specs/source-date-epoch/
 [2] https://bugs.debian.org/946333

Signed-off-by: Chris Lamb <lamby@debian.org>
2019-12-07 10:41:56 -05:00
Ben McCann
dd8d267956 Remove bundled builds (#6680) 2019-11-02 15:48:49 -04:00
Sebastian Niemann
9537548321 Adds support for ES6 modules (#6619) 2019-10-27 18:28:25 -04:00
Evert Timberg
1ac3a697f7
Add babel plugin for rollup & transform code (#6555)
* Add babel plugin for rollup & transform code
* Add .browserlistrc file & copy defaults
2019-10-27 16:28:30 -04:00
Simon Brunel
35273ee948
Optimize the npm package by removing useless files (#6105)
Explicitly target files that should be included in the npm package, making it 10x smaller by removing the docs, samples, scripts, sources, tests and other useless files.
2019-03-03 15:19:11 +01:00
Simon Brunel
55128f74c1 Move CSS in a separate file to be CSP-compliant (#6048)
In order to be compatible with any CSP, we need to prevent the automatic creation of the DOM 'style' element and offer our CSS as a separate file that can be manually loaded (`Chart.js` or `Chart.min.js`). Users can now opt-out the style injection using `Chart.platform.disableCSSInjection = true` (note that the style sheet is now injected on the first chart creation).

To prevent duplicating and maintaining the same CSS code at different places, move all these rules in `platform.dom.css` and write a minimal rollup plugin to inject that style as string in `platform.dom.js`. Additionally, this plugin extract the imported style in `./dist/Chart.js` and `./dist/Chart.min.js`.
2019-02-08 19:06:04 +01:00
Simon Brunel
e07c5d0c6c
Make moment optional from our UMD builds (#5978) 2019-01-29 17:54:22 +01:00
Simon Brunel
2a97ec21c5
Migrate from Browserify to rollup (#5904)
Browserify isn't optimal bundling Chart.js because it adds too many internal wrappers, doesn't handle external/global dependencies and doesn't provide a way to generate ESM builds. Therefore, it seems the right choice to switch to rollup, so move all the build process in `rollup.config.js` and make Gulp to execute `rollup -c`.

We also had to switch to Terser instead of UglifyJS because this last one contains a breaking bug. Note that tests now use the exact same rollup config as our builds (the minified one) to ensure that the bundling and minification steps don't break anything. Finally, replace the `gulp watch` task by `gulp build --watch` to be consistent with the other `unittest` and `docs` watching syntax.
2018-12-14 20:20:43 +01:00