Skip to content

Commit

Permalink
fix(ssr): load tfjs cpu in ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitMY committed Sep 24, 2023
1 parent 7c8871b commit 0847431
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 52 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ npm test
Run the application on iOS:

```bash
npm run build
npx cap sync
npx cap run ios
bun run build
bun x cap sync
bun x cap run ios
```

[node.js]: https://nodejs.org/
Expand Down
18 changes: 9 additions & 9 deletions functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
},
"devDependencies": {
"@firebase/firestore-types": "^3.0.0",
"@firebase/rules-unit-testing": "^3.0.0",
"@types/http-errors": "^2.0.1",
"@types/jest": "29.5.4",
"@types/node-fetch": "^2.6.4",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"eslint": "^8.49.0",
"@firebase/rules-unit-testing": "^3.0.1",
"@types/http-errors": "^2.0.2",
"@types/jest": "29.5.5",
"@types/node-fetch": "^2.6.6",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"eslint": "^8.50.0",
"firebase-functions-test": "^3.1.0",
"firebase-tools": "^12.5.3",
"jest": "^29.6.4",
"firebase-tools": "^12.5.4",
"jest": "^29.7.0",
"mock-express-request": "^0.2.2",
"mock-express-response": "^0.3.0",
"ts-jest": "^29.1.1",
Expand Down
14 changes: 7 additions & 7 deletions ios/App/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PODS:
- Capacitor (5.3.0):
- Capacitor (5.4.1):
- CapacitorCordova
- CapacitorBlobWriter (0.0.1):
- Capacitor
- GCDWebServer (~> 3.0)
- CapacitorCordova (5.3.0)
- CapacitorFilesystem (5.1.3):
- CapacitorCordova (5.4.1)
- CapacitorFilesystem (5.1.4):
- Capacitor
- CapacitorFirebaseAnalytics (5.1.0):
- Capacitor
Expand Down Expand Up @@ -210,10 +210,10 @@ EXTERNAL SOURCES:
:path: "../../node_modules/@capacitor/splash-screen"

SPEC CHECKSUMS:
Capacitor: 1ac9165943bc4f2137642d218c5ba05df811de69
Capacitor: 4c0681b47eebeba1f902093d24149cf2f518393e
CapacitorBlobWriter: 110eeaf80611f19bf01a8a05ff3672149ed0baad
CapacitorCordova: b9374d68e63ce29e96ab5db994cf14fbefd722c9
CapacitorFilesystem: 9b4641db3d6d62b6cc1bf0a6a09681ebaea696b7
CapacitorCordova: 1222fdd78bfd0d323cc22bf254eed1484fe6c92a
CapacitorFilesystem: af704badfbc69f6f8623d9ed313e5490e3723dcb
CapacitorFirebaseAnalytics: 8e42f3392e19f4331e21be373f4520412487bb69
CapacitorFirebaseApp: 472cf2609c0dd2219cbdc124962d7f939d038873
CapacitorFirebaseCrashlytics: 65b525728268133c68f49567f95eb94320f32140
Expand Down Expand Up @@ -241,4 +241,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: d5797d5ec75023063cb4c657a32466e329f8bec8

COCOAPODS: 1.12.1
COCOAPODS: 1.13.0
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@
"@capacitor-firebase/app": "5.1.0",
"@capacitor-firebase/crashlytics": "5.1.0",
"@capacitor-firebase/performance": "5.1.0",
"@capacitor/android": "5.3.0",
"@capacitor/core": "5.3.0",
"@capacitor/filesystem": "5.1.3",
"@capacitor/ios": "5.3.0",
"@capacitor/android": "5.4.1",
"@capacitor/core": "5.4.1",
"@capacitor/filesystem": "5.1.4",
"@capacitor/ios": "5.4.1",
"@capacitor/keyboard": "5.0.6",
"@capacitor/share": "5.0.6",
"@capacitor/splash-screen": "5.0.6",
"@ctrl/ngx-github-buttons": "9.0.0",
"@google/model-viewer": "3.2.1",
"@ionic/angular": "7.3.3",
"@ionic/angular": "7.4.1",
"@mediapipe/drawing_utils": "0.3.1675466124",
"@mediapipe/holistic": "0.5.1675471629",
"@ngneat/transloco": "4.3.0",
Expand All @@ -69,20 +69,20 @@
"@sign-mt/i18n": "git://github.com/sign/i18n.git",
"@sutton-signwriting/font-ttf": "1.5.0",
"@sutton-signwriting/sgnw-components": "1.1.0",
"@tensorflow/tfjs": "4.10.0",
"@tensorflow/tfjs-backend-wasm": "4.10.0",
"@tensorflow/tfjs-backend-webgl": "4.10.0",
"@tensorflow/tfjs-backend-webgpu": "4.10.0",
"@tensorflow/tfjs-converter": "4.10.0",
"@tensorflow/tfjs-core": "4.10.0",
"@tensorflow/tfjs-layers": "4.10.0",
"@tensorflow/tfjs": "4.11.0",
"@tensorflow/tfjs-backend-wasm": "4.11.0",
"@tensorflow/tfjs-backend-webgl": "4.11.0",
"@tensorflow/tfjs-backend-webgpu": "4.11.0",
"@tensorflow/tfjs-converter": "4.11.0",
"@tensorflow/tfjs-core": "4.11.0",
"@tensorflow/tfjs-layers": "4.11.0",
"base64-blob": "1.4.1",
"capacitor-blob-writer": "1.1.14",
"cld3-asm": "3.1.1",
"comlink": "4.4.1",
"filesize": "9.0.11",
"firebase": "10.3.1",
"flag-icons": "6.11.0",
"firebase": "10.4.0",
"flag-icons": "6.11.1",
"ionicons": "7.1.2",
"leaflet": "1.9.4",
"ngx-filesize": "3.0.2",
Expand All @@ -92,7 +92,7 @@
"three": "0.156.1",
"tslib": "2.6.2",
"web-vitals": "3.4.0",
"zone.js": "0.13.1"
"zone.js": "0.14.0"
},
"devDependencies": {
"@angular-devkit/architect": "0.1602.1",
Expand All @@ -111,20 +111,20 @@
"@playwright/test": "1.37.1",
"@sign-mt/configuration": "git://github.com/sign/.github.git",
"@trapezedev/project": "7.0.10",
"@types/dom-mediacapture-transform": "0.1.6",
"@types/dom-speech-recognition": "0.0.1",
"@types/dom-mediacapture-transform": "0.1.7",
"@types/dom-speech-recognition": "0.0.2",
"@types/dom-webcodecs": "0.1.5",
"@types/jasmine": "4.3.5",
"@types/jasminewd2": "2.0.10",
"@types/jasmine": "4.3.6",
"@types/jasminewd2": "2.0.11",
"@types/offscreencanvas": "2019.7.1",
"@types/three": "0.155.1",
"@types/web-app-manifest": "1.0.4",
"@types/webgl2": "0.0.7",
"@typescript-eslint/eslint-plugin": "6.6.0",
"@typescript-eslint/parser": "6.6.0",
"@typescript-eslint/eslint-plugin": "6.7.2",
"@typescript-eslint/parser": "6.7.2",
"deepmerge": "4.3.1",
"dotenv": "16.3.1",
"eslint": "8.49.0",
"eslint": "8.50.0",
"fuzzy": "0.1.3",
"husky": "8.0.3",
"inquirer": "9.2.11",
Expand All @@ -146,7 +146,7 @@
"sitemap": "7.1.1",
"tiny-async-pool": "2.1.0",
"ts-node": "10.9.1",
"tsx": "3.12.8",
"tsx": "3.12.10",
"typescript": "5.0.4",
"webpack-bundle-analyzer": "4.9.1",
"zod": "3.22.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*ngIf="!supportError"
[attr.aria-label]="t(isRecording ? 'stop' : 'start')"
[matTooltip]="t(isRecording ? 'stop' : 'start')"
matTooltipPosition="above">
[matTooltipPosition]="matTooltipPosition">
<ion-icon [name]="isRecording ? 'stop-circle-outline' : 'mic-outline'" slot="icon-only" color="primary"></ion-icon>
</ion-button>

Expand All @@ -22,7 +22,7 @@
*ngIf="supportError"
[attr.aria-label]="t(supportError)"
[matTooltip]="t(supportError)"
matTooltipPosition="above">
[matTooltipPosition]="matTooltipPosition">
<ion-icon name="mic-off-outline" slot="icon-only"></ion-icon>
</ion-button>
</ng-container>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';
import {fromEvent} from 'rxjs';
import {BaseComponent} from '../base/base.component';
import {isSafari} from '../../core/constants';
import {TooltipPosition} from '@angular/material/tooltip';

@Component({
selector: 'app-speech-to-text',
Expand All @@ -11,6 +11,7 @@ import {isSafari} from '../../core/constants';
export class SpeechToTextComponent extends BaseComponent implements OnInit, OnChanges {
@Input() lang = 'en';
@Output() changeText: EventEmitter<string> = new EventEmitter<string>();
@Input() matTooltipPosition: TooltipPosition = 'above';

SpeechRecognition = globalThis.SpeechRecognition || globalThis.webkitSpeechRecognition;
speechRecognition!: SpeechRecognition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class SignedLanguageOutputComponent extends BaseComponent implements OnIn
this.pose$ = this.store.select<string>(state => state.translate.signedLanguagePose);
this.video$ = this.store.select<string>(state => state.translate.signedLanguageVideo);

this.isSharingSupported = Capacitor.isNativePlatform() || 'share' in navigator;
this.isSharingSupported = Capacitor.isNativePlatform() || ('navigator' in globalThis && 'share' in navigator);
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
[attr.data-gramm_editor]="false"></ion-textarea>

<ion-buttons slot="end">
<app-speech-to-text [lang]="spokenLanguage" (changeText)="text.setValue($event)"></app-speech-to-text>
<app-speech-to-text
[lang]="spokenLanguage"
(changeText)="text.setValue($event)"
matTooltipPosition="before"></app-speech-to-text>
</ion-buttons>
</ion-toolbar>
</ng-container>
7 changes: 2 additions & 5 deletions update-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Update client dependencies
rm package-lock.json
bun x npm-check-updates --cacheClear -u --reject filesize,@types/dom-webcodecs,typescript,@ngneat/transloco,@types/three
bun x npm-check-updates --cacheClear -u --reject filesize,@types/dom-webcodecs,typescript,@ngneat/transloco,@types/three,@playwright/test
bun install
git add package-lock.json

# TODO: @ngneat/transloco needs to be updated to v5, not sure what changed
# TODO @types/three 0.156 is buggy for us
# TODO @playwright/test 0.140 is buggy for us until updating typescript probably

# Update server dependencies
rm functions/package-lock.json
bun x npm-check-updates --cacheClear --cwd functions -u --reject node-fetch
cd functions && bun install && cd ..
git add functions/package-lock.json

0 comments on commit 0847431

Please sign in to comment.