perf(client): use the platform TextDecoder instead of the text-encoding polyfill
text-encoding was imported for one call in the licence service: new encoding.TextDecoder().decode(value). TextDecoder has been native in every browser this app targets for years, so the polyfill bought nothing and cost 701 kB in the initial bundle (encoding-indexes.js 607 kB + encoding.js 94 kB). Measured on the production build: main 8.96 MB -> 8.41 MB raw, initial total 10.29 MB -> 9.74 MB. The dependency goes with it.
This commit is contained in:
1 parent
e7f1480cd6
commit
0cec3c4f97
3 files changed
+1
-11
No files matched your search
Generated
-8
@@ -50,7 +50,6 @@
|
||||
"save-svg-as-png": "^1.4.17",
|
||||
"stream-browserify": "3.0.0",
|
||||
"stream-http": "3.2.0",
|
||||
"text-encoding": "^0.7.0",
|
||||
"tslib": "^2.3.0",
|
||||
"vm": "^0.1.0",
|
||||
"webpack": "^5.91.0",
|
||||
@@ -24255,13 +24254,6 @@
|
||||
"b4a": "^1.6.4"
|
||||
}
|
||||
},
|
||||
"node_modules/text-encoding": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.7.0.tgz",
|
||||
"integrity": "sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA==",
|
||||
"deprecated": "no longer maintained",
|
||||
"license": "(Unlicense OR Apache-2.0)"
|
||||
},
|
||||
"node_modules/text-table": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||
|
||||
@@ -87,7 +87,6 @@
|
||||
"save-svg-as-png": "^1.4.17",
|
||||
"stream-browserify": "3.0.0",
|
||||
"stream-http": "3.2.0",
|
||||
"text-encoding": "^0.7.0",
|
||||
"tslib": "^2.3.0",
|
||||
"vm": "^0.1.0",
|
||||
"webpack": "^5.91.0",
|
||||
|
||||
@@ -4,7 +4,6 @@ import { LicenseKeyData } from '../models/LicenseKeyData'
|
||||
import { SasService } from './sas.service'
|
||||
import moment from 'moment'
|
||||
import * as base64Converter from 'base64-arraybuffer'
|
||||
import * as encoding from 'text-encoding'
|
||||
import { Router } from '@angular/router'
|
||||
import { Globvar } from '../models/sas/public-startupservice.model'
|
||||
import { freeTierConfig } from '../free-tier.config'
|
||||
@@ -360,7 +359,7 @@ export class LicenceService {
|
||||
)
|
||||
.then(
|
||||
(value: any) => {
|
||||
let keyDataString = new encoding.TextDecoder().decode(value)
|
||||
let keyDataString = new TextDecoder().decode(value)
|
||||
|
||||
try {
|
||||
resolve(JSON.parse(keyDataString))
|
||||
|
||||
Reference in new issue
Block a user