Skip to content

Commit

Permalink
Fix android logging with polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
islathehut committed May 15, 2024
1 parent d5fecbd commit 84696a7
Show file tree
Hide file tree
Showing 6 changed files with 208 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@
"dotenv": "8.2.0",
"events": "^3.2.0",
"express": "^4.17.1",
"fetch-retry": "^6.0.0",
"node-fetch": "^3.3.0",
"fastq": "^1.17.1",
"fetch-retry": "^6.0.0",
"get-port": "^5.1.1",
"go-ipfs": "npm:mocked-go-ipfs@0.17.0",
"http-server": "^0.12.3",
Expand All @@ -124,6 +123,7 @@
"libp2p": "0.42.2",
"luxon": "^3.4.4",
"multiaddr": "^10.0.1",
"node-fetch": "^3.3.0",
"orbit-db": "0.29.0",
"orbit-db-access-controllers": "^0.4.0",
"orbit-db-identity-provider": "0.5.0",
Expand Down
181 changes: 181 additions & 0 deletions packages/common/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"typescript": "^4.9.3"
},
"dependencies": {
"@formatjs/intl-datetimeformat": "^6.12.3",
"@formatjs/intl-getcanonicallocales": "^2.3.0",
"@formatjs/intl-locale": "^3.4.5",
"@quiet/logger": "^2.0.2-alpha.0",
"@quiet/types": "^2.0.2-alpha.1",
"cross-env": "^5.2.0",
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export * from './auth'
export * from './messages'
export * from './compare'
export * from './dir'
export * from './polyfill'
20 changes: 20 additions & 0 deletions packages/common/src/polyfill.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { shouldPolyfill as shouldPolyfillCanon } from '@formatjs/intl-getcanonicallocales/should-polyfill'
import { shouldPolyfill as shouldPolyfillLocale } from '@formatjs/intl-locale/should-polyfill'
import { shouldPolyfill as shouldPolyFillFormat } from '@formatjs/intl-datetimeformat/should-polyfill'

function polyfill() {
if (shouldPolyfillCanon()) {
require('@formatjs/intl-getcanonicallocales/polyfill')
}

if (shouldPolyfillLocale()) {
require('@formatjs/intl-locale/polyfill')
}

if (shouldPolyFillFormat()) {
require('@formatjs/intl-datetimeformat/polyfill')
require('@formatjs/intl-datetimeformat/locale-data/en')
}
}

polyfill()
2 changes: 1 addition & 1 deletion packages/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"events": "^1.1.1",
"fast-text-encoding": "^1.0.6",
"i18next": "^20.2.2",
"react-intl": "^6.6.6",
"jdenticon": "^3.2.0",
"loadash": "^1.0.0",
"luxon": "^3.4.4",
Expand All @@ -49,6 +48,7 @@
"react": "18.2.0",
"react-dom": "18.1.0",
"react-i18next": "^11.8.15",
"react-intl": "^6.6.6",
"react-linkify": "^1.0.0-alpha",
"react-native": "0.73.2",
"react-native-blob-util": "^0.19.6",
Expand Down

0 comments on commit 84696a7

Please sign in to comment.