Microsoft broke WebKit archive links
@ -34,22 +34,23 @@ results back to spreadsheets.
|
||||
|
||||
Each browser demo was tested in the following environments:
|
||||
|
||||
| Browser | TF.js version | Date |
|
||||
|:------------|:--------------|:-----------|
|
||||
| Chrome 127 | `4.20.0` | 2024-08-16 |
|
||||
| Safari 17.4 | `4.20.0` | 2024-08-16 |
|
||||
| Browser | TF.js | Date |
|
||||
|:------------|:----------|:-----------|
|
||||
| Chrome 133 | `4.22.0` | 2025-04-21 |
|
||||
| Safari 18.3 | `4.22.0` | 2025-04-21 |
|
||||
|
||||
The NodeJS demo was tested in the following environments:
|
||||
|
||||
| NodeJS | TF.js version | Date |
|
||||
|:---------|:------------------------------|:-----------|
|
||||
| `22.3.0` | `4.20.0` (`@tensorflow/tfjs`) | 2024-08-16 |
|
||||
| NodeJS | TF.js | Date |
|
||||
|:------------|:----------|:-----------|
|
||||
| `22.14.0` | `4.22.0` | 2025-04-21 |
|
||||
| `20.18.0` | `4.22.0` | 2025-04-21 |
|
||||
|
||||
The Kaioken demo was tested in the following environments:
|
||||
|
||||
| Kaioken | TF.js version | Date |
|
||||
|:----------|:--------------|:-----------|
|
||||
| `0.25.3` | `4.20.0` | 2024-08-16 |
|
||||
| Kaioken | TF.js | Date |
|
||||
|:------------|:----------|:-----------|
|
||||
| `0.37.0` | `4.22.0` | 2025-04-21 |
|
||||
|
||||
:::
|
||||
|
||||
@ -57,7 +58,7 @@ The Kaioken demo was tested in the following environments:
|
||||
|
||||
#### Standalone Browser Scripts
|
||||
|
||||
Live code blocks in this page use the TF.js `4.20.0` standalone build.
|
||||
Live code blocks in this page use the TF.js `4.22.0` standalone build.
|
||||
|
||||
Standalone scripts are available on various CDNs including UNPKG. The latest
|
||||
version can be loaded with the following `SCRIPT` tag.
|
||||
|
@ -33,7 +33,7 @@ will be available in the future.
|
||||
|
||||
:::note Tested Deployments
|
||||
|
||||
This demo was last tested on 2024-06-13.
|
||||
This demo was last tested on 2025-04-21.
|
||||
|
||||
:::
|
||||
|
||||
@ -72,7 +72,7 @@ The `busboy` body parser[^2] is battle-tested in NodeJS deployments.
|
||||
`busboy` fires a `'file'` event for every file in the form body. The callback
|
||||
receives a NodeJS stream that should be collected into a Buffer:
|
||||
|
||||
```js
|
||||
```js title="Collecting file data from an upload (sketch)"
|
||||
/* accumulate the files manually */
|
||||
var files = {};
|
||||
bb.on('file', function(fieldname, file, filename) {
|
||||
@ -93,7 +93,7 @@ workbook objects[^4] which can be processed with other API functions.
|
||||
|
||||
For example, a handler can use `sheet_to_csv`[^5] to generate CSV text:
|
||||
|
||||
```js
|
||||
```js title="Parse an uploaded file and generate a CSV (sketch)"
|
||||
/* on the finish event, all of the fields and files are ready */
|
||||
bb.on('finish', function() {
|
||||
/* grab the first file */
|
||||
@ -116,7 +116,7 @@ bb.on('finish', function() {
|
||||
This example takes the first uploaded file submitted with the key `upload`,
|
||||
parses the file and returns the CSV content of the first worksheet.
|
||||
|
||||
```js
|
||||
```js title="Complete Lambda Function"
|
||||
const XLSX = require('xlsx');
|
||||
var Busboy = require('busboy');
|
||||
|
||||
@ -168,7 +168,7 @@ For safely transmitting binary data, Base64 strings should be used.
|
||||
The SheetJS `write` method[^6] with the option `type: "base64"` will generate
|
||||
Base64-encoded strings.
|
||||
|
||||
```js
|
||||
```js title="Generate a Base64-encoded XLSX workbook (sketch)"
|
||||
/* sample SheetJS workbook object */
|
||||
var wb = XLSX.read("S,h,e,e,t,J,S\n5,4,3,3,7,9,5", {type: "binary"});
|
||||
/* write to XLSX file in Base64 encoding */
|
||||
@ -179,7 +179,7 @@ The Lambda callback response function accepts options. Setting `isBase64Encoded`
|
||||
to `true` will ensure the callback handler decodes the data. To ensure browsers
|
||||
will try to download the response, the `Content-Disposition` header must be set:
|
||||
|
||||
```js
|
||||
```js title="Respond with an attachment (sketch)"
|
||||
callback(null, {
|
||||
statusCode: 200,
|
||||
/* Base64-encoded file */
|
||||
@ -197,7 +197,7 @@ callback(null, {
|
||||
|
||||
This example creates a sample workbook object and sends the file in the response:
|
||||
|
||||
```js
|
||||
```js title="Complete Lambda Function"
|
||||
var XLSX = require('xlsx');
|
||||
|
||||
exports.handler = function(event, context, callback) {
|
||||
@ -230,7 +230,7 @@ free requests per month and 400 thousand GB-seconds of compute resources.
|
||||
|
||||
:::
|
||||
|
||||
0) If you do not have an account, create a new AWS free tier account[^7].
|
||||
0) Create a new AWS free tier account[^7] or sign into an existing AWS account.
|
||||
|
||||
#### Create Project ZIP
|
||||
|
||||
@ -251,13 +251,13 @@ curl -LO https://docs.sheetjs.com/aws/index.js
|
||||
|
||||
<CodeBlock language="bash">{`\
|
||||
mkdir -p node_modules
|
||||
npm i https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz busboy`}
|
||||
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz busboy`}
|
||||
</CodeBlock>
|
||||
|
||||
4) Create a .zip package of the contents of the folder:
|
||||
|
||||
```bash
|
||||
zip -c ../SheetJSLambda.zip -r .
|
||||
zip ../SheetJSLambda.zip -r .
|
||||
```
|
||||
|
||||
#### Lambda Setup
|
||||
@ -282,13 +282,17 @@ If the left sidebar is not open, click the `≡` icon in the left edge of the pa
|
||||
- Type a memorable "Function Name" ("SheetJSLambda" when last tested)
|
||||
|
||||
- In the "Runtime" dropdown, look for the "Latest supported" section and select
|
||||
"Node.js" ("Node.js 20.x" when last tested)
|
||||
"Node.js" ("Node.js 22.x" when last tested)
|
||||
|
||||
- Expand "Advanced Settings" and check "Enable function URL". This will display
|
||||
a few sub-options:
|
||||

|
||||
|
||||
- Expand "Additional Configurations" and check "Enable function URL". The page
|
||||
will show additional sub-options:
|
||||
+ "Auth type" select "NONE" (disable IAM authentication)
|
||||
+ Check "Configure cross-origin resource sharing (CORS)"
|
||||
|
||||

|
||||
|
||||
10) Click "Create function" to create the function.
|
||||
|
||||
#### Upload Code
|
||||
@ -297,18 +301,25 @@ If the left sidebar is not open, click the `≡` icon in the left edge of the pa
|
||||
|
||||
12) Click the "Upload from" dropdown and select ".zip file".
|
||||
|
||||

|
||||
|
||||
13) Click the "Upload" button in the modal. With the file picker, select the
|
||||
`SheetJSLambda.zip` file created in step 3. Click "Save".
|
||||
|
||||

|
||||
|
||||
:::note pass
|
||||
|
||||
When the demo was last tested, the ZIP was small enough that the Lambda code
|
||||
editor will load the package.
|
||||
editor loaded the package.
|
||||
|
||||
:::
|
||||
|
||||
14) In the code editor, double-click `index.js` and confirm the code editor
|
||||
displays JavaScript code.
|
||||
|
||||

|
||||
|
||||
#### External Access
|
||||
|
||||
15) Click "Configuration" in the tab list.
|
||||
@ -331,7 +342,10 @@ If no policy statements are defined, select "Add Permission" with the options:
|
||||
- Ensure that Principal is set to `*`
|
||||
- Ensure that Action is set to `lambda:InvokeFunctionUrl`
|
||||
|
||||
Click "Save" and a new Policy statement should be created.
|
||||
Click "Save" and a new Policy statement should be created. The corresponding row
|
||||
should match the details in the following screenshot:
|
||||
|
||||

|
||||
|
||||
#### Lambda Testing
|
||||
|
||||
@ -367,7 +381,7 @@ The `aws-sdk` module exports a function `S3` that performs the connection. The
|
||||
function expects an options object that includes an API version and credentials.
|
||||
Access keys for an IAM user[^9] must be used:
|
||||
|
||||
```js
|
||||
```js title="Connect to S3 from NodeJS (sketch)"
|
||||
/* credentials */
|
||||
var accessKeyId = "...", secretAccessKey = "..."";
|
||||
|
||||
@ -389,7 +403,7 @@ var s3 = new AWS.S3({
|
||||
The `s3#getObject` method returns an object with a `createReadStream` method.
|
||||
`createReadStream` returns a NodeJS stream:
|
||||
|
||||
```js
|
||||
```js title="Get Object from S3 (sketch)"
|
||||
/* open stream to the file */
|
||||
var stream = s3.getObject({ Bucket: Bucket, Key: Key }).createReadStream();
|
||||
```
|
||||
@ -398,7 +412,7 @@ var stream = s3.getObject({ Bucket: Bucket, Key: Key }).createReadStream();
|
||||
|
||||
Buffers can be concatenated from the stream into one unified Buffer object:
|
||||
|
||||
```js
|
||||
```js title="Fetch data from S3 object and collect into a Buffer (sketch)"
|
||||
/* array of buffers */
|
||||
var bufs = [];
|
||||
/* add each data chunk to the array */
|
||||
@ -419,7 +433,7 @@ workbook objects[^11] which can be processed with other API functions.
|
||||
|
||||
For example, a callback can use `sheet_to_csv`[^12] to generate CSV text:
|
||||
|
||||
```js
|
||||
```js title="Parse workbook from S3 and generate a CSV (sketch)"
|
||||
stream.on('end', function() {
|
||||
/* concatenate */
|
||||
var buf = Buffer.concat(bufs);
|
||||
@ -442,7 +456,7 @@ NodeJS Buffers. `S3#upload` directly accepts these Buffer objects.
|
||||
This example creates a sample workbook object, generates XLSX file data in a
|
||||
NodeJS Buffer, and uploads the data to S3:
|
||||
|
||||
```js
|
||||
```js title="Upload sample workbook to S3 (sketch)"
|
||||
/* generate sample workbook */
|
||||
var wb = XLSX.read("S,h,e,e,t,J,S\n5,4,3,3,7,9,5", {type: "binary"});
|
||||
|
||||
@ -478,7 +492,7 @@ a root user account.
|
||||
|
||||

|
||||
|
||||
3) Open "Buckets" in the left sidebar.
|
||||
3) Open "General purpose buckets" in the left sidebar.
|
||||
|
||||
If the left sidebar is not open, click the `≡` icon in the left edge of the page.
|
||||
|
||||
@ -486,7 +500,9 @@ If the left sidebar is not open, click the `≡` icon in the left edge of the pa
|
||||
|
||||
5) Select the following options:
|
||||
|
||||
- Type a memorable "Bucket Name" ("sheetjsbouquet" when last tested)
|
||||
- Bucket Type: "General purpose" (default)
|
||||
|
||||
- Type a memorable "Bucket Name" ("sheetjsbuckit" when last tested)
|
||||
|
||||
- In the "Object Ownership" section, select "ACLs disabled"
|
||||
|
||||
@ -536,7 +552,8 @@ There should be one entry.
|
||||
|
||||
#### Generate Keys
|
||||
|
||||
20) Click "Security credentials", then click "Create access key".
|
||||
20) Click "Security credentials", then scroll down to the "Access keys" section
|
||||
and click "Create access key".
|
||||
|
||||
21) Select the "Local code" option. Check "I understand the above recommendation
|
||||
and want to proceed to create an access key." and click "Next"
|
||||
@ -562,7 +579,7 @@ npm init -y
|
||||
|
||||
<CodeBlock language="bash">{`\
|
||||
mkdir -p node_modules
|
||||
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz aws-sdk@2.1467.0`}
|
||||
npm i --save https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz aws-sdk@2.1692.0`}
|
||||
</CodeBlock>
|
||||
|
||||
#### Write Test
|
||||
|
@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Airtable
|
||||
title: Flying Sheets with Airtable
|
||||
sidebar_label: Airtable
|
||||
pagination_prev: demos/local/index
|
||||
pagination_next: demos/extensions/index
|
||||
---
|
||||
@ -206,7 +207,7 @@ const wb = XLSX.readFile("SheetJSAirtableTest.xlsb");
|
||||
|
||||
:::note Tested Deployments
|
||||
|
||||
This demo was last tested on 2024-05-04. In the most recent test, free accounts
|
||||
This demo was last tested on 2025-04-21. In the most recent test, free accounts
|
||||
included limited API access.
|
||||
|
||||
:::
|
||||
@ -215,16 +216,9 @@ included limited API access.
|
||||
|
||||
### Personal Access Token
|
||||
|
||||
:::note pass
|
||||
|
||||
In the past, Airtable offered API keys. They were officially deprecated on 2024
|
||||
February 1. They recommend "Personal Access Tokens" for operations.
|
||||
|
||||
:::
|
||||
|
||||
API actions will require a PAT, which must be created through the developer hub:
|
||||
|
||||
1) Click on account icon (topright area of the page) and select "Developer Hub".
|
||||
1) Click on account icon (topright area of the page) and select "Builder Hub".
|
||||
|
||||
:::caution pass
|
||||
|
||||
@ -233,7 +227,7 @@ to create a token.
|
||||
|
||||
:::
|
||||
|
||||
2) Click the blue "Create Token" button.
|
||||
2) Click "Personal access tokens" in the sidebar, then click "Create Token".
|
||||
|
||||
3) In the form, make the following selections:
|
||||
|
||||
@ -253,10 +247,18 @@ For the purposes of this demo, a sample workspace should be created:
|
||||
|
||||
5) Download https://docs.sheetjs.com/pres.xlsx
|
||||
|
||||
6) Click "Back to Home" to return to the home page.
|
||||
6) Click the left arrow in the top-left corner to return to the home page.
|
||||
|
||||
7) Create a project in Airtable using "Quickly upload". Select "Microsoft Excel"
|
||||
and select the downloaded file from step 1. Click "Upload", then "Import".
|
||||
7) In the left sidebar, scroll down and click the "Import" link.
|
||||
|
||||
In the modal, select "Microsoft Excel".
|
||||
|
||||
In the upload modal, click "browse files" and select `pres.xlsx` from Step 5.
|
||||
|
||||
Click the blue "Upload 1 file" button.
|
||||
|
||||
In the new modal, click "Import". When this demo was last tested, Airtable
|
||||
created 5 records with "Name" and "Index" column headers.
|
||||
|
||||
8) A workspace will be created. The name will be found in the URL. For example:
|
||||
|
||||
@ -315,7 +317,8 @@ const base = "app...";
|
||||
node SheetJSAirtableRead.js
|
||||
```
|
||||
|
||||
The script should write `SheetJSAirtable.xlsb`. The file can be opened in Excel.
|
||||
The script will export the data from Airtable to `SheetJSAirtable.xlsb`. The new
|
||||
spreadsheet can be opened in Excel.
|
||||
|
||||
### Importing Data
|
||||
|
||||
@ -361,7 +364,7 @@ Open Airtable and verify the new row was added:
|
||||
[^1]: See [`json_to_sheet` in "Utilities"](/docs/api/utilities/array#array-of-objects-input)
|
||||
[^2]: See ["Workbook Helpers" in "Utilities"](/docs/api/utilities/wb) for details on `book_new` and `book_append_sheet`.
|
||||
[^3]: See [`writeFile` in "Writing Files"](/docs/api/write-options)
|
||||
[^4]: See ["Sheet Objects"](/docs/csf/sheet) for more details/
|
||||
[^4]: See ["Sheet Objects"](/docs/csf/sheet) for more details
|
||||
[^5]: See [`sheet_to_json` in "Utilities"](/docs/api/utilities/array#array-output)
|
||||
[^6]: See ["Workbook Object"](/docs/csf/book)
|
||||
[^7]: See [`readFile` in "Reading Files"](/docs/api/parse-options)
|
||||
|
@ -42,9 +42,9 @@ JavaScriptCore can be built from source and linked in C / C++ programs.
|
||||
| Architecture | Version | Date |
|
||||
|:-------------|:-----------------|:-----------|
|
||||
| `darwin-x64` | `7618.2.12.11.7` | 2025-01-10 |
|
||||
| `darwin-arm` | `7620.2.4.111.7` | 2025-02-13 |
|
||||
| `darwin-arm` | `7620.2.4.111.7` | 2025-04-21 |
|
||||
| `linux-x64` | `7618.2.12.11.7` | 2024-06-22 |
|
||||
| `linux-arm` | `7618.2.12.11.7` | 2024-06-22 |
|
||||
| `linux-arm` | `7620.2.4.111.7` | 2025-04-21 |
|
||||
|
||||
[**Swift Compiled from Source**](#swift-c)
|
||||
|
||||
@ -53,7 +53,7 @@ Swift compiler can link against libraries built from the JavaScriptCore source.
|
||||
| Architecture | Version | Date |
|
||||
|:-------------|:-----------------|:-----------|
|
||||
| `linux-x64` | `7618.2.12.11.7` | 2024-06-22 |
|
||||
| `linux-arm` | `7618.2.12.11.7` | 2024-06-22 |
|
||||
| `linux-arm` | `7620.2.4.111.7` | 2025-04-21 |
|
||||
|
||||
:::
|
||||
|
||||
@ -409,6 +409,20 @@ to `SheetJSwift.xlsx`. That file can be verified by opening in Excel / Numbers.
|
||||
|
||||
### C++
|
||||
|
||||
:::danger pass
|
||||
|
||||
Older versions of this demo recommended downloading the WebKit release archives.
|
||||
|
||||
**Microsoft disabled all WebKit archive downloads!**
|
||||
|
||||
https://codeload.github.com/WebKit/WebKit/zip/refs/tags/WebKit-7620.2.4.111.7 ,
|
||||
when the demo was last tested, returned HTTP 422 `Archive creation is blocked`.
|
||||
|
||||
The updated instructions now clone the repository. An additional 20GB of storage
|
||||
space and 11GB of bandwidth is required to fetch and store the code.
|
||||
|
||||
:::
|
||||
|
||||
0) Install dependencies
|
||||
|
||||
<details>
|
||||
@ -443,12 +457,13 @@ mkdir sheetjs-jsc
|
||||
cd sheetjs-jsc
|
||||
```
|
||||
|
||||
2) Download and extract the WebKit snapshot:
|
||||
2) Clone the WebKit repository and switch to the `WebKit-7620.2.4.111.7` tag:
|
||||
|
||||
```bash
|
||||
curl -LO https://codeload.github.com/WebKit/WebKit/zip/refs/tags/WebKit-7620.2.4.111.7
|
||||
mv WebKit-7620.2.4.111.7 WebKit.zip
|
||||
unzip WebKit.zip
|
||||
git clone https://github.com/WebKit/WebKit.git WebKit
|
||||
cd WebKit
|
||||
git checkout WebKit-7620.2.4.111.7
|
||||
cd ..
|
||||
```
|
||||
|
||||
3) Build JavaScriptCore:
|
||||
@ -457,27 +472,27 @@ unzip WebKit.zip
|
||||
<TabItem value="darwin-x64" label="MacOS">
|
||||
|
||||
```bash
|
||||
cd WebKit-WebKit-7620.2.4.111.7
|
||||
Tools/Scripts/build-webkit --jsc-only --cmakeargs="-DENABLE_STATIC_JSC=ON"
|
||||
cd WebKit
|
||||
env CFLAGS="-Wno-error -Wno-deprecated-declarations" CXXFLAGS="-Wno-error -Wno-deprecated-declarations" LDFLAGS="-framework Foundation" Tools/Scripts/build-webkit --jsc-only --cmakeargs="-Wno-error -DENABLE_STATIC_JSC=ON -DCMAKE_C_FLAGS=\"-Wno-error -Wno-deprecated-declarations\" -DCMAKE_CXX_FLAGS=\"-Wno-error -Wno-deprecated-declarations\"" --make-args="-Wno-error -Wno-deprecated-declarations"
|
||||
cd ..
|
||||
```
|
||||
|
||||
:::danger pass
|
||||
:::note pass
|
||||
|
||||
When this demo was last tested on ARM64 macOS, JIT elicited runtime errors and
|
||||
WebAssembly elicited compile-time errors. WebAssembly and JIT must be disabled:
|
||||
In some test runs on ARM64 macOS, JIT elicited runtime errors and WebAssembly
|
||||
elicited compile-time errors. WebAssembly and JIT should be disabled:
|
||||
|
||||
```bash
|
||||
cd WebKit-WebKit-7620.2.4.111.7
|
||||
env CFLAGS="-Wno-error -Wno-deprecated-declarations" CXXFLAGS="-Wno-error -Wno-deprecated-declarations" LDFLAGS="-framework Foundation" Tools/Scripts/build-webkit --jsc-only --cmakeargs="-Wno-error -DENABLE_STATIC_JSC=ON -DCMAKE_C_FLAGS=\"-Wno-error -Wno-deprecated-declarations\" -DCMAKE_CXX_FLAGS=\"-Wno-error -Wno-deprecated-declarations\"" --no-jit --no-webassembly --make-args="-Wno-error -Wno-deprecated-declarations"
|
||||
cd WebKit
|
||||
env CFLAGS="-Wno-error -Wno-deprecated-declarations" CXXFLAGS="-Wno-error -Wno-deprecated-declarations" LDFLAGS="-framework Foundation" Tools/Scripts/build-webkit --jsc-only --cmakeargs="-Wno-error -DENABLE_STATIC_JSC=ON -DCMAKE_C_FLAGS=\"-Wno-error -Wno-deprecated-declarations\" -DCMAKE_CXX_FLAGS=\"-Wno-error -Wno-deprecated-declarations\"" --make-args="-Wno-error -Wno-deprecated-declarations" --no-jit --no-webassembly
|
||||
cd ..
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
:::caution pass
|
||||
:::note pass
|
||||
|
||||
When this demo was tested on macOS, the build failed with the error message
|
||||
In some test runs, the build failed with the error message
|
||||
|
||||
```
|
||||
Source/WTF/wtf/text/ASCIILiteral.h:65:34: error: use of undeclared identifier 'NSString'
|
||||
@ -502,9 +517,9 @@ namespace WTF {
|
||||
|
||||
:::
|
||||
|
||||
:::caution pass
|
||||
:::note pass
|
||||
|
||||
When this demo was tested, the build failed with the error message
|
||||
In some test runs, the build failed with the error message
|
||||
|
||||
```
|
||||
Source/JavaScriptCore/runtime/JSCBytecodeCacheVersion.cpp:37:10: fatal error: 'wtf/spi/darwin/dyldSPI.h' file not found
|
||||
@ -529,8 +544,8 @@ The `#include` should be changed to a relative directive:
|
||||
<TabItem value="linux-x64" label="Linux">
|
||||
|
||||
```bash
|
||||
cd WebKit-WebKit-7620.2.4.111.7
|
||||
env CFLAGS="-Wno-error=dangling-reference -Wno-dangling-reference" CXXFLAGS="-Wno-error=dangling-reference -Wno-dangling-reference" Tools/Scripts/build-webkit --jsc-only --cmakeargs="-Wno-error -DENABLE_STATIC_JSC=ON -DUSE_THIN_ARCHIVES=OFF -DCMAKE_C_FLAGS=\"-Wno-error -Wno-dangling-reference\" -DCMAKE_CXX_FLAGS=\"-Wno-error -Wno-dangling-reference\"" --make-args="-j1 -Wno-error -Wno-error=dangling-reference" -j1
|
||||
cd WebKit
|
||||
env CFLAGS="-Wno-error=all -Wno-error=volatile-register-var -Wno-dangling-reference" CXXFLAGS="-Wno-error=all -Wno-error=volatile-register-var -Wno-dangling-reference" Tools/Scripts/build-webkit --jsc-only --cmakeargs="-Wno-error=all -Wno-error=volatile-register-var -DENABLE_STATIC_JSC=ON -DUSE_THIN_ARCHIVES=OFF -DCMAKE_C_FLAGS=\"-Wno-error=all -Wno-error=volatile-register-var -Wno-dangling-reference\" -DCMAKE_CXX_FLAGS=\"-Wno-error=all -Wno-error=volatile-register-var \"" --make-args="-j1 -Wno-error=all -Wno-error=volatile-register-var " -j1
|
||||
cd ..
|
||||
```
|
||||
|
||||
@ -540,9 +555,9 @@ When this was last tested on the Steam Deck, the build ran for 24 minutes!
|
||||
|
||||
:::
|
||||
|
||||
:::danger pass
|
||||
:::note pass
|
||||
|
||||
When this demo was last tested on ARM64, there was a dangling pointer error:
|
||||
In some test runs on AArch64 Linux, there was a dangling pointer error:
|
||||
|
||||
<pre>
|
||||
<span {...B}>WebKitBuild/JSCOnly/Release/WTF/Headers/wtf/SentinelLinkedList.h:61:55: <span {...r}>error:</span></span> storing the address of local variable <span {...B}>‘toBeRemoved’</span> in <span {...B}>‘{"*"}MEM[(struct BasicRawSentinelNode {"*"} const &)this_4(D) + 96].WTF::BasicRawSentinelNode<JSC::CallLinkInfoBase>::m_next’</span> [<span style={{...r.style,...B.style}}>-Werror=dangling-pointer=</span>]
|
||||
@ -573,11 +588,56 @@ The error can be suppressed with preprocessor directives around the definition:
|
||||
After patching the header, JSC must be built without WebAssembly or JIT support:
|
||||
|
||||
```bash
|
||||
cd WebKit-WebKit-7620.2.4.111.7
|
||||
env CFLAGS="-Wno-error=dangling-reference -Wno-dangling-reference" CXXFLAGS="-Wno-error=dangling-reference -Wno-dangling-reference" Tools/Scripts/build-webkit --jsc-only --cmakeargs="-Wno-error -DENABLE_STATIC_JSC=ON -DUSE_THIN_ARCHIVES=OFF -DCMAKE_C_FLAGS=\"-Wno-error -Wno-dangling-reference\" -DCMAKE_CXX_FLAGS=-Wno-error -Wno-dangling-reference" --make-args="-j1 -Wno-error -Wno-error=dangling-reference" -j1 --no-jit --no-webassembly
|
||||
cd WebKit
|
||||
env CFLAGS="-Wno-error=all -Wno-error=volatile-register-var -Wno-dangling-reference" CXXFLAGS="-Wno-error=all -Wno-error=volatile-register-var -Wno-dangling-reference" Tools/Scripts/build-webkit --jsc-only --cmakeargs="-Wno-error=all -Wno-error=volatile-register-var -DENABLE_STATIC_JSC=ON -DUSE_THIN_ARCHIVES=OFF -DCMAKE_C_FLAGS=\"-Wno-error=all -Wno-error=volatile-register-var -Wno-dangling-reference\" -DCMAKE_CXX_FLAGS=\"-Wno-error=all -Wno-error=volatile-register-var \"" --make-args="-j1 -Wno-error=all -Wno-error=volatile-register-var " -j1 --no-jit --no-webassembly
|
||||
cd ..
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
:::caution pass
|
||||
|
||||
In some test runs, there was a register error:
|
||||
|
||||
```
|
||||
WebKit/Source/JavaScriptCore/heap/MarkedBlock.cpp: In member function ‘void JSC::MarkedBlock::dumpInfoAndCrashForInvalidHandle(WTF::AbstractLocker&, JSC::HeapCell*)’:
|
||||
WebKit/Source/JavaScriptCore/heap/MarkedBlock.cpp:589:32: error: address of explicit register variable ‘savedActualVM’ requested
|
||||
589 | VMInspector::forEachVM([&](VM& vm) {
|
||||
| ^~~~~~~~~~~~~
|
||||
590 | if (blockVM == &vm) {
|
||||
| ~~~~~~~~~~~~~~~~~~~~~
|
||||
591 | isValidBlockVM = true;
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~
|
||||
592 | SAVE_TO_REG(savedActualVM, &vm);
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
593 | SAVE_TO_REG(savedBitfield, 8);
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
594 | LOG_INVALID_HANDLE_DETAILS("block VM %p is valid\n", &vm);
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
595 | return IterationStatus::Done;
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
596 | }
|
||||
| ~
|
||||
597 | return IterationStatus::Continue;
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
598 | });
|
||||
| ~
|
||||
```
|
||||
|
||||
Until there is a proper upstream fix, the workaround is to explicitly no-op the
|
||||
`SAVE_TO_REG` macro in `MarkedBlock.cpp`:
|
||||
|
||||
```diff title="WebKit/Source/JavaScriptCore/heap/MarkedBlock.cpp (remove red lines)"
|
||||
#endif
|
||||
|
||||
#define SAVE_TO_REG(name, value) do { \
|
||||
- name = WTF::opaque(value); \
|
||||
- WTF::compilerFence(); \
|
||||
} while (false)
|
||||
|
||||
NO_RETURN_DUE_TO_CRASH NEVER_INLINE void MarkedBlock::dumpInfoAndCrashForInvalidHandle(AbstractLocker&, HeapCell* heapCell)
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
</TabItem>
|
||||
@ -586,7 +646,7 @@ cd ..
|
||||
4) Create a symbolic link to the `Release` folder in the source tree:
|
||||
|
||||
```bash
|
||||
ln -s WebKit-WebKit-7620.2.4.111.7/WebKitBuild/JSCOnly/Release/ .
|
||||
ln -s WebKit/WebKitBuild/JSCOnly/Release .
|
||||
```
|
||||
|
||||
5) Download [`sheetjs-jsc.c`](pathname:///jsc/sheetjs-jsc.c):
|
||||
@ -604,6 +664,18 @@ curl -LO https://docs.sheetjs.com/jsc/sheetjs-jsc.c
|
||||
g++ -o sheetjs-jsc sheetjs-jsc.c -IRelease/JavaScriptCore/Headers -LRelease/lib -lbmalloc -licucore -lWTF -lJavaScriptCore -IRelease/JavaScriptCore/Headers -framework Foundation
|
||||
```
|
||||
|
||||
:::note pass
|
||||
|
||||
In some test runs, there were `ld` warnings about `macOS` versions:
|
||||
|
||||
```
|
||||
ld: warning: object file (Release/lib/libWTF.a[2](ASCIICType.cpp.o)) was built for newer 'macOS' version (14.5) than being linked (14.0)
|
||||
```
|
||||
|
||||
These warnings can be ignored.
|
||||
|
||||
:::
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="linux-x64" label="Linux">
|
||||
|
||||
@ -652,7 +724,7 @@ For macOS and iOS deployments, it is strongly encouraged to use the official
|
||||
|
||||
The `linux-x64` test was run on [Ubuntu 22.04 using Swift 5.10.1](https://download.swift.org/swift-5.10.1-release/ubuntu2204/swift-5.10.1-RELEASE/swift-5.10.1-RELEASE-ubuntu22.04.tar.gz)
|
||||
|
||||
The `linux-arm` test was run on [Debian 12 "bookworm" using Swift 5.10.1](https://download.swift.org/swift-5.10.1-release/debian12-aarch64/swift-5.10.1-RELEASE/swift-5.10.1-RELEASE-debian12-aarch64.tar.gz)
|
||||
The `linux-arm` test was run on [Debian 12 "bookworm" using Swift 6.1](https://download.swift.org/swift-6.1-release/debian12-aarch64/swift-6.1-RELEASE/swift-6.1-RELEASE-debian12-aarch64.tar.gz)
|
||||
|
||||
</details>
|
||||
|
||||
@ -683,7 +755,7 @@ curl -LO https://docs.sheetjs.com/pres.numbers`}
|
||||
5) Copy all generated headers to the current directory:
|
||||
|
||||
```bash
|
||||
find ../WebKit-WebKit*/WebKitBuild/JSCOnly/Release/JavaScriptCore/Headers/ -name \*.h | xargs -I '%' cp '%' .
|
||||
find ../WebKit/WebKitBuild/JSCOnly/Release/JavaScriptCore/Headers/ -name \*.h | xargs -I '%' cp '%' .
|
||||
```
|
||||
|
||||
6) Edit each header file and replace all instances of `<JavaScriptCore/` with
|
||||
@ -736,7 +808,7 @@ curl -LO https://docs.sheetjs.com/swift/SheetJSCRaw.swift
|
||||
11) Build `SheetJSwift`:
|
||||
|
||||
```bash
|
||||
swiftc -Xcc -I$(pwd) -Xlinker -L../WebKit-WebKit-7620.2.4.111.7/WebKitBuild/JSCOnly/Release/lib/ -Xlinker -lJavaScriptCore -Xlinker -lWTF -Xlinker -lbmalloc -Xlinker -lstdc++ -Xlinker -latomic -Xlinker -licuuc -Xlinker -licui18n -import-objc-header JavaScriptCore-Bridging-Header.h SheetJSCRaw.swift -o SheetJSwift
|
||||
swiftc -Xcc -I$(pwd) -Xlinker -L../WebKit/WebKitBuild/JSCOnly/Release/lib/ -Xlinker -lJavaScriptCore -Xlinker -lWTF -Xlinker -lbmalloc -Xlinker -lstdc++ -Xlinker -latomic -Xlinker -licuuc -Xlinker -licui18n -import-objc-header JavaScriptCore-Bridging-Header.h SheetJSCRaw.swift -o SheetJSwift
|
||||
```
|
||||
|
||||
12) Run the command:
|
||||
|
@ -45,7 +45,6 @@ These instructions were tested on the following platforms:
|
||||
| Linux (Debian Linux AArch64) | `linux-arm` | 2025-01-14 |
|
||||
| MacOS 15.3 (x64) | `darwin-x64` | 2025-03-31 |
|
||||
| MacOS 15.2 (ARM64) | `darwin-arm` | 2025-03-07 |
|
||||
| Windows 10 (x64) + WSL Ubuntu | `win10-x64` | 2024-07-12 |
|
||||
| Windows 11 (x64) + WSL Ubuntu | `win11-x64` | 2025-01-14 |
|
||||
| Windows 11 (ARM) + WSL Ubuntu | `win11-arm` | 2025-02-23 |
|
||||
|
||||
@ -756,6 +755,15 @@ folder are updated on each version release.
|
||||
|
||||
:::
|
||||
|
||||
### Standalone Scripts
|
||||
|
||||
The standalone script (`xlsx.full.min.js`) includes the `xlsx.js` script, a
|
||||
`cpexcel.js` script from the [`codepage` project](/docs/constellation/codepage),
|
||||
and a few supporting lines of code.
|
||||
|
||||
[`SheetJS/js-codepage`](https://git.sheetjs.com/sheetjs/js-codepage) in the
|
||||
SheetJS Git server includes instructions for generating the `cpexcel.js` script.
|
||||
|
||||
## Tests
|
||||
|
||||
The `test_misc` target runs the targeted feature tests. It should take 5-10
|
||||
|
BIN
docz/static/aws/additional.png
Normal file
After Width: | Height: | Size: 190 KiB |
BIN
docz/static/aws/editor-postload.png
Normal file
After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 82 KiB |
BIN
docz/static/aws/rbps.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
docz/static/aws/runtime.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
docz/static/aws/upload-code.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
docz/static/aws/upload-zip.png
Normal file
After Width: | Height: | Size: 52 KiB |