Skip to content

Commit

Permalink
appselect default value fix nit + editor workers are url based
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Sep 12, 2024
1 parent 03a2eae commit bb620ab
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
$: resolvedConfig.defaultValue && handleDefault()
function handleDefault() {
if (resolvedConfig.defaultValue) {
if (resolvedConfig.defaultValue != undefined) {
const nvalue = resolvedConfig.defaultValue
value = JSON.stringify(nvalue)
outputs?.result.set(nvalue)
Expand Down
43 changes: 24 additions & 19 deletions frontend/src/lib/components/build_workers.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
import { useWorkerFactory } from 'monaco-editor-wrapper/workerFactory'
import cssWorker from 'monaco-editor-wrapper/workers/module/css?worker'
import htmlWorker from 'monaco-editor-wrapper/workers/module/html?worker'
import tsWorker from 'monaco-editor-wrapper/workers/module/ts?worker'
import jsonWorker from 'monaco-editor-wrapper/workers/module/json?worker'
import editorWorker from 'monaco-editor-wrapper/workers/module/editor?worker'

import tsWorker from 'monaco-editor-wrapper/workers/module/ts?url'
import cssWorker from 'monaco-editor-wrapper/workers/module/css?url'
import htmlWorker from 'monaco-editor-wrapper/workers/module/html?url'
import jsonWorker from 'monaco-editor-wrapper/workers/module/json?url'
import editorWorker from 'monaco-editor-wrapper/workers/module/editor?url'

export function buildWorkerDefinition(workerPath: string, basePath: string, ...args: any[]) {
useWorkerFactory({
ignoreMapping: true,
workerLoaders: {
editorWorkerService: () => {
console.log('editorWorkerService')
return new editorWorker()
return new Worker(new URL(editorWorker, import.meta.url), {
type: 'module'
})
},
javascript: () => {
console.log('javascript')
return new tsWorker()
return new Worker(new URL(tsWorker, import.meta.url), {
type: 'module'
})
},

typescript: () => {
console.log('typescript')
return new tsWorker()
return new Worker(new URL(tsWorker, import.meta.url), {
type: 'module'
})
},
json: () => {
console.log('json')
return new jsonWorker()
return new Worker(new URL(jsonWorker, import.meta.url), {
type: 'module'
})
},
html: () => {
console.log('html')
return new htmlWorker()
return new Worker(new URL(htmlWorker, import.meta.url), {
type: 'module'
})
},
css: () => {
console.log('html')
return new cssWorker()
return new Worker(new URL(cssWorker, import.meta.url), {
type: 'module'
})
},
graphql: () => {
console.log('graphql')
const workerFilename = `graphql.worker.bundle.js`
const workerPathLocal = `${workerPath}/${workerFilename}`
const workerUrl = new URL(workerPathLocal, basePath)
Expand Down

0 comments on commit bb620ab

Please sign in to comment.