misskey-dev / misskey

🌎 A completely free and open interplanetary microblogging platform 🚀
https://misskey-hub.net/
GNU Affero General Public License v3.0
10.1k stars 1.38k forks source link

generate static web client when building to be hosted on free static page hosting providers #14892

Open ch1p2 opened 2 weeks ago

ch1p2 commented 2 weeks ago

Summary

since the frontend is completely static, we should generate a separately hostable web app when building

Purpose

currently the web client app server and the api server runs together, however, if the frontend web client is generated separately, it can be hosted on free static hosting platforms such as pages.dev and only the api server is hosted on your server. doing so can reduce the cost of server bandwidth

Do you want to implement this feature yourself?

kakkokari-gtyih commented 2 weeks ago

In fact, it is not completely static: depending on entities such as notes and users, the HTML itself sometimes contains tags like link that are referenced in lookups from other instances.

Also, if the same path is used, depending on the contents of the accept header, it may return HTML for the application or activity json, so it is not as easy as it sounds to extract the client app and serve from different location

Mar0xy commented 2 weeks ago

like kakkokari said it isn't completely static due to various entities though another reason is simply the use of Vue as soon as stuff like Vue, Next.js and etc comes into play making something static is completely thrown out of the window as all those framework render a lot of stuff via JS live in the HTML constantly modifying it.

There are reasons why there are special frameworks for static sites like handlebars.js and etc as those compile the stuff on build directly into the site/js.