Skip to content

docs(reference): switch typed-API migration guide to elasticsearch.NewTypedFrom#1475

Merged
MattDevy merged 1 commit into
mainfrom
docs/1472-bridge-totyped-migration
May 11, 2026
Merged

docs(reference): switch typed-API migration guide to elasticsearch.NewTypedFrom#1475
MattDevy merged 1 commit into
mainfrom
docs/1472-bridge-totyped-migration

Conversation

@MattDevy

@MattDevy MattDevy commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates the typed-API reference documentation for the (*Client).ToTyped()elasticsearch.NewTypedFrom(c) migration introduced in #1474.

Two files touched:

  • docs/reference/low-level-api/migration.md: rewrites the "Get a full typed client from an existing low-level client" section around elasticsearch.NewTypedFrom. Adds a "Migrating from v9.4.0" subsection explaining the rename and the binary-size rationale, and notes why the replacement is a free function rather than a method.
  • docs/reference/typed-api/index.md: updates a cross-link from client.ToTyped() to elasticsearch.NewTypedFrom(client).

Depends on: #1474. That PR removes (*Client).ToTyped() and adds elasticsearch.NewTypedFrom. Land it first so this doc is not describing a non-existent API.

Test plan

  • Confirm the rendered docs render correctly (mermaid diagram unchanged, code samples valid, asciidoc/MD anchors resolve).
  • Confirm the cross-link from typed-api/index.mdlow-level-api/migration.md still anchors correctly.

Note on branch name

The branch is still named docs/1472-bridge-totyped-migration from an earlier design iteration that exposed the conversion via a typedapi/bridge sub-package. The final design (matching #1474) is a single free function elasticsearch.NewTypedFrom. The branch name doesn't affect the squash-merged commit.

@prodsecmachine

prodsecmachine commented May 11, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

🔍 Preview links for changed docs

@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Vale Linting Results

Summary: 1 warning, 3 suggestions found

⚠️ Warnings (1)
File Line Rule Message
docs/reference/low-level-api/migration.md 257 Elastic.DontUse Don't use 'just'.
💡 Suggestions (3)
File Line Rule Message
docs/reference/low-level-api/migration.md 280 Elastic.WordChoice Consider using 'deactivate, deselect, hide, turn off' instead of 'disable', unless the term is in the UI.
docs/reference/low-level-api/migration.md 302 Elastic.Semicolons Use semicolons judiciously.
docs/reference/typed-api/index.md 55 Elastic.Ellipses In general, don't use an ellipsis.

The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Binary size vs main (threshold: +10%)

Fixtures: internal/cmd/binsize, built with go build -trimpath on linux/amd64.

Variant Base PR Delta %
base 9.04 MB 9.04 MB +0.00 MB 0.00%
client 69.80 MB 69.80 MB +0.00 MB 0.00%
typed 50.64 MB 50.64 MB +0.00 MB 0.00%

All binaries within +10% of base.

@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Warnings Elapsed time
⚠️ MARKDOWN markdownlint 2 4 0 0.65s
✅ REPOSITORY gitleaks yes no no 33.16s
✅ REPOSITORY git_diff yes no no 0.7s

Detailed Issues

⚠️ MARKDOWN / markdownlint - 4 errors
docs/reference/low-level-api/migration.md:306:401 MD013/line-length Line length [Expected: 400; Actual: 510]
docs/reference/low-level-api/migration.md:314:401 MD013/line-length Line length [Expected: 400; Actual: 530]
docs/reference/low-level-api/migration.md:318:401 MD013/line-length Line length [Expected: 400; Actual: 417]
docs/reference/typed-api/index.md:55:401 MD013/line-length Line length [Expected: 400; Actual: 571]

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

…wTypedFrom

Updates docs/reference/low-level-api/migration.md and
docs/reference/typed-api/index.md to reference the new
elasticsearch.NewTypedFrom(c) free function instead of the removed
(*Client).ToTyped() method, and adds a v9.4.0 -> v9.4.1 migration
block under "Get a full typed client from an existing low-level
client" explaining the rename, the binary-size rationale, and why
NewTypedFrom is a free function rather than a method.

Depends on the (*Client).ToTyped() removal in #1474.
@MattDevy MattDevy force-pushed the docs/1472-bridge-totyped-migration branch from c19c115 to 90af589 Compare May 11, 2026 08:24
@MattDevy MattDevy changed the title docs(reference): switch typed-API migration guide to bridge.ToTyped docs(reference): switch typed-API migration guide to elasticsearch.NewTypedFrom May 11, 2026
@MattDevy MattDevy marked this pull request as ready for review May 11, 2026 10:09
@MattDevy MattDevy merged commit df7cf6d into main May 11, 2026
22 checks passed
@MattDevy MattDevy deleted the docs/1472-bridge-totyped-migration branch May 11, 2026 10:10
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