Skip to content

Add connector logos and Bloblang interactive features#359

Merged
JakeSCahill merged 8 commits intomainfrom
logos
Feb 3, 2026
Merged

Add connector logos and Bloblang interactive features#359
JakeSCahill merged 8 commits intomainfrom
logos

Conversation

@JakeSCahill
Copy link
Contributor

@JakeSCahill JakeSCahill commented Jan 30, 2026

Summary

  • Add logos for Redpanda Connect components for use in catalog and reference docs
  • Add Bloblang syntax highlighting, mini playground, and hover documentation

Fixes https://redpandadata.atlassian.net/browse/DOC-703
Fixes https://redpandadata.atlassian.net/browse/DOC-781

2026-02-02_15-16-55 (1)

2026-02-02_15-15-34 (1)

Bloblang interactive features

Makes Bloblang code blocks more useful and easier to understand:

  • Syntax highlighting - Custom grammar for Prism (static code blocks) and Ace (editors) with consistent colors
  • Hover tooltips - Functions and methods show inline documentation pulled from Connect JSON
  • "Try It" button - Opens a mini playground modal to run mappings without leaving the page
  • Input comments - Support for # In: comments to provide sample input data in code blocks
  • Dark mode - Readable colors throughout both light and dark themes
  • Full playground link - Mini playground links to the full playground with state encoded in URL

How it works

Version detection

Both build-time and runtime code fetch the latest Connect version from the same source: https://raw.githubusercontent.com/redpanda-data/rp-connect-docs/main/antora.yml

The latest-connect-version attribute in this file is the single source of truth. Runtime caches the version in localStorage for 1 hour to avoid repeated fetches.

Syntax highlighting (Prism)

The Prism grammar (prism-bloblang.js) is auto-generated at build time:

  1. During gulp bundle, the generate:bloblang-grammar task runs
  2. Fetches the Connect version from antora.yml
  3. Downloads Connect JSON from docs.redpanda.com/redpanda-connect/components/_attachments/connect-{version}.json
  4. Extracts function/method names and generates regex patterns

This keeps syntax highlighting in sync with Bloblang capabilities automatically.

Hover documentation

Tooltips load documentation dynamically at runtime:

  1. Get version from antora.yml (cached 1 hour)
  2. Fetch Connect JSON for that version from the docs site
  3. Fall back to known versions if needed
  4. Fall back to bundled bloblang-docs.json for UI previews

The Connect JSON contains signatures, descriptions, parameters, and examples from the actual Go source.

Syntax highlighting

  • Prism (prism-bloblang.js) - Highlights static code blocks in docs pages
  • Ace (mode-bloblang.js) - Highlights editable code in playgrounds

Both use the same color scheme to ensure consistency.

Preview

https://deploy-preview-359--docs-ui.netlify.app/bloblang-syntax-test

@netlify
Copy link

netlify bot commented Jan 30, 2026

Deploy Preview for docs-ui ready!

Name Link
🔨 Latest commit 10d7228
🔍 Latest deploy log https://app.netlify.com/projects/docs-ui/deploys/69823134d846b60008df9bcc
😎 Deploy Preview https://deploy-preview-359--docs-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 27 (🔴 down 2 from production)
Accessibility: 93 (no change from production)
Best Practices: 100 (no change from production)
SEO: 89 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Adds full Bloblang support to the docs UI: new documentation pages and static bloblang docs JSON, Prism and Ace syntax definitions, new CSS for an interactive Bloblang mini-playground, a new JS module providing hover tooltips and a "Try It" playground (with on-demand WASM and Ace loading, editor wiring, run/copy/link features, caching and error handling), updates to playground partials/head scripts to use bloblang mode, a gulp task to generate Prism grammar from Connect JSON, and small nav and .gitignore adjustments.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Page as Documentation Page
    participant JS as bloblang-interactive.js
    participant Docs as bloblang-docs.json / Connect JSON
    participant Tooltip as Tooltip UI

    User->>Page: Hover over Bloblang token
    Page->>JS: Initialize/scan code block
    JS->>Docs: Request function/method docs (fetch/cached)
    Docs-->>JS: Return docs JSON
    JS->>JS: Parse token, build tooltip content
    JS->>Tooltip: Attach and show tooltip
    Tooltip-->>User: Display signature, params, examples
