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

Prompt for ignoreURLParametersMatching in workbox wizard #2758

Closed
jeffposnick opened this issue Feb 17, 2021 · 3 comments
Closed

Prompt for ignoreURLParametersMatching in workbox wizard #2758

jeffposnick opened this issue Feb 17, 2021 · 3 comments
Assignees
Labels
Developer Experience Related to ease of use for developers. Good First Issue This would be an ideal issue for a new contributor to take on. workbox-cli workbox-precaching

Comments

@jeffposnick
Copy link
Contributor

For background, see https://stackoverflow.com/questions/66229902/

We can add a question to workbox wizard that checks to see if the developer has a web app manifest with a start_url that uses a query parameter, like homescreen=true or something else other than utm_ or fbclid, and if so, sets up the ignoreURLParametersMatching parameter for them.

@jeffposnick jeffposnick added Developer Experience Related to ease of use for developers. Good First Issue This would be an ideal issue for a new contributor to take on. workbox-cli workbox-precaching labels Feb 17, 2021
@ognjenjevremovic
Copy link
Contributor

Hey @jeffposnick 👋

I have been developing a PWA lately for my personal website and found workbox to be super useful! (Thanks GoogleChrome dev team for such an amazing tool 🥳 ).

I wanted to contribute to the project and saw this issue open and labeled as a good first issue.
Since I didn't make any PR to workbox previously, I find this issue to be very welcoming to first time contributors to the project.
Can you confirm that issue is still open (with no work being done) and is up for grabs? 🙂

If so, can you please provide more info on where one could start in order to successfully implement this?

Many thanks! 🎉

@jeffposnick
Copy link
Contributor Author

Thanks for the kind words, and the offer to help! It would be appreciated.

The code for workbox-cli is in TypeScript, so it would help if you're comfortable with that. Otherwise, we can provide some guidance during a PR review.

There are three pieces of the codebase you'd have to modify:

  • A new question under that would live in this directory. You can use any of the existing questions as a guide. The question's return value should be an array of RegExp objects, and the default value should be [/^utm_/, /^fbclid$/], to match the current inferred default.

  • ask-questions.ts, which is the list of questions asked during the wizard process. You'd want to run the new "question" code here, save the result to a local variable, and set config.ignoreURLParametersMatching based on the answer to the question.

  • Modify the existing ask-questions.js and add a new test for your question in the test suite. After making those changes, ensure that npx gulp test_node passes.

Let me know if that all sounds reasonable, and please do reach out if anything doesn't work as expected!

@ognjenjevremovic
Copy link
Contributor

Thank you so much for a prompt response and for the detailed instructions regarding this issue.
I'll be sure to take a closer look and hopefully report back with the PR in the upcoming days 🙂 .

I'll be sure to write back if something is unclear or I need a further guidance.

ognjenjevremovic pushed a commit to ognjenjevremovic/workbox that referenced this issue Feb 25, 2021
Extend workbox-cli with a question regarding the
'ignoreURLParametersMatching' workbox config parameter.

✅ Closes: GoogleChrome#2758
ognjenjevremovic pushed a commit to ognjenjevremovic/workbox that referenced this issue Feb 25, 2021
Provide tests for the query parameters in start url question (tests
lib/questions/ask-start_url-query-params). Extend the
lib/questions/ask-questions.js tests with newly added question.

✅ Closes: GoogleChrome#2758
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Related to ease of use for developers. Good First Issue This would be an ideal issue for a new contributor to take on. workbox-cli workbox-precaching
Projects
None yet
Development

No branches or pull requests

2 participants