Skip to content

Add public names on supported Julia versions#1215

Closed
fredrikekre wants to merge 1 commit into
masterfrom
fe/public
Closed

Add public names on supported Julia versions#1215
fredrikekre wants to merge 1 commit into
masterfrom
fe/public

Conversation

@fredrikekre

Copy link
Copy Markdown
Member

No description provided.

@fredrikekre fredrikekre changed the title Add pubic names on supported Julia versions Add public names on supported Julia versions Feb 18, 2025
@quinnj

quinnj commented Jun 16, 2026

Copy link
Copy Markdown
Member

Sorry I was slow on the responding/review here; I think this is a good idea; I've tried to apply it to the refactored 2.0 code in #1312

@quinnj quinnj closed this Jun 16, 2026
quinnj added a commit that referenced this pull request Jun 16, 2026
HTTP.jl 2.x exports almost nothing (`WebSockets`, `escape`, plus a handful of
re-exports), so nearly the entire documented API is reached as `HTTP.name`
without being formally marked public. Julia 1.11 added the `public` keyword to
distinguish supported public API from internals; declare it here so downstream
code and tooling can tell the difference (and `names(HTTP)` reflects the real
surface).

- Main module, HTTP.WebSockets, and HTTP.Handlers each declare their documented,
  non-exported names public. Already-exported names are public via `export` and
  are not repeated. Names HTTP only extends from Base (`get`, `get!`) are
  included since they are documented `HTTP.get`/`HTTP.get!` entry points.
- The declaration is gated on `VERSION >= v"1.11.0-DEV.469"` and uses
  `Core.eval(@__MODULE__, Expr(:public, …))`, which parses on Julia 1.10 (the
  package's lower compat bound) where the `public` keyword does not exist.
- New test asserts every name documented in docs/src/api/*.md is exported or
  public, and that internals stay private — so future docs additions can't
  silently skip the declaration.

Supersedes the stale 1.x-targeting PR #1215 (which listed `download`/`status`,
neither of which is an HTTP.jl function in 2.x). No behavior change: `public`
does not affect `using HTTP`.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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