Skip to content
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

new mini IDE for site using monaco-graphql #952

Open
acao opened this issue Nov 4, 2020 · 2 comments
Open

new mini IDE for site using monaco-graphql #952

acao opened this issue Nov 4, 2020 · 2 comments

Comments

@acao
Copy link
Member

acao commented Nov 4, 2020

we should build a new mini-IDE for the docs using monaco-graphql, since it's actually screen-reader accessible, supports multiple instances (with shared, single schema fetch) and it already supports most of the new language features that we need to document (correction - the LSP (gls-interface) does not yet have completion support for interfaces implementing interfaces, though validation and highlighting is supported in monaco-graphql. previously this issue claimed we fully supported this language feature).

according to the vscode team, the best way to re-use the same monaco mode instance across multiple editors is by using editor.setModel(). this way, the language service instance is built once, and the schema is executed once, and one set of language workers will service all editor panes.

the current MiniGraphQL component uses codemirror-graphql which takes much more effort to add new language features to, because of the non-LSP interface

also, if we want the embedded demos to execute against swapi-graphql, need to add new language features to that schema as well.

@dotansimha
Copy link
Member

That's a great idea ;) We are using it in GraphQL Codegen website and it works great!

@acao
Copy link
Member Author

acao commented Dec 16, 2020

there are some fantastic react hooks out there for monaco editor already. we also have a react + monaco example in the form of an unfinished graphiql 2.x rfc!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants