Skip to content

refactor: rename overloaded constructors to from* names [codex]#255

Open
jderochervlk wants to merge 23 commits intomainfrom
codex/issue-236-constructor-from-names-carryover
Open

refactor: rename overloaded constructors to from* names [codex]#255
jderochervlk wants to merge 23 commits intomainfrom
codex/issue-236-constructor-from-names-carryover

Conversation

@jderochervlk
Copy link
Copy Markdown
Collaborator

Summary

  • rename overloaded constructors to from* source-type names
  • keep true default constructors as make()
  • add compile-coverage tests for the renamed constructors
  • localize the sharedArrayBuffer alias in VideoFrame

Validation

  • npm run build
  • ASTRO_TELEMETRY_DISABLED=1 npm run build:docs

Notes

  • npm run format:check still reports pre-existing failures on carryover/post-249-pre-alpha

  • fix: rename overloaded constructors to from names*

  • style: format Path2D on carryover branch

  • refactor: localize VideoFrame shared array buffer alias

tsnobip and others added 19 commits April 17, 2026 17:49
Port the surviving API cleanup from the final pre-alpha branch onto the monorepo split introduced in #249.

This adds the missing concrete modules, translates the fetch/runtime/canvas/websocket/media surface cleanup into the package layout, and keeps the branch green with updated tests.
Drop scroll2/scrollTo2/scrollBy2 and keep the descriptive *XY overload names requested in review.

Co-authored-by: Codex <codex@openai.com>
…with-commits-and-responses

Address review feedback: rename constructors, unbox FormDataEntryValue, reuse MessageEvent types, simplify tests
@jderochervlk jderochervlk changed the base branch from carryover/post-249-pre-alpha to main April 19, 2026 14:10
Comment thread docs/content/docs/contributing/api-modelling.mdx Outdated
Update DOMMatrix, DOMMatrixReadOnly, Path2D, and ReadableStream single-source constructor overloads to take direct unlabeled arguments.

Refresh compile-coverage tests and contributor documentation to match the constructor naming convention.
Comment thread packages/Canvas/src/Path2D.res Outdated
Comment thread packages/Canvas/src/Path2D.res Outdated
Comment thread packages/Canvas/src/Path2D.res Outdated
Remove source-shape callouts from the constructor docs added in this PR.

Rewrite constructor summaries to focus on the ReScript API surface and update the contributor documentation guidance to match.
@jderochervlk jderochervlk marked this pull request as ready for review April 22, 2026 14:13
@jderochervlk
Copy link
Copy Markdown
Collaborator Author

@codex

@jderochervlk jderochervlk changed the title [codex] rename overloaded constructors to from* names refactor: rename overloaded constructors to from* names [codex] Apr 22, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c7ece03a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/Canvas/src/VideoFrame.res
@jderochervlk jderochervlk requested review from brnrdog and tsnobip April 22, 2026 14:46
Copy link
Copy Markdown
Member

@tsnobip tsnobip left a comment

Choose a reason for hiding this comment

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

except from the sharedArrayBuffer, the rest looks good to me!

@@ -1,89 +1,177 @@
type sharedArrayBuffer = unknown
Copy link
Copy Markdown
Member

@tsnobip tsnobip Apr 23, 2026

Choose a reason for hiding this comment

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

I think this should use ArrayBufferTypedArrayOrDataView.t
https://github.com/rescript-lang/experimental-rescript-webapi/blob/main/packages/Base/src/ArrayBufferTypedArrayOrDataView.res
or even better, write a different binding for each possible case (ArrayBuffer, TypedArray, DataView), this type should be kept only for cases when you can't write multiple bindings, like in record types for example, otherwise in VideoFrame or SubtleCrypto bindings, it should likely use different bindings.

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