Skip to content

Freshen up remote-ui/core APIs#197

Merged
lemonmade merged 8 commits intomainfrom
remote-root-api-refresh
Dec 7, 2022
Merged

Freshen up remote-ui/core APIs#197
lemonmade merged 8 commits intomainfrom
remote-root-api-refresh

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 force-pushed the remote-root-api-refresh branch from a6b0db2 to 367d314 Compare December 6, 2022 16:00
@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