Skip to content

docs(embedding): add raw-JS / prebuilt-bundle path#727

Open
paddymul wants to merge 1 commit into
mainfrom
docs/embedding-raw-js
Open

docs(embedding): add raw-JS / prebuilt-bundle path#727
paddymul wants to merge 1 commit into
mainfrom
docs/embedding-raw-js

Conversation

@paddymul
Copy link
Copy Markdown
Collaborator

Summary

  • Splits the HTML + JS (artifact) section in docs/source/articles/embedding.rst into two clearly labelled paths: a raw-JS subsection that uses the prebuilt static-embed.js bundle (works today, no build step), and the existing TypeScript / buckaroo-js-core subsection (lands when the npm package publishes).
  • Documents the bundle's actual contract — an ESM module that auto-inits on load by reading <script id="buckaroo-data"> + <div id="root"> — plus a late-bound fetch(...) → import("./static-embed.js") variant for data not known at page-render time.
  • Fixes the prior note that pointed readers at window.BuckarooStaticEmbed; the bundle is built as ESM (packages/js/package.json build:static) and does not expose that global. Replaced with a pointer to the new raw-JS path.

Test plan

  • sphinx-build -b html source /tmp/out — embedding.rst builds with no new warnings (the 11 reported warnings are all pre-existing in other files: duplicate using labels, an unknown embedding-guide ref in dastardly-dataframe-dataset.rst, and a syntax warning in histograms.rst).
  • Verified the new "Raw JS", "prebuilt bundle", "buckaroo-data", and "late-bound" terms render in the generated articles/embedding.html.
  • Spot-check the rendered page on the Readthedocs preview once available.

🤖 Generated with Claude Code

Splits the HTML+JS section into a raw-JS subsection (drop the prebuilt
static-embed.js bundle on a page with #root + #buckaroo-data) and the
existing TypeScript / buckaroo-js-core subsection. Documents the
late-bound fetch variant for data loaded after page render, and fixes
the prior note that referenced a non-existent window.BuckarooStaticEmbed
global — the bundle is ESM and auto-inits from DOM hooks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0a8507e6c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<body>
<div id="root"></div>
<script id="buckaroo-data" type="application/json">
{{ artifact_json_from_python }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid autoescaping the artifact JSON

When this example is copied into a Flask/Django/Jinja template with autoescaping enabled (the server-rendered backends suggested immediately below), {{ artifact_json_from_python }} will typically emit entities such as &#34; inside the <script type="application/json"> body. Script contents are read verbatim by static-embed.js via textContent, so JSON.parse receives the escaped entities instead of JSON and the table fails to render. The docs should show a framework JSON helper or an explicitly safe JSON insertion pattern that also handles </script> safely.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown
Contributor

📦 TestPyPI package published

pip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.13.5.dev25760271609

or with uv:

uv pip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.13.5.dev25760271609

MCP server for Claude Code

claude mcp add buckaroo-table -- uvx --from "buckaroo[mcp]==0.13.5.dev25760271609" --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo-table

📖 Docs preview

🎨 Storybook preview

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.

1 participant