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

sw-build support for templatedUrls #295

Merged
merged 7 commits into from
Mar 13, 2017
Merged

Conversation

jeffposnick
Copy link
Contributor

R: @addyosmani @gauntface

Fixes #263

This implements what's basically sw-precache's dynamicUrlToDependencies, but with a name that @gauntface agreed on. It also has support for both strings and globs as the value that uniquely determines the URL's contents, so there should be parity with @HenrikJoreteg's changes made in GoogleChromeLabs/sw-precache#262

I'm not 100% sure that I've made the changes in all the right places (do I need to touch something in sw-cli too?), as I'm not as familiar with this portion of the codebase. Feedback is appreciated.

Copy link
Member

@addyosmani addyosmani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One very minor comment. As far as I can tell there shouldn't be changes needed over in sw-cli to support this, but will allow the honorable @gauntface to confirm for sure.

The rest of this looks fairly straight-forward and implem LGTM as is.

@@ -2,7 +2,7 @@ const errors = require('./errors');
const filterFiles = require('./utils/filter-files');
const getCompositeDetails = require('./utils/get-composite-details');
const getFileDetails = require('./utils/get-file-details');
const getStringDetails = require('./utils/get-string-hash');
const getStringDetails = require('./utils/get-string-details');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed from get-string-hash -> get-string-details. I found the original name more specific description wise. Although you're generating hash -> updating -> returning digest. Small nit to consider.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get-string-details and get-string-hash are two distinct modules, and the reference to get-string-hash in the previous commit was a copy/paste error 😦

@gauntface
Copy link

LGTM from my side - only concern was accepting strings - not sure it makes sense vs just adding a custom {url: '', revision: ''} object in the service - for sw-precache this wasn't an option so the linked PR was required.

Happy to accept with or without for now - just raise an issue to discuss if you land as is :)

Otherwise code +1

@jeffposnick
Copy link
Contributor Author

Actually, since this is already reviewed, I'll merge as-is, and opened #300 to discuss whether to remove string support.

@jeffposnick jeffposnick merged commit 7bd7e48 into master Mar 13, 2017
@jeffposnick jeffposnick deleted the server-rendered-urls branch March 13, 2017 04:20
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