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

[Type Definition] - Updates the manifest types to reflect the current specifications #68273

Open
wants to merge 10 commits into
base: canary
Choose a base branch
from

Conversation

coderfin
Copy link

@coderfin coderfin commented Jul 29, 2024

manifest-types.ts

The current types in manifest-types.ts are out of date in places and incorrect in places. This PR resolves the known issues.

file_handlers

The file_handlers array should contain objects with an accept object not an accept array.

See:

icons and shortcuts.icons

The icon.purpose badge value was replaced by monochrome and no longer exists in the specification.

See:

launch_handler

The launch_handler object currently supports one value client_mode that is a string or array of strings.
The strings have to be one of the defined values.

I'm curious where the platform and url values came from. I could not find those values in any documentation new or old.

See:

protocol_handlers

The protocol_handlers object does not support a title value.

I could not find any old or new documentation showing the title value.

See:

screenshots

The screenshots object supports form_factor, label, and platform in addition to the other image related values.
The form_factor value has to be either narrow or wide if specified.
The platform value, if specified, has to be one of the defined values.

See:

serviceworker

This member was removed from the specification.

See:

share_target

The share_target.params had the values name, value, and required. I could not find any old or new documentation showing these values.
The share_target had the values url, title, text, and files as direct values. These values should be, instead, values of share_target.params.

The action and params members are required.

The method string is case insensitive. (See bullet point 2. at https://w3c.github.io/web-share-target/level-2/#share_target-member). For practical reasons the type includes all caps and all lower variants.

The enctype must be application/x-www-form-urlencoded or multipart/form-data. Previously text/plain was included as a valid value but it is not. (See various places where it lists the valid values at https://w3c.github.io/web-share-target/level-2/#share_target-member)

The share_target.params value should be an object not an array of objects.

The share_target.params.files value should accept a single file or an array of files. (See bullet point 5. for single file and bullet point 6. for array of files at https://w3c.github.io/web-share-target/level-2/#share_target-member)

The share_target.params.files.accept value should accept a string or array of strings. (See bullet point 7. 2. for string and bullet point 7. 3. for array of strings at https://w3c.github.io/web-share-target/level-2/#share_target-member)

See:

@ijjk
Copy link
Member

ijjk commented Jul 29, 2024

Allow CI Workflow Run

  • approve CI run for commit: 57b9098

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@ijjk ijjk requested a review from huozhi July 29, 2024 15:53
@coderfin
Copy link
Author

coderfin commented Aug 6, 2024

While technically all members are optional in the specification, practically speaking there are required members to make the PWA installable.

  1. display or display_override
  2. icons
  3. name or short_name
  4. start_url

I personally think it would make sense to make display, icons, name, and start_url required in the types. With these four you can get an installable application. I'm curious what others think and if there are any arguments for or against making these four required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants