Conversation
… accessed in all workers.
| import { cache } from "../cache.js"; | ||
|
|
||
| let monaco: typeof Monaco; | ||
| const monacoAPI = { |
There was a problem hiding this comment.
Had to move the monaco variable to MonacoEnvironment so we can the same instance across all workers. That unfortunately meant I had to replace quite a few monaco. instances.
| }; | ||
|
|
||
| /** init the monaco namespace. */ | ||
| export function init(monacoNS: typeof Monaco): void { |
There was a problem hiding this comment.
No need for this init function anymore, as we now set the monaco instance on the MonacoEnvironment (in core.ts)
| }; | ||
|
|
||
| /** Multi-workspace file system router */ | ||
| export class MultiWorkspaceFileSystem { |
There was a problem hiding this comment.
This class serves as a proxy to each individual workspace
|
wow! This is so good 👍 |
|
@JeroenReumkens please ensure that the
this 👇
|
|
Amazing. Thanks for your comment @ije. I will fix it asap (probably next week though, I'm traveling a lot for a conference this week). Feel free to work in my branch too if you feel like it. Otherwise I'll check back in asap. |
|
no worries @JeroenReumkens, i will fix it! you have did a great job! thanks you a lot! |
|
any updates on this? @ije i can help but i'm not sure how. |


I believe this PR solves #23, adding support for multiple workspaces on a single page.
As per the comments in that issue I went ahead and added the functionality to either pass
workspaceorworkspacesto the init functions. When initialising Monaco, it then takes theworkspaceattribute into account to connect to the proper workspace.I'm definitely not used to any Monaco related code, so many things were new for me. So just let me know if there's any weird implementations and I try to improve it.
I've temporarily published this to NPM (give it a slightly different name to not pop up in npm search ;) ) as well, as I'm working hard on getting this merged asap as I'd love to use Modern Monaco in my platform. So far I didn't encounter any additional issues with this setup.
Please let me know your thoughts, and don't hesitate to tell me if some things aren't the way you'd like to solve them.