Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add named arguments to various Node apis #89

Merged
merged 2 commits into from
Feb 2, 2022
Merged

Conversation

TheSpyder
Copy link
Owner

  • Add Node.insertAtEnd binding
  • Deprecate Node.isSameNode

Fixes #49

I'm not sure if more are required, I think these are the only ones that tripped us up when we migrated last year. We should verify this before merging.

I didn't change isEqualNode because the order doesn't matter.

@TheSpyder TheSpyder requested a review from spocke as a code owner January 25, 2022 01:46
external insertBefore: (T.t, Dom.node_like<'a>, Dom.node_like<'b>) => Dom.node_like<'a> = "insertBefore"
external insertBefore: (T.t, ~new: Dom.node_like<'a>, ~before: Dom.node_like<'b>) => Dom.node_like<'a> = "insertBefore"
@send
external insertAtEnd: (T.t, ~new: Dom.node_like<'a>, @as(json`null`) _) => Dom.node_like<'a> = "insertBefore"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Weird didn't know you could do that seems like the same thing as appendChild.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah I didn't know this existed either, until I was reading the specs while working on the branch. Maybe it doesn't make sense to have both bindings but who knows, maybe some developers prefer to use parent.insertBefore(child, null) 🤷‍♂️

Add `Node.insertAtEnd` binding
Deprecate `Node.isSameNode`

Fixes #49
@TheSpyder TheSpyder merged commit 45ab0db into main Feb 2, 2022
@TheSpyder TheSpyder deleted the named_arguments branch February 2, 2022 04:15
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.

Add named arguments to functions that has the ambiguous ordering
2 participants