Loading
sequenceDiagram
    actor User
    participant Page as Documentation Page
    participant JS as bloblang-interactive.js
    participant Modal as Mini-playground Modal
    participant Ace as Ace Editor (input/mapping/output)
    participant WASM as Bloblang WASM Runtime

    User->>Page: Click "Try It" button
    Page->>JS: Open playground modal
    JS->>Modal: Initialize UI and editors
    Modal->>Ace: Load Ace mode/theme and initialize editors
    JS->>WASM: Load/instantiate WASM runtime (on-demand)
    User->>Ace: Edit input and mapping
    User->>Modal: Click Run
    Modal->>WASM: Execute mapping with input
    WASM-->>Modal: Return output or error
    Modal->>Ace: Populate output editor / show status
    Modal-->>User: Display result or error message
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • paulohtb6
  • micheleRP
🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes connector logos mentioned in the title but not documented in the changeset summary or linked issues, representing out-of-scope changes beyond the Bloblang interactive features objectives. Clarify whether connector logos are part of this PR's scope or should be moved to a separate PR; document logo additions in the changeset summary if intentionally included.
Docstring Coverage ⚠️ Warning Docstring coverage is 71.88% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title mentions Bloblang interactive features which aligns with the main changes, but omits the connector logos aspect entirely despite their presence in the changeset.
Description check ✅ Passed The PR description comprehensively details the Bloblang interactive features implementation, including syntax highlighting, hover tooltips, mini playground, version detection, and build process.
Linked Issues check ✅ Passed The PR successfully implements all requirements from DOC-703 and DOC-781: Prism Bloblang language support with custom grammar DOC-703, Ace Editor syntax highlighter [DOC-781], proper tokenization, hover documentation, and mini playground features.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch logos

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Failure to add the new IP will result in interrupted reviews.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JakeSCahill JakeSCahill changed the title Add connector logos Add connector logos and Bloblang interactive features Feb 2, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/js/16-bloblang-interactive.js`:
- Around line 210-275: loadBloblangDocs can throw while callers are queued,
leaving promises unresolved; ensure you always resolve every queued resolver and
clear docsLoadQueue on both success and error paths. In loadBloblangDocs, after
setting docsLoading = false and before returning (both in the main success
branch and inside the catch block), iterate over docsLoadQueue with a
lint-friendly loop (e.g., for (const resolve of docsLoadQueue)
resolve(bloblangDocs)) to call each resolver with the final bloblangDocs, then
set docsLoadQueue = []; also ensure docsLoading is cleared and bloblangDocs is
set to the fallback {} when an error occurs so queued callers receive a value.
- Around line 781-804: The runMapping function calls the WASM runner via
window.blobl(currentMapping, currentInput) but the WASM API expects a third
metadata argument; update the invocation in runMapping to pass metadata (e.g.,
an empty object or appropriate metadata object) as the third parameter so the
call matches the signature used elsewhere (refer to runMapping and
window.blobl).
🧹 Nitpick comments (2)
src/css/bloblang-playground.css (1)

1427-1650: Reduce repeated selector groups for JSON editors.
Consider consolidating the repeated #ace-input/#ace-input-metadata/#ace-output/#ace-metadata selectors with :is(...) to avoid drift and reduce CSS size.

♻️ Example consolidation
-html[data-theme="dark"] .bloblang-playground `#ace-input` .ace_string,
-html[data-theme="dark"] .bloblang-playground `#ace-input-metadata` .ace_string,
-html[data-theme="dark"] .bloblang-playground `#ace-output` .ace_string,
-html[data-theme="dark"] .bloblang-playground `#ace-metadata` .ace_string {
+html[data-theme="dark"] .bloblang-playground :is(`#ace-input`, `#ace-input-metadata`, `#ace-output`, `#ace-metadata`) .ace_string {
   color: `#ce9178` !important;
 }
 
-html[data-theme="dark"] .bloblang-playground `#ace-input` .ace_constant.ace_numeric,
-html[data-theme="dark"] .bloblang-playground `#ace-input-metadata` .ace_constant.ace_numeric,
-html[data-theme="dark"] .bloblang-playground `#ace-output` .ace_constant.ace_numeric,
-html[data-theme="dark"] .bloblang-playground `#ace-metadata` .ace_constant.ace_numeric {
+html[data-theme="dark"] .bloblang-playground :is(`#ace-input`, `#ace-input-metadata`, `#ace-output`, `#ace-metadata`) .ace_constant.ace_numeric {
   color: `#b5cea8` !important;
 }
src/css/bloblang-interactive.css (1)

198-218: Add focus-visible styles for the new interactive controls.
Keyboard users currently don’t get a strong focus cue on the “Try It” button, close button, or action buttons. Consider adding focus-visible outlines.

♿ Proposed focus-visible styling
 .try-bloblang-button:active {
   transform: translateY(0);
 }
+
+.try-bloblang-button:focus-visible,
+.bloblang-mini-playground .mini-playground-close:focus-visible,
+.bloblang-mini-playground .mini-playground-button:focus-visible,
+.bloblang-mini-playground .mini-playground-link:focus-visible {
+  outline: 2px solid var(--link-color, `#005cc5`);
+  outline-offset: 2px;
+}
+
+html[data-theme="dark"] .try-bloblang-button:focus-visible,
+html[data-theme="dark"] .bloblang-mini-playground .mini-playground-close:focus-visible,
+html[data-theme="dark"] .bloblang-mini-playground .mini-playground-button:focus-visible,
+html[data-theme="dark"] .bloblang-mini-playground .mini-playground-link:focus-visible {
+  outline-color: `#79b8ff`;
+}

Also applies to: 287-305, 476-520

@JakeSCahill JakeSCahill force-pushed the logos branch 2 times, most recently from 97738f9 to 359f1d7 Compare February 2, 2026 15:03
@JakeSCahill JakeSCahill requested a review from a team February 2, 2026 15:08
@JakeSCahill JakeSCahill force-pushed the logos branch 3 times, most recently from d66d7c3 to bae9e18 Compare February 2, 2026 15:18
Makes Bloblang code blocks more interactive and easier to understand:

- Custom syntax highlighting for Prism (static blocks) and Ace (editors)
- Hover tooltips on functions and methods showing docs from Connect JSON
- "Try It" button opens a mini playground modal to run mappings instantly
- Support for # In: comments to provide sample input data
- Dark mode support with readable colors throughout
- Mini playground links to full playground with encoded state
Replace GitHub API calls with fetches from rp-connect-docs antora.yml.
This avoids rate limits and uses the same source of truth for both
build-time grammar generation and runtime tooltip loading.

Runtime version is cached in localStorage for 1 hour.
Move modal to document.body when opened to escape CSS containment
context that was breaking position:fixed relative positioning.
Use flexbox centering instead of margin-based centering.
Detects and highlights Bloblang code embedded in Connect pipeline configs (mapping, check, request_map, etc). Adds hover tooltips for functions/methods and a Skip directive to disable Try It buttons on specific blocks.
@JakeSCahill
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/static/bloblang-docs.json`:
- Around line 19-30: The timestamp_unix entry currently documents a non-existent
signature; update the "timestamp_unix" object so its "signature" is
"timestamp_unix()", remove any "parameters" array (or set it empty), change the
"description" to state it returns the current Unix timestamp in seconds, ensure
"returns" remains "number" (clarify seconds if desired), and replace the
"example" with a no-arg invocation such as "root.ts = timestamp_unix()"; retain
the "category" and "url" but correct text to match the official Bloblang docs.
🧹 Nitpick comments (4)
src/css/bloblang-interactive.css (2)

3-13: Consider a stronger focus-visible indicator for .has-documentation.

outline: none removes the default keyboard focus ring; adding an explicit :focus-visible keeps focus discoverable.

♿ Suggested focus-visible tweak
+.has-documentation:focus-visible {
+  outline: 2px solid var(--link-color, `#005cc5`);
+  outline-offset: 2px;
+}

225-272: Optionally honor prefers-reduced-motion for modal animations.

This keeps the fade/slide effects friendly to motion-sensitive users.

🧘 Reduced motion option
+@media (prefers-reduced-motion: reduce) {
+  .bloblang-playground-overlay,
+  .bloblang-mini-playground {
+    animation: none;
+  }
+}
src/js/vendor/ace/mode-bloblang.js (1)

13-198: Add normalizeRules() call after defining $rules.

This aligns with Ace highlight rule conventions used in other modes within the repository (yaml, coffee) and helps avoid subtle tokenization edge cases.

Suggested addition
      ]
    };
+   this.normalizeRules();
  };

  oop.inherits(BloblangHighlightRules, TextHighlightRules);
src/js/16-bloblang-interactive.js (1)

584-651: Add a non‑streaming WASM fallback for servers without correct MIME type.
instantiateStreaming can fail when application/wasm isn’t set; a fallback avoids false negatives.

🔁 Suggested fallback
-                return WebAssembly.instantiateStreaming(response, go.importObject);
+                const responseClone = response.clone();
+                return WebAssembly.instantiateStreaming(response, go.importObject)
+                  .catch(async () => {
+                    const bytes = await responseClone.arrayBuffer();
+                    return WebAssembly.instantiate(bytes, go.importObject);
+                  });

- Add comprehensive test suite for mini-playground, YAML detection, and copy safety
- Fix accessibility with focus-visible indicators and reduced motion support
- Add WASM streaming fallback for better server compatibility
- Fix timestamp_unix documentation to match actual function signature
- Integrate tests into existing CI/CD workflow
@JakeSCahill JakeSCahill merged commit b982d89 into main Feb 3, 2026
6 checks passed
@JakeSCahill JakeSCahill deleted the logos branch February 3, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants