diff --git a/docz/docs/02-getting-started/01-installation/04-amd.md b/docz/docs/02-getting-started/01-installation/04-amd.md index bd5e123..68d12c0 100644 --- a/docz/docs/02-getting-started/01-installation/04-amd.md +++ b/docz/docs/02-getting-started/01-installation/04-amd.md @@ -104,7 +104,7 @@ require(['xlsx'], function(XLSX) { Dojo has changed module loading strategies over the years. These examples were tested with Dojo `1.17.3`. They are not guaranteed to work with other versions. -Live demos are included in ["Dojo Toolkit"](/docs/demos/frontend/legacy#dojo-toolkit) +Live demos are included in ["Dojo Toolkit"](/docs/demos/frontend/dojo) :::caution pass diff --git a/docz/docs/03-demos/01-frontend/08-dojo.md b/docz/docs/03-demos/01-frontend/08-dojo.md new file mode 100644 index 0000000..3448784 --- /dev/null +++ b/docz/docs/03-demos/01-frontend/08-dojo.md @@ -0,0 +1,205 @@ +--- +title: Sheets in Dojo Sites +sidebar_label: Dojo Toolkit +description: Build interactive websites with Dojo. Seamlessly integrate spreadsheets into your app using SheetJS. Bring Excel-powered workflows and data to the modern web. +pagination_prev: demos/index +pagination_next: demos/grid/index +sidebar_position: 8 +--- + +import current from '/version.js'; +import CodeBlock from '@theme/CodeBlock'; + +[Dojo Toolkit](https://dojotoolkit.org/) is a JavaScript toolkit for building +user interfaces. It includes solutions for code loading and DOM manipulation. + +[SheetJS](https://sheetjs.com) is a JavaScript library for reading and writing +data from spreadsheets. + +This demo uses Dojo Toolkit and SheetJS to process and generate spreadsheets. +We'll explore how to load SheetJS using Dojo loader and perform common tasks. + +## Installation + +The ["AMD" instructions](/docs/getting-started/installation/amd#dojo-toolkit) +includes details for using SheetJS with `require`. + +The demos in this section use the async loading strategy with the SheetJS CDN: + +{`\ + + + +`} + + +:::warning pass + +The official Google CDN does not have the newest releases of Dojo Toolkit + +**This is a known Google CDN bug.** + +The script was fetched from the official +`1.17.3` uncompressed release artifact[^1]. + +::: + +## Live Demos + +:::note Tested Deployments + +The demos were last tested on 2023-11-27. + +Demos exclusively using Dojo Core were tested using Dojo Toolkit `1.17.3`. + +Demos using `dijit` or `dojox` were tested using Dojo Toolkit `1.14.1`. This +was the latest version available on the Google CDN. + +::: + +- [Download and display data](pathname:///dojo/read.html) +- [Fetch JSON and generate a workbook](pathname:///dojo/write.html) +- [Parse file and create a data store](pathname:///dojo/combo.html) +- [Export data from a store to XLSX](pathname:///dojo/export.html) + +## Operations + +### Parsing Remote Files + +When fetching spreadsheets with XHR, `handleAs: "arraybuffer"` yields an +`ArrayBuffer` which can be passed to the SheetJS `read` method. + +The following example generates a HTML table from the first worksheet: + +```html +
+ +``` + +:::note pass + +The `X-Requested-With` header setting resolves some issues related to CORS. + +::: + +### Writing Local Files + +The SheetJS `writeFile` method attempts to create and download a file: + +```js +require(["xlsx"], function(_XLSX) { + /* create a sample workbook */ + var ws = XLSX.utils.aoa_to_sheet(["SheetJS".split(""), [5,4,3,3,7,9,5]]); + var wb = XLSX.utils.book_new(); XLSX.utils.book_append_sheet(wb, ws, "Sheet1"); + /* create an XLSX file and try to save to SheetJSDojo.xlsx */ + // highlight-next-line + XLSX.writeFile(workbook, "SheetJSDojo.xlsx"); +}); +``` + +### Data Stores + +`dojo/store`[^2] is the primary interface for working with structured data. + +#### Importing Data + +The SheetJS `sheet_to_json` method can generate an array of arrays that can back +a `dojo/store/Memory` store. + +The following example fetches a test file, creates a Memory store from the data +in the first worksheet, and assigns to a `dijit` UI Widget: + +```html + +``` + +#### Exporting Data + +Starting from a data store, query results are arrays of objects. Worksheets can +be created using the SheetJS `json_to_sheet` method: + +```js +function export_all_data_from_store(store) { + require(["xlsx"], function(_XLSX) { + // highlight-start + /* pull all data rows from the store */ + var rows = store.query(function() { return true; }); + + /* generate SheetJS worksheet */ + var ws = XLSX.utils.json_to_sheet(rows); + // highlight-end + + /* generate SheetJS workbook and write to XLSX */ + var wb = XLSX.utils.book_new(); + XLSX.utils.book_append_sheet(wb, ws, "Export"); + XLSX.writeFile(wb, "SheetJSDojoExport.xlsx"); + }); +} +``` + +[^1]: All Dojo Toolkit releases are available at . The mirrored `dojo.js` corresponds to the `1.17.3` uncompressed script . +[^2]: See [`dojo/store`](https://dojotoolkit.org/reference-guide/dojo/store.html) in the Dojo Toolkit documentation. \ No newline at end of file diff --git a/docz/docs/03-demos/01-frontend/09-legacy.md b/docz/docs/03-demos/01-frontend/09-legacy.md index f60833d..ac683d2 100644 --- a/docz/docs/03-demos/01-frontend/09-legacy.md +++ b/docz/docs/03-demos/01-frontend/09-legacy.md @@ -192,109 +192,9 @@ included in the page and the relevant features are enabled on the target system. ## Frameworks -### Dojo Toolkit - -_Live Demos_ - -- [Download and display data](pathname:///dojo/read.html) -- [Fetch JSON and generate a workbook](pathname:///dojo/write.html) - -:::note pass - -These demos have been tested with Dojo Toolkit `1.10.4` and `1.17.3`. - -::: - -:::warning pass - -The official Google CDN is out of date. This is a known CDN bug. - -The script was fetched from the official -`1.17.3` uncompressed release artifact[^2] on 2023-08-16. - -::: - -_Installation_ - -The ["AMD" instructions](/docs/getting-started/installation/amd#dojo-toolkit) -includes details for use with `require`. - -
Integration in the demos (click to show) - -The demos use the async loading strategy with the SheetJS CDN: - -{`\ - - -`} - - -
- -The ["Dojo" section in "Bundlers"](/docs/demos/bundler#dojo) includes a complete example -mirroring the [official export example](/docs/getting-started/examples/export) - -
Details (click to show) - -_Reading Data_ - -When fetching spreadsheets with XHR, `handleAs: "arraybuffer"` yields an -`ArrayBuffer` which can be passed to `XLSX.read`: - -```html -
- -``` - -:::note pass - -The `X-Requested-With` header setting resolves some issues related to CORS. - -::: - -_Writing Data_ - -`XLSX.writeFile` works as expected: - -```html - -``` - -
+#### Dojo Toolkit +**[The exposition has been moved to a separate page.](/docs/demos/frontend/dojo)** ### KnockoutJS @@ -371,5 +271,4 @@ binding is possible using the `$parent` and `$index` binding context properties: -[^1]: Project hosted at -[^2]: All Dojo Toolkit releases are available at . The mirrored `dojo.js` corresponds to the `1.17.3` uncompressed script . \ No newline at end of file +[^1]: Project hosted at \ No newline at end of file diff --git a/docz/docs/03-demos/01-frontend/19-bundler/index.md b/docz/docs/03-demos/01-frontend/19-bundler/index.md index 9c889ce..8e97991 100644 --- a/docz/docs/03-demos/01-frontend/19-bundler/index.md +++ b/docz/docs/03-demos/01-frontend/19-bundler/index.md @@ -39,7 +39,7 @@ The following tools are covered in separate pages: Integration details are included [in the "AMD" installation](/docs/getting-started/installation/amd#dojo-toolkit) -Complete Examples are included [in the "Dojo" demo](/docs/demos/frontend/legacy#dojo-toolkit) +Complete Examples are included [in the "Dojo" demo](/docs/demos/frontend/dojo) ## Snowpack diff --git a/docz/docs/03-demos/01-frontend/index.md b/docz/docs/03-demos/01-frontend/index.md index 5a459bd..ac9544c 100644 --- a/docz/docs/03-demos/01-frontend/index.md +++ b/docz/docs/03-demos/01-frontend/index.md @@ -27,7 +27,7 @@ Demos for popular frameworks are included in separate pages: ); })} -Legacy frameworks including Dojo are covered [in the "Legacy" section](/docs/demos/frontend/legacy). +Legacy frameworks including KnockoutJS are covered [in the "Legacy" section](/docs/demos/frontend/legacy). :::note Recommendation diff --git a/docz/docs/03-demos/07-data/19-alasql.md b/docz/docs/03-demos/07-data/19-alasql.md index e138f1b..5873e13 100644 --- a/docz/docs/03-demos/07-data/19-alasql.md +++ b/docz/docs/03-demos/07-data/19-alasql.md @@ -23,14 +23,14 @@ This demo covers basic concepts pertaining to data import and export. The official documentation includes advanced examples and deployment tips as well as strategies for general data processing in AlaSQL expressions. -:::note +:::note Tested Deployments This demo was tested in the following environments: | Environment | AlaSQL | Date | |:--------------------|:-------|:----------:| | NodeJS | 3.1.0 | 2023-10-26 | -| Standalone (Chrome) | 3.0.0 | 2023-08-20 | +| Standalone (Chrome) | 3.0.0 | 2023-11-27 | ::: diff --git a/docz/docs/03-demos/32-extensions/11-matlab.md b/docz/docs/03-demos/32-extensions/11-matlab.md index 8acba17..f036331 100644 --- a/docz/docs/03-demos/32-extensions/11-matlab.md +++ b/docz/docs/03-demos/32-extensions/11-matlab.md @@ -19,9 +19,9 @@ This demo uses SheetJS to pull data from a spreadsheet for further analysis within MATLAB. We'll explore how to run an external tool to convert complex spreadsheets into simple XLSX files for MATLAB. -:::note +:::note Tested Deployments -This demo was last tested by SheetJS users on 2023 September 12 in MATLAB R2023a. +This demo was last tested by SheetJS users on 2023 November 27 in MATLAB R2023a. ::: diff --git a/docz/docs/03-demos/42-engines/02-v8.md b/docz/docs/03-demos/42-engines/02-v8.md index 868b67e..1354b3a 100644 --- a/docz/docs/03-demos/42-engines/02-v8.md +++ b/docz/docs/03-demos/42-engines/02-v8.md @@ -118,7 +118,7 @@ The resulting `buf` can be written to file with `fwrite`. ## Complete Example -:::note +:::note Tested Deployments This demo was tested in the following deployments: @@ -127,7 +127,7 @@ This demo was tested in the following deployments: | `12.1.131` | `darwin-x64` | macOS 14.1 | `clang 15.0.0` | 2023-11-15 | | `12.0.175` | `darwin-arm` | macOS 14.0 | `clang 15.0.0` | 2023-10-20 | | `12.0.265` | `win10-x64` | Windows 10 | `CL 19.37.32822` | 2023-10-28 | -| `12.0.72` | `linux-x64` | HoloOS 3.4.11 | `gcc 12.2.0` | 2023-10-11 | +| `12.1.222` | `linux-x64` | HoloOS 3.5.7 | `gcc 13.1.1` | 2023-11-27 | | `11.8.82` | `linux-arm` | Debian 11 | `gcc 10.2.1` | 2023-09-26 | ::: @@ -459,9 +459,10 @@ tools/dev/v8gen.py x64.release.sample ninja -C out.gn/x64.release.sample v8_monolith ``` -:::caution pass +:::note pass -In the most recent Linux x64 test, there were build errors: +In some Linux x64 tests using GCC 12, there were build errors that stemmed from +warnings. The error messages included the tag `-Werror`: ``` ../../src/compiler/turboshaft/wasm-gc-type-reducer.cc:212:18: error: 'back_insert_iterator' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported] @@ -805,7 +806,7 @@ fn eval_code_ab(scope: &mut v8::HandleScope, code: &str) -> Vec { } ``` -:::note +:::note Tested Deployments This demo was last tested in the following deployments: @@ -814,7 +815,7 @@ This demo was last tested in the following deployments: | `darwin-x64` | `0.81.0` | 2023-11-14 | | `darwin-arm` | `0.79.2` | 2023-10-18 | | `win10-x64` | `0.81.0` | 2023-11-14 | -| `linux-x64` | `0.79.2` | 2023-10-11 | +| `linux-x64` | `0.81.0` | 2023-11-27 | | `linux-arm` | `0.75.1` | 2023-08-30 | ::: diff --git a/docz/docs/03-demos/index.md b/docz/docs/03-demos/index.md index ea89fb9..941981d 100644 --- a/docz/docs/03-demos/index.md +++ b/docz/docs/03-demos/index.md @@ -34,7 +34,7 @@ in the [issue tracker](https://git.sheetjs.com/sheetjs/docs.sheetjs.com/issues) - [`Svelte`](/docs/demos/frontend/svelte) - [`VueJS`](/docs/demos/frontend/vue) - [`AngularJS`](/docs/demos/frontend/angularjs) -- [`Dojo`](/docs/demos/frontend/legacy#dojo-toolkit) +- [`Dojo`](/docs/demos/frontend/dojo) - [`Knockout`](/docs/demos/frontend/legacy#knockoutjs) ### Front-End UI Components diff --git a/docz/docs/09-miscellany/05-contributing.md b/docz/docs/09-miscellany/05-contributing.md index a8c254a..84973c2 100644 --- a/docz/docs/09-miscellany/05-contributing.md +++ b/docz/docs/09-miscellany/05-contributing.md @@ -33,17 +33,17 @@ After cloning the repo, running `make help` will display a list of commands. These instructions will cover system configuration, cloning the source repo, building, reproducing official releases, and running NodeJS and browser tests. -:::note +:::note Tested Deployments These instructions were tested on the following platforms: | Platform | Test Date | |:------------------------------|:-----------| -| Linux (Steam Deck Holo x64) | 2023-10-11 | +| Linux (Steam Deck Holo x64) | 2023-11-27 | | Linux (Ubuntu 18 AArch64) | 2023-09-07 | | MacOS 10.13.6 (x64) | 2023-09-30 | | MacOS 13.6 (ARM64) | 2023-09-30 | -| Windows 10 (x64) + WSL Ubuntu | 2023-11-13 | +| Windows 10 (x64) + WSL Ubuntu | 2023-11-27 | | Windows 11 (x64) + WSL Ubuntu | 2023-10-14 | | Windows 11 (ARM) + WSL Ubuntu | 2023-09-18 | @@ -163,7 +163,7 @@ sudo apt-get install -y nodejs D) Exit the WSL session and start a new session -E) Install the `n` package and switch NodeJS vesrions: +E) Install the `n` package and switch NodeJS versions: ```bash # Switch to `n`-managed NodeJS @@ -312,6 +312,14 @@ Desktop Mode on the Steam Deck uses `pacman`. It also requires a few steps. 0) Switch to Desktop mode and open `Konsole` +:::tip pass + +At this point, it is strongly recommended to install the `ungoogled-chromium` +browser from the "Discover" app and open this page on the Steam Deck. Running +the browser on the device makes it easy to copy and paste commands. + +::: + 1) Set a password for the user by running `passwd` and following instructions. 2) Disable read-only mode: @@ -356,12 +364,27 @@ After installing mercurial and subversion, install NodeJS. :::note pass -[The official NodeJS site](https://nodejs.org/en/download/) provides installers -for "LTS" and "Current" releases. The "LTS" version should be installed. +[The official NodeJS site](https://nodejs.org/en/download/) provides Linux +binaries, but it is strongly recommended to use `nvm` to install NodeJS: + +```bash +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash +``` + +After installing, start a new terminal session and install NodeJS "LTS": + +```bash +nvm install --lts +``` After installing, if running `node` in the terminal fails with a `glibc` error, an older version of NodeJS should be installed. For example, Ubuntu 18.04 does -not support Node 18 support Node 16.20.0. +not support Node 18 but supports Node 16.20.0: + +```bash +nvm install 16 +nvm use 16 +``` ::: diff --git a/docz/static/dojo/combo.html b/docz/static/dojo/combo.html new file mode 100644 index 0000000..ced92d6 --- /dev/null +++ b/docz/static/dojo/combo.html @@ -0,0 +1,61 @@ + + + + + SheetJS + Dojo Memory Store Demo + + + +

SheetJS + Dojo Memory Store Demo

+
+ This demo fetches https://sheetjs.com/pres.xlsx, parses the file, generates a Memory store from the first worksheet, and loads a Combo box. When a President is selected, the text box will display the "Index" field from the dataset. +
+ (this HTML page is not minified -- feel free to view source!)

+ SheetJS CE Documentation

+ + + +Select a president
+

+Index of Selected President
+
+ + \ No newline at end of file diff --git a/docz/static/dojo/export.html b/docz/static/dojo/export.html new file mode 100644 index 0000000..b78fec7 --- /dev/null +++ b/docz/static/dojo/export.html @@ -0,0 +1,52 @@ + + + + + SheetJS + Dojo Store Export Demo + + + +

SheetJS + Dojo Store Export Demo

+
+ This demo exports data from a simple Dojo store, attempting to create a XLSX workbook. +
+ (this HTML page is not minified -- feel free to view source!)

+ SheetJS CE Documentation

+ + + + + \ No newline at end of file