-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(gatsby-plugin-manifest): add icon_options as an option to support the purpose property #12794
Conversation
It might be handy to add some documentation on how maskable works or when to use it. w3 links aren't super friendly for beginners |
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.
Thank you for adding this, @kripod 👍
Left some nits and a link to MDN instead of W3
Co-Authored-By: kripod <[email protected]>
Thank you for the review and the suggestions! MDN is a good idea, but unfortunately, it isn't nearly as detailed as W3C in this scenario. |
@sidharthachatterjee yes, probably, until the docs of MDN get improved |
@kripod I'm all for over documenting. I say we leave MDN in the comment and link w3 in the docs as an additional resource. that should cover everyone's curiosities without re-documenting the manifest spec itself. |
Sry guys, but this PR has some breaking bugs. I didn't take a close enough look before it was merged. Namely, if this object isn't specified it'll fail cause the "forEach" method doesn't exist on an undefined object. Second, the array is never deleted from what gets written to the Manifest file. I already have a clean up PR going to the Manifest code at #12757, I can add the fixes there. we just can't release without that PR then cause these will break everybody's build. UPDATE: My bad, the UPDATE 2: Another potential thing. Right now the contents of |
@moonmeister Overriding |
@kripod let me clarify: Currently, if I set my config like this: {
icon_options: {
purpose: `maskable`,
},
icons: [
{
src: `icons/icon-48x48.png`,
sizes: `48x48`,
type: `image/png`,
purpose: `all`,
},
{
src: `icons/icon-128x128.png`,
sizes: `128x128`,
type: `image/png`,
},
],
} The resulting config will be: {
icons: [
{
src: `icons/icon-48x48.png`,
sizes: `48x48`,
type: `image/png`,
purpose: `maskable`, // notice despite setting this in the 'icon' array, it has been changed.
},
{
src: `icons/icon-128x128.png`,
sizes: `128x128`,
type: `image/png`,
purpose: `maskable`, //this is applied
},
],
} What I am suggesting is that we make the resulting config be this: {
icons: [
{
src: `icons/icon-48x48.png`,
sizes: `48x48`,
type: `image/png`,
purpose: `any`, // notice despite setting this in the 'icon_options' object, my setting from the 'icon' array has persisted.
},
{
src: `icons/icon-128x128.png`,
sizes: `128x128`,
type: `image/png`,
purpose: `maskable`, // this is is still applied
},
],
} This allows the more specific |
@moonmeister Thank you for the clear example! I agree with your points and support swapping the order of precedence. |
@moonmeister as discussed in the oss meeting it's not a breaking issue. Browsers are super smart and actually do progressive enhancement pretty great. It doesn't really matter if extra stuff is in the manifest so it's not a breaking change :p but something we want to like fixed of course |
Description
Adds an option to specify PWA icon options, e.g.
purpose
.Related Issues
Resolves #12793