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

fix: Kapa lazy load #239

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -68,8 +68,15 @@ const buildWasmTask = createTask({
name: 'build:wasm',
desc: 'Build the WebAssembly (.wasm) file using Go',
call: (done) => {
const command = `GOOS=js GOARCH=wasm go build -o ${wasmOutput} ${wasmMain}`
exec(command, (err, stdout, stderr) => {
const envVars = {
...process.env, // preserve existing env vars
GOOS: 'js',
GOARCH: 'wasm',
}

const command = `go build -o ${wasmOutput} ${wasmMain}`

exec(command, { env: envVars }, (err, stdout, stderr) => {
if (err) {
log.error('Error building wasm:', stderr)
done(err)
10 changes: 9 additions & 1 deletion src/layouts/swagger.hbs
Original file line number Diff line number Diff line change
@@ -3,12 +3,20 @@
<head>
{{> head defaultPageTitle='API Reference'}}
<meta charset="utf-8">
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>

<link rel="dns-prefetch" href="https://unpkg.com" />
<link rel="preconnect" href="https://unpkg.com" crossorigin />
<script type="module" defer src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>

{{> header-scripts}}
<style>
td.tableblock>.content>: first-child {
margin-top: 0;
}
.rapidoc-container {
min-height: 600px; /* avoid page jump */
}
</style>
</head>
<body style="padding-top:0; height:100vh;" class="api">
28 changes: 14 additions & 14 deletions src/partials/head-scripts.hbs
Original file line number Diff line number Diff line change
@@ -30,20 +30,6 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
<script>
var uiRootPath="{{{uiRootPath}}}"
</script>
<script defer
src="https://widget.kapa.ai/kapa-widget.bundle.js"
data-website-id="fe00d579-9e9a-4f83-8f9f-0ca7672262a6"
data-project-name="Redpanda"
data-project-color="#E14225"
data-modal-override-open-class="custom-class-kapa"
data-modal-open-on-command-k="true"
data-button-hide="true"
data-modal-size="800px"
data-project-logo="https://avatars.githubusercontent.com/u/49406389?s=200&v=4"
data-user-analytics-fingerprint-enabled="true"
data-user-analytics-store-ip="true"
data-modal-disclaimer="This is a custom LLM for Redpanda with access to all developer docs, API specs, support FAQs, YouTube tutorials, and resolved GitHub discussions."
></script>
{{#if (ne page.attributes.role 'bloblang-playground')}}
<link rel="stylesheet" href="{{{uiRootPath}}}/css/vendor/prism/prism.min.css">
<!-- Prism scripts for code blocks -->
@@ -59,4 +45,18 @@ data-modal-disclaimer="This is a custom LLM for Redpanda with access to all deve
<script defer src="{{{uiRootPath}}}/js/vendor/ace/worker-json.js"></script>
<script src="{{{uiRootPath}}}/js/vendor/wasm_exec.js"></script>
{{/if}}
<script async
src="https://widget.kapa.ai/kapa-widget.bundle.js"
data-website-id="fe00d579-9e9a-4f83-8f9f-0ca7672262a6"
data-project-name="Redpanda"
data-project-color="#E14225"
data-modal-override-open-class="custom-class-kapa"
data-modal-open-on-command-k="true"
data-button-hide="true"
data-modal-size="800px"
data-project-logo="https://avatars.githubusercontent.com/u/49406389?s=200&v=4"
data-user-analytics-fingerprint-enabled="true"
data-user-analytics-store-ip="true"
data-modal-disclaimer="This is a custom LLM for Redpanda with access to all developer docs, API specs, support FAQs, YouTube tutorials, and resolved GitHub discussions."
></script>