Skip to content

Commit c92bc38

Browse files
committed
perf(electron-updater): a little bit more compact blockmap data
Doesn't make a lot of sense since in any case deflated, but anyway
1 parent 586140d commit c92bc38

File tree

14 files changed

+203
-176
lines changed

14 files changed

+203
-176
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
"////": "All typings are added into root `package.json` to avoid duplication errors in the IDE compiler (several `node.d.ts` files).",
3030
"dependencies": {
3131
"7zip-bin": "^2.2.7",
32-
"archiver": "^2.0.3",
32+
"archiver": "^2.1.0",
3333
"async-exit-hook": "^2.0.1",
34-
"aws-sdk": "^2.132.0",
34+
"aws-sdk": "^2.133.0",
3535
"bluebird-lst": "^1.0.4",
3636
"chalk": "^2.1.0",
3737
"chromium-pickle-js": "^0.2.0",
@@ -112,7 +112,7 @@
112112
"ts-babel": "^4.1.6",
113113
"ts-jsdoc": "^2.0.6",
114114
"tslint": "^5.7.0",
115-
"typescript": "^2.5.3",
115+
"typescript": "^2.6.0-rc",
116116
"v8-compile-cache": "^1.1.0",
117117
"whitespace": "^2.1.0",
118118
"worker-farm": "^1.5.0",

packages/app-package-builder/src/blockMap.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ export async function createDifferentialPackage(archiveFile: string): Promise<Pa
4444
}
4545

4646
async function appendBlockMapData(blockMap: BlockMap, archiveFile: string, fd: number, headerSize: number | null, addLength: boolean) {
47-
const blockMapDataString = safeDump(blockMap)
47+
// lzma doesn't make a lof of sense (151 KB lzma vs 156 KB deflate) for small text file where most of the data are unique strings (encoded sha256 checksums)
48+
const blockMapDataString = safeDump(blockMap, {
49+
indent: 0,
50+
flowLevel: 0,
51+
})
4852
const blockMapFileData = await deflateRaw(blockMapDataString, {level: 9})
4953

5054
await write(fd, blockMapFileData)

packages/builder-util-runtime/src/CancellationToken.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class CancellationToken extends EventEmitter {
4242
}
4343
}
4444

45-
createPromise<R>(callback: (resolve: (thenableOrResult?: R) => void, reject: (error?: Error) => void, onCancel: (callback: () => void) => void) => void): Promise<R> {
45+
createPromise<R>(callback: (resolve: (thenableOrResult?: R) => void, reject: (error: Error) => void, onCancel: (callback: () => void) => void) => void): Promise<R> {
4646
if (this.cancelled) {
4747
return BluebirdPromise.reject<R>(new CancellationError())
4848
}

packages/builder-util-runtime/src/httpExecutor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export abstract class HttpExecutor<REQUEST> {
8181
})
8282
}
8383

84-
addErrorAndTimeoutHandlers(request: any, reject: (error?: Error | null) => void) {
84+
addErrorAndTimeoutHandlers(request: any, reject: (error: Error) => void) {
8585
this.addTimeOutHandler(request, reject)
8686
request.on("error", reject)
8787
request.on("aborted", () => {

packages/builder-util-runtime/src/uuid.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export class UUID {
4040
private ascii: string | null
4141
private binary: Buffer
4242
private version: number
43-
private variant: string
4443

4544
// from rfc4122#appendix-C
4645
static readonly DNS = new UUID("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
@@ -55,7 +54,6 @@ export class UUID {
5554
}
5655

5756
this.version = check.version!!
58-
this.variant = check.variant!!
5957

6058
if (check.format === "ascii") {
6159
this.ascii = uuid as string

packages/builder-util/src/nodeHttpExecutor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class NodeHttpExecutor extends HttpExecutor<ClientRequest> {
2424
this.doDownload(configureRequestOptionsFromUrl(url, {
2525
headers: options.headers || undefined,
2626
agent,
27-
}), destination, 0, options, (error: Error) => {
27+
}), destination, 0, options, error => {
2828
if (error == null) {
2929
resolve(destination)
3030
}

packages/electron-builder-squirrel-windows/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"builder-util": "^0.0.0-semantic-release",
1515
"bluebird-lst": "^1.0.4",
1616
"fs-extra-p": "^4.4.4",
17-
"archiver": "^2.0.3",
17+
"archiver": "^2.1.0",
1818
"sanitize-filename": "^1.6.1"
1919
},
2020
"peerDependencies": {

packages/electron-builder/src/targets/appx.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import BluebirdPromise from "bluebird-lst"
2-
import { Arch, asArray, use, log, debug } from "builder-util"
2+
import { Arch, asArray, log, debug } from "builder-util"
33
import { walk, copyOrLinkFile } from "builder-util/out/fs"
44
import { emptyDir, readdir, readFile, remove, writeFile } from "fs-extra-p"
55
import * as path from "path"
@@ -105,7 +105,9 @@ export default class AppXTarget extends Target {
105105
await writeFile(mappingFile, mapping)
106106
packager.debugLogger.add("appx.mapping", mapping)
107107

108-
use(this.options.makeappxArgs, (it: Array<string>) => makeAppXArgs.push(...it))
108+
if (this.options.makeappxArgs != null) {
109+
makeAppXArgs.push(...this.options.makeappxArgs)
110+
}
109111
await vm.exec(vm.toVmFile(path.join(vendorPath, "windows-10", Arch[arch], "makeappx.exe")), makeAppXArgs)
110112
await packager.sign(artifactPath)
111113

packages/electron-publisher-s3/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
],
1313
"dependencies": {
1414
"fs-extra-p": "^4.4.4",
15-
"aws-sdk": "^2.132.0",
15+
"aws-sdk": "^2.133.0",
1616
"mime": "^2.0.3",
1717
"electron-publish": "~0.0.0-semantic-release",
1818
"builder-util": "^0.0.0-semantic-release",

packages/electron-updater/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 2.12.0
2+
3+
### Features
4+
5+
* [Linux auto-update](https://github.com/electron-userland/electron-builder/releases/tag/v19.37.0)
6+
17
# 2.11.0
28

39
### Features

0 commit comments

Comments
 (0)