Add public names on supported Julia versions#1215
Closed
fredrikekre wants to merge 1 commit into
Closed
Conversation
a1b60a8 to
f2a022d
Compare
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.