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

Freshen up remote-ui/core APIs #197

Merged
merged 8 commits into from
Dec 7, 2022
Merged

Freshen up remote-ui/core APIs #197

merged 8 commits into from
Dec 7, 2022

Conversation

lemonmade
Copy link
Member

This PR makes a few API updates to @remote-ui/core that fix some long-standing annoyances I have had with the APIs. You can see the important part of this change in the updated packages/core/src/types.ts file, but the overall goal was to get some slightly shorter names for common API methods, and to try to align closer to modern DOM APIs:

  • RemoteParent.appendChild is deprecated, with a new RemoteParent.append API recommended instead. This new API matches the DOM’s version; it allows you to pass multiple children, including strings that are converted to text nodes.
  • RemoteParent.insertChildBefore is deprecated, with a new RemoteParent.insertBefore API recommended instead. This matches the DOM, including the fact that the second argument can be null (in which case, the method behaves the same as append
  • RemoteParent.replaceChildren is new, and matches the DOM's API of the same name. It allows passing any number of children/ strings, and those are used to fully replace the existing children.
  • RemoteText.updateText is deprecated in favor of a new RemoteText.update method, which is simply shorter.

cc/ @developit

@lemonmade lemonmade merged commit e15d142 into main Dec 7, 2022
@lemonmade lemonmade deleted the remote-root-api-refresh branch December 7, 2022 15:09
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.

1 participant