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

Parse shortcut icons in web app manifests #8660

Merged
merged 5 commits into from Nov 27, 2022
Merged

Parse shortcut icons in web app manifests #8660

merged 5 commits into from Nov 27, 2022

Conversation

grimsteel
Copy link
Contributor

@grimsteel grimsteel commented Nov 26, 2022

↪️ Pull Request

Update the web app manifest transformer plugin to also parse icons in shortcuts
Fixes #8379

💻 Examples

{
  "name": "Example",
  // Previously, only icons and screenshots were parsed/bundled
  "icons": [{
    "src": "images/icon48.png",
    "sizes": "48x48",
    "type": "image/png"
  }],
  "screenshots": [{
    "src": "images/screenshot.png",
    "sizes": "1280x720",
    "type": "image/png"
  }],
  "shortcuts" : [
    {
      "name": "Shortcut 1",
      "url": "/shortcut/",
      // Now, these will also be parsed/bundled
      "icons": [{
        "src": "images/shortcut-icon48.png",
        "sizes": "48x48",
        "type": "image/png"
      }]
    }
  ]
}

🚨 Test instructions

Updated .webmanifest integration test

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@grimsteel grimsteel marked this pull request as ready for review November 26, 2022 07:09
@mischnic
Copy link
Member

Looks good, please also add the shortcuts to the schema at the top, so change it to this:

const MANIFEST_SCHEMA: SchemaEntity = {
  type: 'object',
  properties: {
    icons: RESOURCES_SCHEMA,
    screenshots: RESOURCES_SCHEMA,
    shortcuts: {
      type: 'array',
      items: {
        type: 'object',
        properties: {
          icons: RESOURCES_SCHEMA,
        },
      },
    },
  },
};

@grimsteel
Copy link
Contributor Author

I will also update the should throw on malformed icons and screenshots integration test

Copy link
Member

@mischnic mischnic left a comment

Choose a reason for hiding this comment

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

Thanks!

@mischnic mischnic merged commit bfb707e into parcel-bundler:v2 Nov 27, 2022
lettertwo added a commit that referenced this pull request Dec 8, 2022
* upstream/v2:
  Make sure we're compiling on ubuntu-20.04
  v2.8.1
  Add mjs and cjs to resolver extensions (#8667)
  Fix transformer-svg-react not finding .svgrrc's (#7741)
  Fix overriding single export of a `export *` (#8653)
  chore: spelling fix (#8614)
  Parse shortcut icons in web app manifests (#8660)
  Make ts-types transformer work with TS >= 4.8 (#8661)
  Don't retarget dependencies with `*` (#8645)
  fix: remove @parcel/utils dep in @parcel/graph (#8630)
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.

Icons in webmanifest do not resolve
2 participants