This commit is contained in:
SheetJS 2023-07-24 22:31:22 -04:00
parent 4dd53501ff
commit 67612ae920
11 changed files with 116 additions and 32 deletions

@ -39,6 +39,8 @@ analytics globally through the CLI tool before creating a new project:
npx @angular/cli analytics disable -g
```
(If prompted to share data, type `N` and press Enter)
:::
@ -154,13 +156,21 @@ export class AppComponent {
:::note
This demo was last run on 2023 February 21 using Angular CLI `15.1.6`
This demo was last run on 2023-07-24 using Angular CLI `16.1.5`
:::
0) Disable telemetry with `npx @angular/cli analytics disable -g`
0) Disable telemetry:
1) Run `ng new --minimal --defaults --no-interactive sheetjs-angular`.
```bash
npx @angular/cli analytics disable -g
```
1) Create a new project:
```bash
npx @angular/cli new --minimal --defaults --no-interactive sheetjs-angular
```
2) Install the SheetJS dependency and start the dev server:
@ -177,9 +187,20 @@ npm start`}
4) Replace `src/app/app.component.ts` with the code snippet.
The page will refresh and show a table with an Export button. Click the button
and the page will attempt to download `SheetJSAngularAoA.xlsx`.
and the page will attempt to download `SheetJSAngularAoO.xlsx`.
5) Stop the dev server and build the site:
```bash
npm run build
```
To test the generated site, start a web server:
```bash
npx -y http-server dist/sheetjs-angular/
```
5) Build the site with `npm run build`, then test with `npx http-server dist`.
Access `http://localhost:8080` with a web browser to test the bundled site.
</details>
@ -242,13 +263,21 @@ export class AppComponent {
:::note
This demo was last run on 2023 February 21 using Angular CLI `15.1.6`
This demo was last run on 2023-07-24 using Angular CLI `16.1.5`
:::
0) Disable telemetry with `npx @angular/cli analytics disable -g`
0) Disable telemetry:
1) Run `ng new --minimal --defaults --no-interactive sheetjs-angular`.
```bash
npx @angular/cli analytics disable -g
```
1) Create a new project:
```bash
npx @angular/cli new --minimal --defaults --no-interactive sheetjs-angular
```
2) Install the SheetJS dependency and start the dev server:
@ -267,7 +296,18 @@ npm start`}
The page will refresh and show a table with an Export button. Click the button
and the page will attempt to download `SheetJSAngularHTML.xlsx`.
5) Build the site with `npm run build`, then test with `npx http-server dist`.
5) Stop the dev server and build the site:
```bash
npm run build
```
To test the generated site, start a web server:
```bash
npx -y http-server dist/sheetjs-angular/
```
Access `http://localhost:8080` with a web browser to test the bundled site.
</details>

