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
feat: add @scalar/api-reference-editor
#1490
base: main
Are you sure you want to change the base?
Conversation
|
940925a
to
52f6ae9
Compare
Preview deployed to https://13f86190-e05c-48ea-a579-b373fd01e4f1--scalar-deploy-preview.netlify.app |
Job #1066: Bundle Size — 1.92MiB (+0.03%).Warning Bundle contains 4 duplicate packages – View duplicate packages Bundle metrics
|
Current Job #1066 |
Baseline Job #1064 |
|
---|---|---|
Initial JS | 1.92MiB (+0.03% ) |
1.92MiB |
Initial CSS | 0B |
0B |
Cache Invalidation | 100% |
0% |
Chunks | 1 |
1 |
Assets | 1 |
1 |
Modules | 1043 (+0.1% ) |
1042 |
Duplicate Modules | 0 |
0 |
Duplicate Code | 0% |
0% |
Packages | 158 |
158 |
Duplicate Packages | 4 |
4 |
Bundle size by type 1 change
1 regression
Current Job #1066 |
Baseline Job #1064 |
|
---|---|---|
JS | 1.92MiB (+0.03% ) |
1.92MiB |
View job #1066 report View geoff/doc-1689-editor-not-displa... branch activity View project dashboard
@toggleDarkMode="() => toggleDarkMode()" | ||
@updateContent="handleContentChange"> | ||
<template #editor> | ||
<!-- --> |
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.
Intentional empty comment?
<style> | ||
body { | ||
margin: 0; | ||
} | ||
</style> |
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.
That’s part of the theme anyway, isn’t it? I think we can remove it.
|
||
setTimeout( | ||
() => | ||
updateSpecValue(`openapi: 3.0.3 |
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.
Maybe we can use the new Scalar galaxy example here, usage examples here:
#1539 (was merged just now)
@scalar/api-reference-editor
I’ll take this one over and bring it over the finish line. 🏃 |
This adds in an editable version of the references (ESM only).
You can import the vue component OR mountApiReferenceEditable to create an editable version of the references. For CDN delivery we may want to consider bundling Vue with the package. Otherwise import maps would have to be used (which is also well supported).
PR also includes a very light refactor to the way Layouts are imported into APIReference. This provides a single component that can be used.