cinnyapp / cinny

Yet another matrix client
https://cinny.in
GNU Affero General Public License v3.0
1.9k stars 244 forks source link

Load manifest.json from relative path #1752

Closed arenekosreal closed 4 months ago

arenekosreal commented 4 months ago

PWA is broken without this if deploy cinny on a sub path like /cinny/ because browser tries to load manifest.json from example.com/manifest.json instead example.com/cinny/manifest.json and will results to a 404

https://github.com/cinnyapp/cinny/pull/1588 did most of the jobs but it seems that the contributor forgot to update this.

Description

Fixes #

Type of change

Checklist:

github-actions[bot] commented 4 months ago

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

arenekosreal commented 4 months ago

I have read the CLA Document and I hereby sign the CLA

github-actions[bot] commented 4 months ago

Preview: https://1752--pr-cinny.netlify.app ⚠️ Exercise caution. Use test accounts. ⚠️

arenekosreal commented 4 months ago

If append base url on build, the built webapp will not be portable. Maybe I should set <link rel="manifest"/> in page and set its href attribute dynamically through JavaScript?

ajbura commented 4 months ago

to deploy on any subpath (like /cinny/) you have to build the app anyway as it is the requirement of app already (because of the react-router-dom).

arenekosreal commented 4 months ago

the built webapp will not be portable

This means that If cinny is packaged by a linux distribution, packagers cannot prepare this for users, and letting users edit built files by themselves is not a good idea.

ajbura commented 4 months ago

what i mean is that currently (in dev branch) cinny can only be packaged and distributed for a specific path (/ officially) and if consumers has to deploy it on other path (say /cinny/) they have to build it from source.

arenekosreal commented 4 months ago

OK, I will close this PR now because it is only useful for non-supported deployment and also breaks normal functions. Hope someone may find better ways in the future to let both of us happy.