-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal example #444
Comments
I'm aware there is a big entry barrier. It really depends on your needs, it can be as simple as: import { initialize as initializeMonacoService} from 'vscode/services'
import * as monaco from 'monaco-editor'
const workerLoaders: Partial<Record<string, WorkerLoader>> = {
editorWorkerService: () => new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker.js', import.meta.url), { type: 'module' })
}
window.MonacoEnvironment = {
getWorker: function (moduleId, label) {
const workerFactory = workerLoaders[label]
if (workerFactory != null) {
return workerFactory()
}
throw new Error(`Unimplemented worker ${label} (${moduleId})`)
}
}
// Call it once before doing anything else
await initializeMonacoService({})
monaco.editor.create(...) And you'll have something pretty similar to what you can achieve with the official monaco-editor-core Now you can have a look at the available service overrides: /~https://github.com/CodinGame/monaco-vscode-api?tab=readme-ov-file#monaco-standalone-services there are some relationship between them but the graph is quite complex so... the best is probably to use what you think you need to see if it works. For example:
Apart from those, most service overrides are optional and independent, feel free to browser them and cherry-pick what you need |
I am not aware of any "bare-bones" examples though, feel free to contribute by adding one, I'll be happy to reference it :) |
OK, I'll mark this as closed for the time being. If my explorations produce something usable and minimal, I'll reference this back. Thanks for the help! |
I am also interested in this after having mixed success trying to build something from the demo. |
Let's open this up and work on it :) |
Minimal means something different for everyone |
Let's try to address this problem then:
|
I've already done anything I can think of, do you have any suggestion? |
A demo where you isolate out just the editor component. Then a demo where you add the terminal component. Then a demo where you add the sidebar component. |
Unfortunately, not everything can be achieved
Yup, basically the stub I've added on my first comment? good idea
You can't JUST take a component and render it. As soon as you take UI parts, you kind of have to take all the layout stuff and most other parts as well |
Hey team, I've started playing with this amazing tool. Instead of starting from the full-fledged demo, I've been trying to figure out what a minimal solution looks like.
Specifically, I was trying to take the workbench approach and gradually add services / code until I had an MVP. I haven't had much success. It has been a challenge to tease out from the kitchen sink demo what is essential vs is what is nice-to-have.
Are you aware of any more bare-bones examples?
Do you have anywhere or thing you'd suggest I look at to familiarize myself with the essentials of bootstrapping this lib?
I really appreciate you folks putting this powerful tool together! ❤️
The text was updated successfully, but these errors were encountered: