Skip to content

✨ [RUM-10367] Browser SDK API Reference#3638

Closed
rgaignault wants to merge 2 commits intomainfrom
romanG/api-reference-github
Closed

✨ [RUM-10367] Browser SDK API Reference#3638
rgaignault wants to merge 2 commits intomainfrom
romanG/api-reference-github

Conversation

@rgaignault
Copy link
Copy Markdown
Contributor

@rgaignault rgaignault commented Jun 16, 2025

Motivation

This PR introduces automated API reference generation for the Browser SDK using API generator. It addresses documentation inconsistencies by centralizing the public API surface, improving maintainability, and enabling integration into Datadog Docs or GitHub Pages.

Changes

  • Generate an API extractor json
  • Use this json to generate markdown with API documenter
  • Use Jekyll to transform the markdown into a static html website in a github pages.

See this web page to visit the api reference : https://datadoghq.dev/browser-sdk/

Test instructions

Use : docs:serve to test Jekyll locally

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@rgaignault rgaignault requested a review from a team as a code owner June 16, 2025 10:40
@rgaignault rgaignault force-pushed the romanG/api-reference-github branch from f4eb248 to 64eb14f Compare June 16, 2025 12:57
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.44%. Comparing base (4233472) to head (0ae4630).
⚠️ Report is 571 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3638   +/-   ##
=======================================
  Coverage   92.44%   92.44%           
=======================================
  Files         322      322           
  Lines        8129     8129           
  Branches     1838     1838           
=======================================
  Hits         7515     7515           
  Misses        614      614           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

on:
push:
branches:
- romanG/api-reference-github
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note : For testing purpose, will be deleted before pr get merged.

Comment thread _config_docs.yml
url: 'https://datadoghq.dev'
baseurl: '/browser-sdk'

remote_theme: 'just-the-docs/just-the-docs'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note : we may want to delete the left bar, working on a script to delete it after generation

Comment thread package.json
"woke": "scripts/cli woke"
"woke": "scripts/cli woke",
"build:types": "lerna run build:esm --stream",
"docs:api": "yarn build:types && api-extractor run --local -c packages/rum/api-extractor.json && api-extractor run --local -c packages/logs/api-extractor.json && api-extractor run --local -c packages/rum-slim/api-extractor.json && api-extractor run --local -c packages/rum-react/api-extractor.json && api-documenter markdown -i etc -o docs && node scripts/docs-jekyll.js",
Copy link
Copy Markdown
Collaborator

@amortemousque amortemousque Jun 25, 2025

Choose a reason for hiding this comment

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

💬 suggestion: ‏Instead of inlining the conf for all packages here, you should use lerna to run the command. Something like

  • package.json =>
    • "docs:api:extractor": "lerna run docs:api"
    • "docs:api": "yarn docs:api:extractor && api-documenter markdown -i etc -o docs && node scripts/docs-jekyll.js"
  • for all packages (e.g. rum-core/package.json):
    • "docs:api:extractor": "yarn build:esm && api-extractor run --local -c ./api-extractor.json"

Copy link
Copy Markdown
Collaborator

@amortemousque amortemousque Jun 25, 2025

Choose a reason for hiding this comment

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

The api-extractor.json configuration is almost identical across packages. To avoid duplication, we could use extends.

@thomas-lebeau
Copy link
Copy Markdown
Collaborator

closed in favor of #3677

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.

4 participants