PSDTools / GPA_Calculator

[MOVED] A(n awesome) PWA that (hopefully) calculates your GPA!
https://github.com/PSDTools/psdtools.github.io/tree/main/apps/gpa-calculator
1 stars 0 forks source link

PWA Is not available offline #8

Closed PetalCat closed 1 year ago

PetalCat commented 1 year ago

Should be a service worker thing

lishaduck commented 1 year ago

Currently, you're just making an installable PWA, caching will need more. You can find the caching code on the docs: https://docs.pwabuilder.com/#/starter/service-worker.

ParkerH27 commented 1 year ago

it works offline for ios(iphone not mac) but not android running chrome

lishaduck commented 1 year ago

Hmmm.

ParkerH27 commented 1 year ago
Screen Shot 2023-03-31 at 5 38 28 PM

happens on both my phone and laptop. Iphone with safari works wonders though

lishaduck commented 1 year ago

Try now.

PetalCat commented 1 year ago

20230331_184531.jpg

script.js is dying

PetalCat commented 1 year ago

It is looking in the src/ folder for it

lishaduck commented 1 year ago

I tried moving it there. Give me some time. I'm doing both bio homework and this.

PetalCat commented 1 year ago

Ok... It's fine.. take your time... There is no rush

lishaduck commented 1 year ago

I don't think I'll have time to update to Lit over the weekend, but migration shouldn't be hard: PWA-Starter

PetalCat commented 1 year ago

Like I said there's no rush... I can try to begin understanding what you're talking about but I'm scared I would screw it up more

On Fri, Mar 31, 2023, 7:06 PM Eli @.***> wrote:

I don't think I'll have time to update to Lit https://lit.dev/ over the weekend, but migration shouldn't be hard: PWA-Starter https://docs.pwabuilder.com/#/starter/adding-content

— Reply to this email directly, view it on GitHub https://github.com/PSDTools/GPA_Calculator/issues/8#issuecomment-1492746176, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3ERBBRZKMEWVGTOLMTKODW65WSHANCNFSM6AAAAAAWPBZLBE . You are receiving this because you authored the thread.Message ID: @.***>

PetalCat commented 1 year ago

If anything I'll probably start working on the centralization app and just making it pretty... I'm going to try and find a template for like tailwind or something for a dashboard and set it up so that we can add as many apps as we want

lishaduck commented 1 year ago

I think we need to migrate to lit/vaaldin first for SPA, before centralising-we need to support multiple pages

PetalCat commented 1 year ago

Did you read my idea on centralization in the PSD tools discussions.... I have a theory that we can use the PSD tools website and keep everything a separate repositories and only package the main website. Then set up the service worker to cache all of our repositories into one app. That way our centralization is one repository and the rest of the tools are their own as well instead of combining everything and then maybe making a change that causes problems elsewhere and creating a headache

PetalCat commented 1 year ago

But I do agree Yes we need multi-page support for all of our tools

PetalCat commented 1 year ago

Cause in theory are base URL which is our PSD tools website structure looks like

PSDTools.github.io(main repo/dns)
├── GPA-Calulator(repo and site)
└── any other repository that has a GitHub pages with the base dns address

So technically we can access and cache any other repository we have from our base URL website

Cause when you do root of / you have to specify GPA calculator so I'm thinking if you do root of slash in the centralization app you can access and cache all of the other repositories (tool GitHub pages) into one main pwa

PetalCat commented 1 year ago

Then all of the other tools stay as websites (we would revert the GPA calculator back to being just a website and move the code over to the centralized repository) and we would just package them all into one using the base. At that point we can build in any tools we want in pretty much any way we want and they all in the end magically cache and package into one pretty application (and website)

PetalCat commented 1 year ago

Sorry for the mouthful I just explained the same thing in like seven different ways

lishaduck commented 1 year ago

Theoretically, we could, but getting vite happy that way would be... difficult.

lishaduck commented 1 year ago

Did you read my idea on centralization in the PSD tools discussions?

Have now

lishaduck commented 1 year ago

So we have an issue. We're linking js in as a module, but getCookies needs it to not be a module. Pretty sure setting it from script.js should fix it, but I'm not enough of a JS guy to know how to get the attribute correctly.

lishaduck commented 1 year ago

Never mind. TS is mad, but globalizing the functions in script.ts via

*** old.ts      Sun Apr  2 16:10:05 2023
--- new.ts      Sun Apr  2 16:10:25 2023
***************
*** 1,3 ****
! function `function`() {

  }
--- 1,3 ----
! window.`function` = () => {

  }

works. That resolved stuff, and with #10 resolved, this just magically fixed itself. However, it's not caching w3.css, but that's a different issue.