All-purpose web tiles library

Custom HTML element for webtiles #21

Open chrisshank.me
Open opened by chrisshank.me

I would like to propose that the interface for a web tile should be a custom HTML element rather than the imperative mothership/loader in @dasl/tile-loader. The goal is to streamline the interface of a web tile, let it be rendered in a agnostic manner and programmatically interact with it. Currently the way TileMothership generates a tile, then the tile generates an iframe that the app renders is a little awkward and the iframe feels like a implementation detail.

This would also fix #6 and #3 because the custom element could provide default styles (that could also be overridden). I have an old prototype to do this and I'm happy to rebase and put up a PR for this. But I just to chat about if this is a direction you're interested in first.

The new interface would look like this

// main.js
import { TileFrame } from '@dasl/tile-loader';
import { ATTileLoader }  from '@dasl/tile-loader/at';

// setup
TileFrame.loadDomain = '...';
tileFrame.webrtcGuard = 'none';
TileFrame.addLoader(ATTileLoader);

// Define the custom element
TileFrame.define();
<tile-frame src="at://did:plc:…/ing.dasl.masl/3mcjwwoqjqs2v"></tile-frame>

The custom element could also be called <web-tile>, but I like to think that webtiles are a new type of iframe. This could also be done as a breaking change or not, would be worth clarifying that.

Lol the deja vu, totally missed #1 was mirrored

Sign up or Sign in to add to the discussion.