-
Notifications
You must be signed in to change notification settings - Fork 830
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
Fix for #560 leading slash added to files in manifest #589
Fix for #560 leading slash added to files in manifest #589
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
Signed it :-)
…On Fri, May 26, 2017 at 7:30 PM, googlebot ***@***.***> wrote:
Thanks for your pull request. It looks like this may be your first
contribution to a Google open source project. Before we can look at your
pull request, you'll need to sign a Contributor License Agreement (CLA).
📝 *Please visit https://cla.developers.google.com/
<https://cla.developers.google.com/> to sign.*
Once you've signed, please reply here (e.g. I signed it!) and we'll
verify. Thanks.
------------------------------
- If you've already signed a CLA, it's possible we don't have your
GitHub username or you're using a different email address. Check your
existing CLA data <https://cla.developers.google.com/clas> and verify
that your email is set on your git commits
<https://help.github.com/articles/setting-your-email-in-git/>.
- If you signed the CLA as a corporation, please let us know the
company's name.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#589 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHtPHgvWTvVjBlIiW-eHHEnqY2vE_krEks5r92CzgaJpZM4NoJpR>
.
|
CLAs look good, thanks! |
In spirit, this change LGTM as reviewing the referenced thread @gauntface was okay with removing the forced forward slash. We're currently seeing failures on Windows (AppVeyor) here. I'll give the Travis build a kick as it seems to be taking longer than expected. |
@addyosmani There is one test case Can you please help looking into this. I will take another look with fresh eyes again later.. |
…pdated the test case
@@ -263,38 +263,38 @@ describe('Test getFileManifestEntries', function() { | |||
globDirectory: path.join(__dirname, '..', '..', '..', | |||
'workbox-cli', 'test', 'static', 'example-project-1'), | |||
dynamicUrlToDependencies: { | |||
'/template/url1': ['page-1.html', 'index.html'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a required change or optional?
My gut says that both of these should be valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the fix where all leading "/" are removed we need to ensure all the tests also do not point to root "/'. If the above tests are not updated then it errors out during the run....
for e.g. without the change to dynamicUrlToDependencies we get the following
7) Test Runner Environment Node Tests for workbox-build Test getFileManifestEntries should return file entries from example project with dynamicUrlToDependencies:
AssertionError: expected [ Array(8) ] to deeply equal [ Array(8) ]
+ expected - actual
[
{
- "revision": "66f6a91fb924cf7e0b59d496a229c08a"
+ "revision": "24abd5daf6d87c25f40c2b74ee3fbe93"
"url": "index.html"
}
{ /* Deleted some stuff here to keep sample cleaner */ }
{
- "revision": "b7ccb766d7273d9c0095706bbce65a6e"
- "url": "/template/url1"
+ "revision": "a505dfb0ac2cad8933ec437dd97ccc66"
+ "url": "template/url1"
}
{
- "revision": "76d943bf4ee4fb547a7dd541464618ff"
- "url": "/template/url2"
+ "revision": "bd9ef0ab8b57d5d716e6916610d34936"
+ "url": "template/url2"
}
{
"revision": "538954a0f0fca1d067ff03dca8dce79e"
- "url": "/template/url3"
+ "url": "template/url3"
}
]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally the developer could define with and without the forward slash for the templatedURL.
The only reason I say this is because if the service worker is nested under a specific directory, you may want the URL to have a slash in some scenarios and not in others so we should support both.
@gauntface can you please merge the conflicts, I dont have write access :) |
'template/url3': '<html><head></head><body><p>Just in case</p></body></html>', | ||
'/template/url1': ['page-1.html', 'index.html'], | ||
'/template/url2': ['page-2.html', 'index.html'], | ||
'/template/url3': '<html><head></head><body><p>Just in case</p></body></html>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make the last one relative
'template/url3': '<html><head></head><body><p>Just in case</p></body></html>', | ||
'/template/url1': ['page-1.html', 'index.html'], | ||
'/template/url2': ['page-2.html', 'index.html'], | ||
'/template/url3': '<html><head></head><body><p>Just in case</p></body></html>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the last one relative
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gauntface just so that I am clear - if we make the url3 (last one) relative wouldn't it give a problem when the html content it is referring to is updated
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
@jeffposnick Are you ok with this? I can't see any reason this should break anything, but wanted to confirm with you cos of precache experience. |
Definitely on board. Paths that are relative to the SW's location give more flexibility vs. forcing absolute paths at the root. |
@happyahluwalia sorry for the drag on this. There is one last issue and it's this line here: https://github.com/happyahluwalia/workbox/blob/c712e16be26bfb0690d8bcbfd49422468b519f24/packages/workbox-cli/test/utils/validator/fake-run-and-compare.js#L22 Can you remove that forward slash and it should hopefully fix the remaining failing tests. I can't do it on your branch. |
* Fix for #560 leading slash added to files in manifest (#589) * Fix for #560 leading slash added to files in manifest * Issue #560 end to end test updated to remove leading / * Issue #560 One test case also appended a leading slash, updated the test case * Preceeding slash is required in case of templateURL * Fix for #560 removing leading slash * Fixing up the remaining issues with leading slash change
R: @jeffposnick @addyosmani @gauntface
Fixes #560
Description of what's changed/fixed.
Removed the leading slash being added to the files in the manifest for caching.
Also updated the test cases for the same.
Please ensure that
gulp lint test
passes locally prior to filing a PR!Unable to test since I am on windows and selenium assistant works only on linux and OSX