forked from sheetjs/docs.sheetjs.com
		
	ionic
This commit is contained in:
		
							parent
							
								
									6baef4dae7
								
							
						
					
					
						commit
						af187640fa
					
				| @ -40,31 +40,6 @@ import * as cptable from 'https://cdn.sheetjs.com/xlsx-${current}/package/dist/c | ||||
| XLSX.set_cptable(cptable);`} | ||||
| </code></pre> | ||||
| 
 | ||||
| ## Node Compatibility Mode | ||||
| 
 | ||||
| :::caution | ||||
| 
 | ||||
| Node Compatibility Mode is useful for migrating existing NodeJS scripts to Deno. | ||||
| It is considered unstable by the platform developers. | ||||
| 
 | ||||
| For greenfield Deno projects, HTTP imports are strongly recommended. | ||||
| 
 | ||||
| ::: | ||||
| 
 | ||||
| The ["NodeJS" installation section](/docs/getting-started/installation/nodejs) | ||||
| includes instructions for installing the NodeJS package. | ||||
| 
 | ||||
| After installing, the `std/node` require can be used directly: | ||||
| 
 | ||||
| ```ts | ||||
| /* load the `require` machinery */ | ||||
| import { createRequire } from "https://deno.land/std/node/module.ts"; | ||||
| const require = createRequire(import.meta.url); | ||||
| 
 | ||||
