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
Knex Playground #6059
base: master
Are you sure you want to change the base?
Knex Playground #6059
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will continue the review later
try { | ||
const knex = Knex({ client: dialect.value }); | ||
|
||
output += eval(code.value).toQuery(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why eval?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We receive the code as string, and we need to call the toQuery()
method in the code to get the resulting query, I see this method as the only way to achieve this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too risky, lets try find another way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might wanna look how https://github.com/wirekang/kysely-playground does it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are using iframe which is better approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Does it support multi instances?
- Can you provide option for having prefilled text + specific language? I want to integrate it in the docs for each example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should probably support multi instances, but you should probably attempt to measure page performance, because it instantiates two monaco-editors for each instance
I've fixed the PR to support dark mode + light mode |
knex-playground integrated into Knex's official docs
Warning
I currently need help on making light mode work with the editor
Any code feedback is also welcome, I have almost zero knowledge with Vue