@ -48,7 +48,7 @@ This demo was tested in the following environments:
| OS and Version | Arch | RN Platform | Date |
|:---------------|:-----|:------------|:-----------|
| Windows 10 | x64 | `v0.70.10` | 2023-01-04 |
| Windows 10 | x64 | `v0.71.25` | 2023-07-24 |
| Windows 11 | x64 | `v0.71.11` | 2023-05-11 |
| MacOS 12.6 | x64 | `v0.71.26` | 2023-07-23 |
| MacOS 13.4 | arm | `v0.71.18` | 2023-07-06 |
@ -391,6 +391,8 @@ used to switch the NodeJS version.
:::
### Project Setup
1) Create a new project using React Native `0.71`:
```bash
@ -398,7 +400,7 @@ npx react-native init SheetJSWin --template react-native@^0.71.0
cd SheetJSWin
```
Create the Windows part of the application:
2) Create the Windows part of the application:
<Tabs groupId="rnwlang">
<TabItem value="cs" label="C#">
@ -417,13 +419,13 @@ npx react-native-windows-init --no-telemetry --overwrite
</TabItem>
</Tabs>
Install the SheetJS library:
3) Install the SheetJS library:
<CodeBlock language="bash">{`\
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz`}
</CodeBlock>
To ensure that the app works, launch the app:
4) To ensure that the app works, launch the app:
```bash
npx react-native run-windows --no-telemetry
@ -439,10 +441,12 @@ Specific Windows SDK versions can be installed through Visual Studio Installer.
:::
### Native Module
<Tabs groupId="rnwlang">
<TabItem value="cs" label="C#">
2) Download [`DocumentPicker.cs`](pathname:///reactnative/DocumentPicker.cs) and
5) Download [`DocumentPicker.cs`](pathname:///reactnative/DocumentPicker.cs) and
save to `windows\SheetJSWin\DocumentPicker.cs`.
<Tabs groupId="shell">
@ -464,7 +468,7 @@ curl -Lo windows/SheetJSWin/DocumentPicker.cs https://docs.sheetjs.com/reactnati
3) Add the highlighted line to `windows\SheetJSWin\SheetJSWin.csproj`. Look for
6) Add the highlighted line to `windows\SheetJSWin\SheetJSWin.csproj`. Look for
the `ItemGroup` that contains `ReactPackageProvider.cs`:
```xml title="windows\SheetJSWin\SheetJSWin.csproj"
@ -477,7 +481,7 @@ the `ItemGroup` that contains `ReactPackageProvider.cs`:
</TabItem>
<TabItem value="cpp" label="C++">
2) Download [`DocumentPicker.h`](pathname:///reactnative/DocumentPicker.h) and
5) Download [`DocumentPicker.h`](pathname:///reactnative/DocumentPicker.h) and
save to `windows\SheetJSWin\DocumentPicker.h`.
<Tabs groupId="shell">
@ -497,7 +501,7 @@ curl -Lo windows/SheetJSWin/DocumentPicker.h https://docs.sheetjs.com/reactnativ
</TabItem>
</Tabs>
3) Add the highlighted line to `windows\SheetJSWin\ReactPackageProvider.cpp`:
6) Add the highlighted line to `windows\SheetJSWin\ReactPackageProvider.cpp`:
```cpp title="windows\SheetJSWin\ReactPackageProvider.cpp"
#include "ReactPackageProvider.h"
@ -511,7 +515,9 @@ curl -Lo windows/SheetJSWin/DocumentPicker.h https://docs.sheetjs.com/reactnativ
Now the native module will be added to the app.
4) Remove `App.js` (if it exists) and download [`App.tsx`](https://docs.sheetjs.com/reactnative/rnw/App.tsx):
### Application
7) Remove `App.js` (if it exists) and download [`App.tsx`](https://docs.sheetjs.com/reactnative/rnw/App.tsx):
<Tabs groupId="shell">
<TabItem value="pwsh" label="PowerShell">
@ -532,14 +538,16 @@ curl -LO https://docs.sheetjs.com/reactnative/rnw/App.tsx
5) Test the app again:
8) Test the app again:
```bash
npx react-native run-windows --no-telemetry
```
Download <https://sheetjs.com/pres.xlsx>, then click on "open file". Use the
file picker to select the `pres.xlsx` file and the app will show the data.
Download <https://sheetjs.com/pres.xlsx>.
Click "Click here to Open File!" and use the file picker to select `pres.xlsx` .
The app will refresh and display the data from the file.
## macOS Demo

@ -26,7 +26,7 @@ This demo was tested in the following environments:
| Environment | AlaSQL | Date |
|:--------------------|:-------|:----------:|
| NodeJS | 3.1.0 | 2023-02-23 |
| NodeJS | 3.1.0 | 2023-07-24 |
| Standalone (Chrome) | 3.0.0 | 2023-04-09 |
:::

@ -117,9 +117,10 @@ This demo was tested in the following deployments:
| Architecture | Version | Date |
|:-------------|:--------|:-----------|
| `darwin-x64` | `2.7.0` | 2023-02-12 |
| `darwin-x64` | `2.7.0` | 2023-07-24 |
| `darwin-arm` | `2.7.0` | 2023-06-05 |
| `linux-x64` | `2.7.0` | 2023-06-02 |
| `win10-x64` | `2.7.0` | 2023-07-24 |
:::

@ -133,7 +133,7 @@ This demo was tested in the following environments:
| Architecture | Swift | Date |
|:-------------|:--------|:-----------|
| `darwin-x64` | `5.7.2` | 2023-02-12 |
| `darwin-x64` | `5.8.1` | 2023-07-24 |
| `darwin-arm` | `5.8.1` | 2023-06-05 |
:::

@ -26,7 +26,7 @@ command-line tool for reading data from files.
## Integration Details
:::note
:::note pass
Many QuickJS functions are not documented. The explanation was verified against
the latest release (commit `2788d71`).
@ -264,9 +264,10 @@ This demo was tested in the following deployments:
| Architecture | Git Commit | Date |
|:-------------|:-----------|:-----------|
| `darwin-x64` | `2788d71` | 2023-02-12 |
| `darwin-x64` | `2788d71` | 2023-07-24 |
| `darwin-arm` | `2788d71` | 2023-06-05 |
| `linux-x64` | `2788d71` | 2023-06-02 |
| `win10-x64` | `2788d71` | 2023-07-24 |
When the demo was tested, commit `2788d71` corresponded to the latest release.
@ -298,7 +299,7 @@ curl -LO https://docs.sheetjs.com/quickjs/sheetjs.quick.c
3) Build the sample application:
```bash
gcc -o sheetjs.quick -Wall -lm sheetjs.quick.c libquickjs.a
gcc -o sheetjs.quick -Wall sheetjs.quick.c libquickjs.a -lm
```
This program tries to parse the file specified by the first argument

@ -179,7 +179,7 @@ This demo was tested in the following deployments:
| Architecture | Git Commit | Date |
|:-------------|:-----------|:-----------|
| `darwin-x64` | `869312f` | 2023-05-30 |
| `darwin-x64` | `9f8603b` | 2023-07-24 |
| `darwin-arm` | `869312f` | 2023-06-05 |
:::

@ -65,7 +65,12 @@ The `strict_` variants ensure that no newlines are added to the strings.
:::note
This demo was tested on 2023 February 14.
This demo was tested in the following deployments:
| Platform | Ruby | ExecJS | Date |
|:-------------|:---------|:--------|:-----------|
| `darwin-x64` | `2.7.6` | `2.8.1` | 2023-07-24 |
| `darwin-arm` | `2.6.10` | `2.8.1` | 2023-07-24 |
:::
@ -75,6 +80,16 @@ This demo was tested on 2023 February 14.
gem install execjs
```
:::note
The command may need to be run as an administrator or root user:
```bash
sudo gem install execjs
```
:::
1) Download the standalone script and test file:
<ul>

@ -43,9 +43,12 @@ These instructions were tested on the following platforms:
| Linux (Ubuntu 18.04 aarch64) | 2023-04-13 |
| MacOS 10.13 (x64) | 2023-04-04 |
| MacOS 13.0 (arm64) | 2023-04-13 |
| Windows 10 (x64) + WSL Ubuntu | 2023-01-14 |
| Windows 10 (x64) + WSL Ubuntu | 2023-07-23 |
| Windows 11 (x64) + WSL Ubuntu | 2023-04-04 |
With some additional dependencies, the unminified build is reproducible and
tests will pass in Windows XP with NodeJS 5.10.0.
:::
### Install dependencies
@ -86,6 +89,16 @@ sudo npm i -g n
sudo n 16
```
:::note pass
If `npm` is missing, it can be installed with
```bash
sudo apt-get install -y npm
```
:::
D) Build and install a version of Git with proper SSL support:
```bash
@ -101,6 +114,12 @@ should be run twice, once within PowerShell and once within WSL bash:
```bash
git config --global --add core.autocrlf false
git config --global --unset core.autocrlf true
```
F) Run `unzip`. If the program is missing, install manually:
```bash
sudo apt-get install -y unzip
```
</TabItem>

@ -1,5 +1,5 @@
# Note: The official Hermes documentation includes zero guidance on embedding.
# Tested against commit 869312f185b73a7d7678a28f5f3216052c667e90
# Tested against commit 9f8603b9886c957e0ccead61fe4380616188bbb4
.PHONY: doit
doit: sheetjs-hermes
@ -53,5 +53,5 @@ sheetjs-hermes: sheetjs-hermes.cpp init
.PHONY: init
init:
if [ ! -e hermes ]; then git clone https://github.com/facebook/hermes.git; cd hermes; git checkout 869312f185b73a7d7678a28f5f3216052c667e90; cd ..; fi
if [ ! -e hermes ]; then git clone https://github.com/facebook/hermes.git; cd hermes; git checkout 9f8603b9886c957e0ccead61fe4380616188bbb4; cd ..; fi
if [ ! -e build_release ]; then cmake -S hermes -B build_release -G Ninja -DCMAKE_BUILD_TYPE=Release; cmake --build ./build_release; fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB