Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
],
plugins: ['babel-plugin-transform-import-meta'],
},
},
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bldrs",
"version": "1.0.1805",
"version": "1.0.1809",
"main": "src/index.jsx",
"license": "AGPL-3.0",
"homepage": "https://github.com/bldrs-ai/Share",
Expand All @@ -14,7 +14,7 @@
"build-conway-debug": "yarn clean && yarn build-share-conway && yarn build-share-copy-wasm-conway-profile",
"build-webifc": "yarn clean && yarn build-share-webifc",
"build-cosmos": "shx mkdir -p docs && shx rm -rf docs/cosmos && cosmos-export --config .cosmos.config.json && shx mv cosmos-export docs/cosmos",
"build-share": "yarn update-version && node tools/esbuild/build.js && shx mkdir -p docs/static/js && shx cp src/OPFS/OPFS.worker.js docs/ && shx cp src/net/github/Cache.js docs/ && yarn build-share-copy-wasm-conway-MT",
"build-share": "yarn update-version && node tools/esbuild/build.js && shx mkdir -p docs/static/js && yarn build-share-copy-wasm-conway-MT",
"build-share-conway": "run-script-os",
"build-share-conway:win32": "set USE_WEBIFC_SHIM=true && yarn build-share",
"build-share-conway:linux:darwin": "USE_WEBIFC_SHIM=true yarn build-share",
Expand Down Expand Up @@ -141,6 +141,7 @@
"@typescript-eslint/eslint-plugin": "5.59.0",
"@typescript-eslint/parser": "5.59.0",
"babel-jest": "28.1.3",
"babel-plugin-transform-import-meta": "^2.3.3",
"eslint": "8.22.0",
"eslint-config-google": "0.14.0",
"eslint-import-resolver-typescript": "3.5.2",
Expand Down
9 changes: 5 additions & 4 deletions src/OPFS/OPFS.worker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let GITHUB_BASE_URL_AUTHENTICATED = null
let GITHUB_BASE_URL_UNAUTHENTICATED = null
import * as CacheModule from '../net/github/Cache.js'


/**
* @global
Expand All @@ -9,8 +9,9 @@ let GITHUB_BASE_URL_UNAUTHENTICATED = null

/* global FileSystemDirectoryHandle, FileSystemFileHandle, FileSystemSyncAccessHandle */

/* global importScripts, CacheModule */
importScripts('./Cache.js')
let GITHUB_BASE_URL_AUTHENTICATED = null
let GITHUB_BASE_URL_UNAUTHENTICATED = null


self.addEventListener('message', async (event) => {
try {
Expand Down
7 changes: 4 additions & 3 deletions src/OPFS/OPFSService.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ let workerRef = null
* Initializes and returns a reference to a web worker.
*
* Checks if a web worker reference already exists; if not, it creates a new web worker
* instance using the specified script path ('/OPFS.Worker.js'). This ensures that only one
* instance of the worker is created and reused across the application, optimizing resource usage.
* instance using the specified script path. This ensures that only one instance of the
* worker is created and reused across the application, optimizing resource usage.
* Uses ESM module worker with {type: 'module'}.
*
* @return {Worker} The reference to the initialized web worker.
*/
export function initializeWorker() {
if (workerRef === null) {
workerRef = new Worker('/OPFS.Worker.js')
workerRef = new Worker(new URL('/OPFS.Worker.js', import.meta.url), {type: 'module'})

workerRef.postMessage({
command: 'initializeWorker',
Expand Down
Loading
Loading