-
#191
77ba3da
Thanks @lemonmade! - Added support for React 18 by having the consumer own the versions ofreact
andreact-reconciler
. If you are currently using React 17 only, and are rendering in the “remote” context, you will need to add a dependency onreact-reconciler^0.27.0
. If you are using React 18, you will need to manually install the version ofreact-reconciler
that matches up to that version (currently,^0.29.0
). -
#191
77ba3da
Thanks @lemonmade! - Removed re-export of@remote-ui/rpc
. If you needretain
orrelease
, import them directly from@remote-ui/rpc
instead.
-
#197
e15d142
Thanks @lemonmade! - Added a number of methods that align more closely with the corresponding DOM API, and deprecated a few existing methods with overlapping functionality:RemoteParent.appendChild
is deprecated, with a newRemoteParent.append
API recommended instead. This new API matches theElement.append
DOM API: it allows you to pass multiple children, including strings that are converted to text nodes.RemoteParent.insertChildBefore
is deprecated, with a newRemoteParent.insertBefore
API recommended instead. This matches theNode.insertBefore
DOM API, including the fact that the second argument can be null (in which case, the method behaves the same asappend
RemoteParent.replaceChildren
is new, and matches theElement.replaceChildren
DOM API. It allows passing any number of children/ strings, and those are used to fully replace the existing children.RemoteComponent.remove
andRemoteText.remove
are new, and match theElement.remove
DOM API.RemoteText.updateText
is deprecated in favor of a newRemoteText.update
method, which is a little shorter.
- Updated dependencies [
e15d142
]:- @remote-ui/[email protected]
- @remote-ui/[email protected]
- The
render
function is deprecated. Please move to using the newcreateRoot
instead, which matches the API provided by React.
- Fixed a missing
useAttached()
export in the@shopify/remote-ui/host
entrypoint.
- Added a
parent
property to theControllerOptions#renderComponent()
method, which allows you to customize the host rendering of a component based on where it is in the UI component tree (pull request)
- Pinned
react-reconciler
to0.26.x
to prevent breaking React 17 projects (pull request, thanks @ericfrank-stripe!)
- Removed some unused hooks and context (pull request)
- Fixed rendering a single child inside a component that takes
fragmentProps
(pull request).
- Calling
render()
multiple times with the sameRemoteRoot
now updates the root React element being rendered to theRemoteRoot
(pull request).
- The
useWorker()
export was removed from@remote-ui/react/host
. If you want the same API, you can use@shopify/react-web-worker
instead. This change was made as a result of deprecating@remote-ui/web-workers
.
- Prevented
children
from being rendered unnecessarily in React when a remote node does not have any children (pull request)
- Add component and text renderer to controller (pull request)
- Fix types dependency (pull request).
- Fix worker webpack build (pull request).
- Add
RemoteFragment
to support component props as sub tree (39be759).
- Breaking: now uses the
jsx-runtime
transform, and therefore requires React^17.0.0
(pull request). - Breaking: updated the dependency on
@remote-ui/core
to2.0.0
.
- Breaking: the
RemoteRenderer
component no longer accepts acomponents
mapping directly (pull request). Instead, it accepts acontroller
prop, which you must construct with your component mapping using the newcreateController
function. If you are only using the remote React utilities (e.g., you were not importing from@remote-ui/react/host
), this change does not affect you. - Loosened the version constraints on React and
react-reconciler
to allow the usage of React 17.x (pull request).
-
Breaking: calling
render()
will no longer callRemoteRoot#mount()
after the initial reconciliation (pull request). To reproduce the old behavior, you can use the new third argument torender()
, a callback that is executed after the initial reconciliation:import {createRemoteRoot} from '@remote-ui/core'; import {render} from '@remote-ui/react'; const root = createRemoteRoot(() => {}); render(<App />, root, () => { root.mount(); });
- Fixed an issue where the
RemoteRenderer
component would throw an error if a remote component was removed from the tree while its host representation was in the process of mounting.
- Added entry point information to
package.json
.
- Fixed a build issue that caused errors when using a number of packages in projects that do not have
[email protected]
installed.
Initial release.