| /* require the library */ | ||||
| const XLSX = require("xlsx"); | ||||
| ``` | ||||
| 
 | ||||
| ## Upgrade Notes | ||||
| 
 | ||||
| Upgrading to the latest version involves changing the import URLs.  The import | ||||
|  | ||||
| @ -14,10 +14,15 @@ The "Complete Example" creates an app that looks like the screenshots below: | ||||
| 
 | ||||
| <table><thead><tr> | ||||
|   <th><a href="#demo">iOS</a></th> | ||||
|   <th><a href="#demo">Android</a></th> | ||||
| </tr></thead><tbody><tr><td> | ||||
| 
 | ||||
|  | ||||
| 
 | ||||
| </td><td> | ||||
| 
 | ||||
|  | ||||
| 
 | ||||
| </td></tr></tbody></table> | ||||
| 
 | ||||
| 
 | ||||
| @ -99,11 +104,13 @@ this.file.writeFile(url, filename, blob, {replace: true}); | ||||
| 
 | ||||
| :::note | ||||
| 
 | ||||
| This demo was tested on an Intel Mac on 2023 March 19 with Cordova. | ||||
| This demo was tested on an Intel Mac on 2023 March 28 with Cordova. | ||||
| The file integration uses `@ionic-native/file` version `5.36.0`. | ||||
| 
 | ||||
| The iOS simulator runs iOS 16.5 on an iPhone SE (3rd Generation). | ||||
| 
 | ||||
| The Android simulator runs Android 12.0 (S) API 31 on a Pixel 3. | ||||
| 
 | ||||
| ::: | ||||
| 
 | ||||
| 0) Disable telemetry as noted in the warning. | ||||
| @ -111,7 +118,7 @@ The iOS simulator runs iOS 16.5 on an iPhone SE (3rd Generation). | ||||
| Install required global dependencies: | ||||
| 
 | ||||
| ```bash | ||||
| npm i -g cordova-res @angular/cli native-run | ||||
| npm i -g cordova-res @angular/cli native-run @ionic/cli | ||||
| ``` | ||||
| 
 | ||||
| Follow the [React Native demo](/docs/demos/mobile/reactnative) to ensure iOS and Android sims are ready. | ||||
| @ -120,7 +127,7 @@ Follow the [React Native demo](/docs/demos/mobile/reactnative) to ensure iOS and | ||||
| 1) Create a new project: | ||||
| 
 | ||||
| ```bash | ||||
| npx @ionic/cli start SheetJSIonic blank --type angular --cordova --quiet --no-git --no-link --confirm | ||||
| ionic start SheetJSIonic blank --type angular --cordova --quiet --no-git --no-link --confirm | ||||
| ``` | ||||
| 
 | ||||
| If a prompt asks to confirm Cordova use, enter `Yes` to continue. | ||||
| @ -131,28 +138,48 @@ If a prompt asks about creating an Ionic account, enter `N` to opt out. | ||||
| 
 | ||||
| ```bash | ||||
| cd SheetJSIonic | ||||
| npx @ionic/cli cordova platform add ios --confirm | ||||
| npx @ionic/cli cordova plugin add cordova-plugin-file | ||||
| ionic cordova plugin add cordova-plugin-file | ||||
| ionic cordova platform add ios --confirm | ||||
| ionic cordova platform add android --confirm | ||||
| npm install --save @ionic-native/core @ionic-native/file @ionic/cordova-builders | ||||
| ``` | ||||
| 
 | ||||
| :::caution | ||||
| :::note | ||||
| 
 | ||||
| In some test runs, the `plugin add cordova-plugin-file` step reported an error: | ||||
| If `cordova-plugin-file` is added before the platforms, installation may fail: | ||||
| 
 | ||||
| ``` | ||||
| CordovaError: Could not load API for ios project | ||||
| ``` | ||||
| 
 | ||||
| This was resolved by removing and reinstalling the `ios` platform: | ||||
| This can be resolved by removing and reinstalling the `ios` platform: | ||||
| 
 | ||||
| ```bash | ||||
| npx @ionic/cli cordova platform rm ios | ||||
| npx @ionic/cli cordova platform add ios --confirm | ||||
| ionic cordova platform rm ios | ||||
| ionic cordova platform add ios --confirm | ||||
| ``` | ||||
| 
 | ||||
| ::: | ||||
| 
 | ||||
| :::caution | ||||
| 
 | ||||
| If the `npm install` fails due to `rxjs` resolution, add the highlighted lines | ||||
| to `package.json` to force a resolution: | ||||
| 
 | ||||
| ```js title="package.json" | ||||
|   "private": true, | ||||
|   // highlight-start | ||||
|   "overrides": { | ||||
|     "rxjs": "~7.5.0" | ||||
|   }, | ||||
|   // highlight-end | ||||
|   "dependencies": { | ||||
| ``` | ||||
| 
 | ||||
| After adding the lines, the `npm install` command will succeed. | ||||
| 
 | ||||
| ::: | ||||
| 
 | ||||
| 3) Install dependencies: | ||||
| 
 | ||||
| ```bash | ||||
| @ -188,7 +215,7 @@ curl -o src/app/home/home.page.ts -L https://docs.sheetjs.com/ionic/home.page.ts | ||||
| **iOS Testing** | ||||
| 
 | ||||
| ```bash | ||||
| npx @ionic/cli cordova emulate ios | ||||
| ionic cordova emulate ios | ||||
| ``` | ||||
| 
 | ||||
| :::caution | ||||
| @ -207,3 +234,25 @@ npm i --save cordova-ios | ||||
| ``` | ||||
| 
 | ||||
| ::: | ||||
| 
 | ||||
| **Android Testing** | ||||
| 
 | ||||
| ```bash | ||||
| ionic cordova emulate android | ||||
| ``` | ||||
| 
 | ||||
| :::caution | ||||
| 
 | ||||
| In some test runs, `cordova build android --emulator` step failed with error: | ||||
| 
 | ||||
| ``` | ||||
| Could not find or parse valid build output file | ||||
| ``` | ||||
| 
 | ||||
| This was resolved by forcefully installing `cordova-android`: | ||||
| 
 | ||||
| ```bash | ||||
| npm i --save cordova-android | ||||
| ``` | ||||
| 
 | ||||
| ::: | ||||
|  | ||||
| @ -6,12 +6,6 @@ title: Overview | ||||
| 
 | ||||
| # SheetJS CE | ||||
| 
 | ||||
|  | ||||
| [](https://github.com/SheetJS/sheetjs/actions/workflows/node-4+.yml) | ||||
| [](https://snyk.io/test/github/SheetJS/sheetjs) | ||||
| [](https://cdn.sheetjs.com/) | ||||
| [](https://github.com/SheetJS/sheetjs) | ||||
| 
 | ||||
| SheetJS Community Edition offers battle-tested open-source solutions for | ||||
| extracting useful data from almost any complex spreadsheet and generating new | ||||
| spreadsheets that will work with legacy and modern software alike. | ||||
|  | ||||
							
								
								
									
										
											BIN
										
									
								
								docz/static/ionic/and.png
									
									
									
									
									
										Normal file
									
								
							
							
								
									
								
								
								
								
								
									
									
								
							
						
						
									
										
											BIN
										
									
								
								docz/static/ionic/and.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 86 KiB | 
		Loading…
	
		Reference in New Issue
	
	Block a user