diff --git a/README.md b/README.md index 430bc94..aca20f0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ This project was originally created by Stephen Liberty and `excel-builder-vanill ### Comparison to other similar libraries -Excel-builder-vanilla is at the minimum 7-13x times smaller than the most popular libraries (we used `Bundlephobia` to compare), excel-builder-vanilla is 19Kb gzip while [XLSX](https://bundlephobia.com/package/xlsx) is 136Kb and [ExcelJS](https://bundlephobia.com/package/exceljs) is 251Kb gzip. The reason as to why it's much smaller is very simple and relates to these 2 major differences: +Excel-builder-vanilla is at the minimum 7-13x times smaller than the most popular libraries (we used `Bundlephobia` to compare), excel-builder-vanilla is 19Kb gzip while [XLSX](https://bundlephobia.com/package/xlsx) is 136Kb and [ExcelJS](https://bundlephobia.com/package/exceljs) is 251Kb gzip. The reason as to why it's much smaller is very simple and relates to these 2 major differences: - excel-builder-vanilla is ESM-Only (tree shakable) and all other libraries are still just offering CJS (CommonJS) which increases their download/install size (not tree shakable) - excel-builder-vanilla is only offering Excel export (writer) but without any reading capabilities making the project very lightweight @@ -43,12 +43,7 @@ You can also take a look at the "[Used by](#used-by)" section below to see real npm install excel-builder-vanilla ``` -The project offers 2 different build types, choose the best one depending on your use case -1. **ESM**: to `import from` (_**preferred**_) -2. **IIFE**: standalone script which provides `ExcelBuilder` on the `window` object - -> [!NOTE] -> ESM import is the preferred approach and IIFE might actually be removed in the future to lower download size even further. +The project is now only offered as an ESM Only build ```ts // ESM (preferred) - npm install @@ -57,7 +52,7 @@ import { createWorksheet } from 'excel-builder-vanilla'; // IIFE - CDN ``` @@ -110,6 +105,17 @@ The project now has only 1 small dependency which is [fflate](https://github.com This modernization provides a huge decrease in the final build size, with only 1 dependency, and also offers better performance 🚀 +## Major Changes + +### version 3.0 +- initial release (forked from original `excel-builder` library) + +### version 4.0 +- build as ESM-Only and drop CJS (CommonJS) build (aka `require()`) + +### version 5.0 +- drop the legacy IIFE build and the use of `window` object (typically used when loading as the legacy ` ``` diff --git a/packages/demo/src/examples/example-standalone-iife.html b/packages/demo/src/examples/example-standalone-iife.html deleted file mode 100644 index 6fe3c53..0000000 --- a/packages/demo/src/examples/example-standalone-iife.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - Standalone example 1: Basic Grid - - - -

Excel-Builder-Vanilla

-
Standalone JS (IIFE)
- -
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ArtistAlbum (hidden column)Price
BucketheadAlbino Slug8.99
BucketheadElectric Tears13.99
BucketheadColma11.34
Crystal MethodVegas10.54
Crystal MethodTweekend10.64
Crystal MethodDivided By Night8.99
-
-
-
- - - - - - - - diff --git a/packages/demo/src/getting-started.html b/packages/demo/src/getting-started.html index 1ac0989..4459d4a 100644 --- a/packages/demo/src/getting-started.html +++ b/packages/demo/src/getting-started.html @@ -19,29 +19,15 @@
CDN
jsDelivr graciously provide CDNs for many JavaScript libraries including Excel-Builder-Vanilla. Just use the following CDN links.

-

- The project now ships as ESM-Only, if you still wish to use the legacy CommonJS (CJS) format with require(), then use - previous 3.x version. -

-<!-- (IIFE Standalone Script) Latest compiled and minified JavaScript -->
-<script type="module" src="https://cdn.jsdelivr.net/npm/excel-builder-vanilla@4.0.0/dist/excel-builder.iife.js"></script>
+<script type="module">
+  // ESM Module import
+  import excelBuilderVanilla from 'https://cdn.jsdelivr.net/npm/excel-builder-vanilla@5.0.0/+esm';
+</script>
+
- - - Note: the excel-builder.iife.js is the only dist bundle providing the ExcelBuilder on the - window object. - -
-
- - You can find a Standalone Script (IIFE) example at the location - examples/example-standalone-iife.html -
@@ -59,16 +45,19 @@

The library provides both CommonJS or ESM, see the example below:

-// CommonJS
-const { createWorkbook, Workbook } = require('excel-builder-vanilla');
-
 // ESM
-import { createWorkbook } from 'excel-builder-vanilla';
+import { createWorkbook } from 'excel-builder-vanilla';
 
 // use it
-const artistWorkbook = createWorkbook(); // or new Workbook();
-const albumList = artistWorkbook.createWorksheet({ name: 'Artists' });
-albumList.setData(this.originalData);
+const artistWorkbook = createWorksheet(); // or new Workbook();
+const albumList = artistWorkbook.createWorksheet({ name: 'Artists' });
+albumList.setData(this.originalData);
 
+ +
Legacy Versions
+

+ The project now ships as ESM-Only, if you still wish to use the legacy <script> standalone IIFE Script on the + window object, then use the previous 4.x version. +

diff --git a/packages/excel-builder-vanilla/README.md b/packages/excel-builder-vanilla/README.md index 89971f9..b3475d9 100644 --- a/packages/excel-builder-vanilla/README.md +++ b/packages/excel-builder-vanilla/README.md @@ -14,22 +14,12 @@ Available [**Live demo**](https://ghiscoding.github.io/excel-builder-vanilla/) w npm install excel-builder-vanilla ``` -The project offers 2 different bundle types, choose the best one depending on your use case: -1. ESM: to `import from` (preferred) -2. IIFE: standalone script with `ExcelBuilder` available on the `window` object - -> [!NOTE] -> ESM import is the preferred approach and IIFE might actually be removed in the future to lower download size even further. +The project only offers 1 bundle type +- ESM: to `import from` (preferred) ```ts // ESM - npm install import { createWorksheet } from 'excel-builder-vanilla'; - -// IIFE - CDN - - ``` ### Basic Usage @@ -58,3 +48,14 @@ downloadExcelFile(artistWorkbook, 'Artist WB.xlsx'); ## LICENSE [MIT License](https://github.com/ghiscoding/excel-builder-vanilla/blob/main/LICENSE.md) + +## Major Changes + +### version 3.0 +- initial release (forked from original `excel-builder` library) + +### version 4.0 +- build as ESM-Only and drop CJS (CommonJS) build (aka `require()`) + +### version 5.0 +- drop the legacy IIFE build and the use of `window` object (typically used when loading as the legacy `