Skip to content

docs: fix more incorrect JSDoc in public APIs#8614

Merged
willeastcott merged 2 commits into
mainfrom
docs/jsdoc-public-api-fixes-3
Apr 19, 2026
Merged

docs: fix more incorrect JSDoc in public APIs#8614
willeastcott merged 2 commits into
mainfrom
docs/jsdoc-public-api-fixes-3

Conversation

@willeastcott
Copy link
Copy Markdown
Contributor

A third small docs-only pass continuing from #8612 and #8613 — a batch of objective JSDoc / comment fixes found during a fresh scan of the codebase.

Grammar & typos

  • src/scene/shader-lib/programs/standard.js
    • Remove duplicate to in _addMapDefines: passed into to createShaderDefinitionpassed into createShaderDefinition.
    • Fix ungrammatical user-facing error string: is in no longer compatible formatis no longer in a compatible format.
  • src/scene/scene.js — add missing article in class summary: A scene is graphical representation...A scene is a graphical representation....
  • src/core/math/math.jsintToBytes24 / intToBytes32: Convert an 24/32 bit integer...Convert a 24-bit/32-bit integer....
  • src/framework/app-base.js
    • resizeCanvas: A objectAn object.
    • renderLines: add missing the: number of colors it stores must match...the number of colors it stores must match....
  • src/framework/input/element-input.jsElementSelectEvent ctor: Create an instance of a ElementSelectEvent.Create an instance of an ElementSelectEvent..
  • src/platform/graphics/texture.jsupload() JSDoc: add missing possessive (the textures pixel datathe texture's pixel data) and remove duplicate by (is called by internally byis called internally by).
  • src/scene/mesh-instance.jsvisibleThisFrame: Read this value in {@link Scene.EVENT_POSTCULL} event...Read this value in the {@link Scene.EVENT_POSTCULL} event....
  • src/framework/xr/xr-anchor.js — rephrase the ungrammatical The Error object if failed to persist/forget... prose in the XrAnchorPersistCallback / XrAnchorForgetCallback typedefs so they parse as English.

Broken {@link} / tighter types

  • src/scene/materials/standard-material.js — the useTonemap doc-only property references {@link Scene#rendering} and {@link CameraComponent.rendering}, neither of which exists. Replaced with the actual API: {@link CameraComponent#toneMapping}.
  • src/framework/app-base.js — tighten resizeCanvas's return type from {object} to {{width: number, height: number}}, matching the actual return { width, height } at the bottom of the function. This is documentation-only but will flow through to the generated .d.ts; it is strictly narrower than the previous object.

No runtime changes

All changes are JSDoc / comments only (plus one user-facing error-log string grammar fix in standard.js). No public API signatures are broken; the only type-level movement is the strict narrowing of AppBase#resizeCanvas's documented return type.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Docs-only pass to correct grammar, typos, and broken JSDoc links/types across several public APIs (plus one user-facing error string grammar fix).

Changes:

  • Fix typos/grammar in JSDoc and comments across scene, math, input, XR, texture, and shader generator files.
  • Replace broken {@link} references in StandardMaterial docs with valid API links.
  • Narrow AppBase#resizeCanvas documented return type shape (but see review comment about undefined returns).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/scene/shader-lib/programs/standard.js Fix grammar in a logged error message and a JSDoc sentence.
src/scene/scene.js Fix class summary grammar (“is a graphical representation…”).
src/scene/mesh-instance.js Fix JSDoc prose for visibleThisFrame.
src/scene/materials/standard-material.js Fix broken {@link} references for tonemapping configuration.
src/platform/graphics/texture.js Fix upload() JSDoc grammar/possessive wording.
src/framework/xr/xr-anchor.js Rewrite callback param docs to be grammatically correct and clearer.
src/framework/input/element-input.js Fix article usage in ElementSelectEvent constructor doc.
src/framework/app-base.js Tighten resizeCanvas return type and fix minor JSDoc grammar.
src/core/math/math.js Fix “a/an” and hyphenation for 24-bit/32-bit integer docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/framework/app-base.js Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@willeastcott willeastcott merged commit 97a301f into main Apr 19, 2026
12 checks passed
@willeastcott willeastcott deleted the docs/jsdoc-public-api-fixes-3 branch April 19, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants