Skip to content

Commit

Permalink
upd: bump dash
Browse files Browse the repository at this point in the history
This update makes Dash more than 2x faster
  • Loading branch information
solvedDev committed Sep 23, 2022
1 parent 464f0bc commit a511e36
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 19 deletions.
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@
window.process = {
cwd: () => '',
env: {},
release: {
name: 'browser',
},
}
self.setImmediate = setTimeout
</script>
Expand Down
29 changes: 16 additions & 13 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"@types/lz-string": "^1.3.34",
"bridge-common-utils": "^0.3.3",
"bridge-iframe-api": "^0.4.7",
"bridge-js-runtime": "^0.3.4",
"bridge-js-runtime": "^0.3.6",
"bridge-model-viewer": "^0.7.7",
"buffer": "^6.0.3",
"color-convert": "^2.0.1",
"comlink": "^4.3.0",
"compare-versions": "^3.6.0",
"core-js": "^3.6.5",
"dash-compiler": "^0.9.29",
"dash-compiler": "^0.10.1",
"escape-string-regexp": "^5.0.0",
"fflate": "^0.6.7",
"idb-keyval": "^5.1.3",
Expand Down
4 changes: 4 additions & 0 deletions src/components/Compiler/Worker/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
globalThis.process = {
cwd: () => '',
env: {},
release: {
name: 'browser',
},
}

import '/@/components/FileSystem/Virtual/Comlink'
Expand Down Expand Up @@ -72,6 +75,7 @@ export class DashService extends EventDispatcher<void> {
mode: options.mode,
fileType: this.fileType,
packType: new PackTypeLibrary(),
verbose: true,
requestJsonData: (path) => dataLoader.readJSON(path),
})

Expand Down
12 changes: 8 additions & 4 deletions src/components/FileSystem/FileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class FileSystem extends Signal<void> {
dirHandle = await dirHandle

const files: { name: string; path: string; kind: string }[] = []
const promises = []

for await (const handle of dirHandle.values()) {
if (handle.kind === 'file' && handle.name === '.DS_Store') continue
Expand All @@ -146,15 +147,18 @@ export class FileSystem extends Signal<void> {
kind: handle.kind,
path: `${path}/${handle.name}`,
})
else if (handle.kind === 'directory')
files.push(
...(await this.readFilesFromDir(
else if (handle.kind === 'directory') {
promises.push(
this.readFilesFromDir(
`${path}/${handle.name}`,
handle
))
).then((subFiles) => files.push(...subFiles))
)
}
}

await Promise.allSettled(promises)

return files
}

Expand Down
3 changes: 3 additions & 0 deletions src/components/FindAndReplace/Worker/Worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
globalThis.process = {
cwd: () => '',
env: {},
release: {
name: 'browser',
},
}

import '/@/components/FileSystem/Virtual/Comlink'
Expand Down
3 changes: 3 additions & 0 deletions src/components/PackIndexer/Worker/Main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
globalThis.process = {
cwd: () => '',
env: {},
release: {
name: 'browser',
},
}

import '/@/components/FileSystem/Virtual/Comlink'
Expand Down

0 comments on commit a511e36

Please sign in to comment.