-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
sw-cache not working (for offline use) #30
Comments
@developit AFAIK we deliberately stopped |
I believe @wzulfikar is using a standard Again, @wzulfikar, if this is the case, you should try running |
@lukeed Then manual |
@NekR I'm not sure what you're saying? If you manually type in |
@lukeed you just said you believe @wzulfikar is using |
@lukeed i have a question... even if its a simple http server service workers are built with an exception of |
IMO, this check is too weak: https://github.com/developit/preact-cli/blob/222e7018dd360e40f7db622191aeca62d6ef0c9a/src/lib/entry.js#L7, i.e. as said here it doesn't allow What you need is this check: https://github.com/NekR/offline-plugin/blob/master/tpls/runtime-template.js#L8 (who could thought about that plugin 😏) |
^agreed to @NekR |
@NekR Yes you can -- This is why a You can use my Or see below: |
I don't really know why you answer it to me like I was asking if |
Should they test SW on production or have pre-production server with |
@NekR I was replying to
Let's not take this off-topic. I agree with the current checks in place, but can re-discuss this elsewhere. But FWIW, what you've added is both redundant (the Once @wzulfikar has a chance to respond, we can figure out if this issue is closed or not. If, in fact, a standard HTTP server was used, then this works as expected & should be closed. |
@lukeed the |
If you run
|
@lukeed just curious wouldn't that need dev to configure the certificate on his machine? |
@prateekbh No, it's done & included for you. Check it out! 🎉 |
Redundant because SW is already internally checking if And, the primary requirement for SW is HTTPS. As pointed out, SW has its own built-in secure contexts and its own built-in exceptions. This is why the current condition is sufficient. Off-topic because this issue is about @wzulfikar's usage specifically. Let's save this entire debate about the (in)adequacy of the checks for a separate discussion. It does not pertain directly to the question asked. I'm happy to discuss this further 😀 I just don't think this is the place for it. That's all 👍 |
@lukeed dont you feel an additional |
I'm not advocating for There's no need to cache and test-run There is a need and/or reason to test-run |
I have my reasons, but by following your logic
Double standards. What security you bring by banishing
Adding correct checks directly solves @wzulfikar's issue. Not everybody uses node.js. What a surprise. |
@lukeed are you fighting for "my beautiful software" here? If something, this particular tool is written for people (yeah), not only for... |
I didn't realize we were manually exempting localhost - I've never had to do that before and never had issues with HMR. Maybe I've just been using devtools' bypass feature though? |
@prateekbh that's the catch. I didn't know if we deliberately stop Now that I know we deliberately stop Using Probably, we can just put in the readme about the state of offline feature in localhost so people don't bother testing it and for them to not getting confused when |
@lukeed @developit first thing i'll do is to add this note in README. But i guess this will surely get a debate going on about it, as devs AFAIK do test sw on normal localhost as well |
thanks @prateekbh :) Shall we close this issue for now? |
I'll open a parallel issue and close this |
noted :) |
Just a note here - I think we need to include some instructions around accepting the self-signed SSL cert somewhere. People are tripping over it, but it's fairly important. Really nice once you get the cert added and you can have a green lock during development :) |
Is it intentional that sw cache doesn't work out of the box?
I did
preact create my-great-app
, build the project usingnpm run build
and servebuild/
using php simple server.I visit my localhost, the site is up, I can see the code to register service worker in
/bundle.js
but the registration code wasn't executed. However, it works if i manually register it again, i.e. by executingnavigator.serviceWorker.register('/sw.js', { scope: '/' });
in browser console.I'm using Opera 45 in OSX.
The text was updated successfully, but these errors were encountered: