Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

elfprince13
Copy link
Contributor

@elfprince13 elfprince13 commented May 14, 2024

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

…de in a web build. Somewhat hacky as it doesn't detect whether old (server-side) or new (client-side) routes are being used, but simple enough starting point
@gaearon
Copy link
Contributor

gaearon commented May 21, 2024

I think this isn't something we'd be able to commit to supporting so it might be easier to maintain as a fork. WDYT?

@elfprince13
Copy link
Contributor Author

The goal is to lower barrier to entry for experimenting in forks, so in that sense I see the attraction, but main downside of maintaining as a fork is it results in more time consumed trying to keep feature parity with upstream.

Is the hurdle here that you don't want to commit to pure client-side rendering in the future? Or just that the current implementation is breaking abstraction in a way that feels like it would be hard to maintain due to parallel code paths?

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.

None yet

2 participants