Skip to content

Rename a few bindings with a proper descriptive naming#234

Merged
brnrdog merged 1 commit intopre-alphafrom
brnrdog/descriptive-make-fns
Apr 18, 2026
Merged

Rename a few bindings with a proper descriptive naming#234
brnrdog merged 1 commit intopre-alphafrom
brnrdog/descriptive-make-fns

Conversation

@brnrdog
Copy link
Copy Markdown
Collaborator

@brnrdog brnrdog commented Apr 17, 2026

We have a few constructor bindings lacking good naming.

For example, VideoFrame has about 10 bindings for the same function targeting different signatures, and we were using make2, make3, make4 and to define those bindings.

This pull request renames these bindings with better names based on their arguments.

These are breaking changes.

@brnrdog brnrdog force-pushed the brnrdog/descriptive-make-fns branch from 8375600 to 19fd915 Compare April 17, 2026 12:16
@brnrdog brnrdog changed the title Rename makeN fns with better descriptive names Rename a few bindings with a proper descriptive naming Apr 17, 2026
Comment thread src/CanvasAPI/Path2D.res
Comment on lines -81 to -106
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
*/
@send
external roundRect2: (
path2D,
~x: float,
~y: float,
~w: float,
~h: float,
~radii_: array<float>=?,
) => unit = "roundRect"

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
*/
@send
external roundRect3: (
path2D,
~x: float,
~y: float,
~w: float,
~h: float,
~radii_: array<float>=?,
) => unit = "roundRect"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

These were repeated, same signature as roundRect

Comment on lines -783 to -809
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
*/
@send
external roundRect2: (
canvasRenderingContext2D,
~x: float,
~y: float,
~w: float,
~h: float,
~radii_: array<float>=?,
) => unit = "roundRect"

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
*/
@send
external roundRect3: (
canvasRenderingContext2D,
~x: float,
~y: float,
~w: float,
~h: float,
~radii_: array<float>=?,
) => unit = "roundRect"

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arc)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

These were repeated as well

@brnrdog brnrdog changed the base branch from vlk/remove-api-from-module-names to main April 17, 2026 14:11
@brnrdog brnrdog changed the base branch from main to vlk/remove-api-from-module-names April 17, 2026 14:11
@brnrdog brnrdog marked this pull request as ready for review April 17, 2026 15:01
@jderochervlk
Copy link
Copy Markdown
Collaborator

This looks good!
I created this ticket to try and capture everything: #236

We should update the target branch to pre-alpha so we can combine this with the other work.

@brnrdog brnrdog changed the base branch from vlk/remove-api-from-module-names to pre-alpha April 18, 2026 12:18
@brnrdog brnrdog force-pushed the brnrdog/descriptive-make-fns branch from 68817cd to 252361a Compare April 18, 2026 12:20
@brnrdog
Copy link
Copy Markdown
Collaborator Author

brnrdog commented Apr 18, 2026

@jderochervlk updated the pull request's target and rebased

Get read of ambiguous bindings names such as make2, make3,
createPattern3, drawFocusIfNeeded2, etc
@brnrdog brnrdog force-pushed the brnrdog/descriptive-make-fns branch from 252361a to edeb2c1 Compare April 18, 2026 12:24
Copy link
Copy Markdown
Collaborator

@jderochervlk jderochervlk left a comment

Choose a reason for hiding this comment

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

Looks good!

@brnrdog brnrdog merged commit 4ffc5e2 into pre-alpha Apr 18, 2026
1 check passed
@brnrdog brnrdog deleted the brnrdog/descriptive-make-fns branch April 18, 2026 12:46
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