Kuestenschmiede / PwaBundle

Adds PWA functionality to a contao application.
https://con4gis.org
9 stars 1 forks source link

support old and new document root location #27

Closed tcurdt closed 1 year ago

tcurdt commented 1 year ago

The document root folder has changed

NEW: w/users/foo/neu23/public/sw001/manifest.webmanifest
OLD: w/users/foo/neu23/web/sw001/manifest.webmanifest

This change should support both locations. And and least not break the rest of the manifest if not found.

derkosmonaut commented 1 year ago

Im Serviceworker ruft er das Manifest unter folgendem Pfad auf: '/sw001/manifest.webmanifest', das Manifest selbst liegt aber hier: '/001/manifest.webmanifest' – dadurch wird nichts gecached.

tcurdt commented 1 year ago

Already worked on a bugfix. Still needs to be confirmed to be working. Sorry for the premature PR.

https://github.com/tcurdt/PwaBundle/blob/main/src/Classes/Services/ServiceWorkerFileWriter.php#L67

coastforge-mei commented 1 year ago

All good. I didn't have to make a version right away ;) If necessary, I will make a new version directly.

derkosmonaut commented 1 year ago

The path to the manifest is now generated correctly. The pages that are stored in the manifest are cached - but only the HTML (without images and scripts)?

coastforge-mei commented 1 year ago

Thanks. We check that. The path to the assets may also be wrong elsewhere.

tcurdt commented 1 year ago

Thanks. We check that. The path to the assets may also be wrong elsewhere.

So far I couldn't find that problem.

It looks like %contao.web_dir% passes in the correct root.

Looking at https://github.com/Kuestenschmiede/PwaBundle/blob/704318b93bed55398c263aef30ec6f0e6b9cf757/src/Classes/Services/ServiceWorkerCreationService.php#L40

it is what iterates the pages and builds the array of filenames - but I don't see assets handled there.

So maybe this just wasn't implemented yet?