social-app icon indicating copy to clipboard operation
social-app copied to clipboard

Support routes in query string (`/?/`) to allow web app to be completely statically hosted.

Open elfprince13 opened this issue 9 months ago • 0 comments

Draft of an idea discussed with @haileyok in a thread this morning.

This lowers the barrier to entry for hosting forks of the app as no paths other than / are ever requested from the server, ergo no code needs to run on the server to support resolving deep links. Instead, the routes are encoded as query strings. For example /profile/username.bsky.social/ can be accessed as /?/profile/username.bsky.social. This means, for example, you could host a forked bsky web client with GitHub Pages, or potentially even serve it over IPFS or other non-HTTP protocols.

This still supports parsing old-style links; however, all links generated in the UI should be in the new style. A slightly more complex solution would be to detect old vs new style links and switch the generation appropriately to allow both versions to exist in parallel in perpetuity. Creating as a draft PR for discussion as I'm not sure what the considerations are here from the perspective of the official client.

[edit]

you can test how this works with:

npx expo export:web
npx serve web-build --single

elfprince13 avatar May 14 '24 19:05 elfprince13