Skip to content
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

Clean content-for method #8

Merged
merged 1 commit into from
Nov 23, 2015
Merged

Clean content-for method #8

merged 1 commit into from
Nov 23, 2015

Conversation

zzarcon
Copy link
Contributor

@zzarcon zzarcon commented Nov 23, 2015

Move ServiceWorker registration to another file in order to make it more readable and clean the content-for method /cc @miguelcobain

@zzarcon
Copy link
Contributor Author

zzarcon commented Nov 23, 2015

@jkleinsc if you like the approach, we can try to do the same for https://github.com/jkleinsc/broccoli-serviceworker/blob/master/lib/service-worker.js in order to make a bit more readable :)

@jkleinsc
Copy link
Owner

@zzarcon thanks for the PR! I do like the approach you have taken here. As far as generating the service-worker, it's an approach usable there as well, but I will say that I am planning on using Service Worker Toolbox to clean up the code. My thought is to use Service Worker Toolbox to do the heavy lifting around service workers and we would get the benefit of upstream fixes and improvements.

jkleinsc added a commit that referenced this pull request Nov 23, 2015
@jkleinsc jkleinsc merged commit da9227b into jkleinsc:master Nov 23, 2015
@miguelcobain
Copy link
Contributor

I fully support this, especially for the service worker file.

Doesn't the dependency need to be under dependencies instead of devDependencies?

@jkleinsc
Copy link
Owner

@miguelcobain Yes, it should be under dependencies. I am going to update some of the other dependencies (broccoli-funnel, broccoli-kitchen-sink-helpers and broccoli-merge-trees) and I will update the package.json.

@zzarcon
Copy link
Contributor Author

zzarcon commented Nov 23, 2015

@miguelcobain @jkleinsc you're right! It should be in dependencies good catch!

@zzarcon
Copy link
Contributor Author

zzarcon commented Nov 23, 2015

@jkleinsc yeah using sw-toolbox makes a lot of sense for me too. I just proposed the stringifile + placeholder replacements for clean up a bit the code, but yeah your proposal it's more robust!

@marco-c
Copy link
Contributor

marco-c commented Nov 24, 2015

I will say that I am planning on using Service Worker Toolbox to clean up the code

https://github.com/GoogleChrome/sw-precache could suit your needs and is simpler than sw-toolbox.
There's also https://github.com/mozilla/oghliner, which would give you other features as well (not only offlining, but also deployment to GitHub Pages).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants