- What we're building
- Where remote-ui comes in
- Our proposed architecture
- Open questions
tl;dr:
- very similar to ui extensions on your (and other) platforms – let developers add features to the UI
- it's been around for a few years, but still very early in opening it up for public use
- ensuring extensions match the UX of our app was an important design goal (sound familiar? :)
How UI Extensions work right now:
Right now, our system is backend-driven. Developers return a JSON payload from a serverless function (or hosted server), and we convert that JSON into React components. This is similar to Slack's extension model, if you're familiar with that.
We evaluated remote-ui
at the very beginning, but we weren't sure if it would work for us. We've tried sticking with the server-driven JSON approach, but it's just too painful and will take too long to make the DX good enough.
So, we went back re-evaluate remote-ui and are committed to making it work this time. We've been testing everything out, and are quite happy with the early results:
We began with the comprehensive example and have been working backward to fit the pieces into our existing architecture.
- There can be many extensions rendered on the same screen, in different places
- On load, we receive a JSON payload with a list of extensions to show on the screen with metadata (cdn URL, version they built it with, what data they want passed into the remote component)
- We replaced the webpack plugin helpers for just-in-time sandboxed iframes, with a "remote-environment" deployable app so we can:
- manage the remote-environment library version(s) independently from the Host
- have different remote configs for different audiences (one for internal teams that's more permissive)
- experiment with supporting different authoring frameworks (vue externally, react internall)
- To do that ☝, we've reverse-engineered the
MessageChannel
ports swap to connect the Host to the Remote that's hosted inside the sandboxed iframe
- Any concerns with our usage so far? Particularly around versioning or performance?
- Anything we should be aware of when building dev-tooling? Example: triggering live-reloads for local dev (w/vite) and proper setup/teardown to avoid leaking memory / "ghost" UI issues?
- example: See cargo-culted
MessageChannel
port swap mentioned above
- example: See cargo-culted
- Performance stress test
- Making internal product features available inside the extension via sdk/library
- Cross-browser testing (and evaluating polyfilll compatibility with our stack)
- Working toward releasing Beta over the next few months