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

Processing steps change the types of things (type errors) #817

Closed
mgiuca opened this issue Oct 24, 2019 · 1 comment
Closed

Processing steps change the types of things (type errors) #817

mgiuca opened this issue Oct 24, 2019 · 1 comment
Assignees
Labels

Comments

@mgiuca
Copy link
Collaborator

mgiuca commented Oct 24, 2019

Spun off from w3c/image-resource#8.

It seems there are "type errors" (in a spec sense, not like JavaScript TypeError problems) all over the manifest spec, since we process various members, changing their type, and store them back in the manifest WebIDL structure.

For example, start_url:

This sort of type error happens everywhere where a processing step changes the type of a member. They noticed it in the Image Resource spec, and the solution there was to define a "processed image resource" structure, capable of holding the transformed types. If Manifest were to switch over to using the Image Resource spec, we would now be forced to shove a "sequence of processed image resource" in several fields of type sequence<ImageResource>, but that wouldn't be any worse than the existing type errors.

Ideally, we would similarly define a "processed web app manifest", but that would be quite a lot of work and redundancy in the spec, which I'm not sure we want to maintain. A quick hand-wavey solution may be to update the existing term "processed manifest" to say that it is a structure with the same members as WebAppManifest, but whose types may be different, for example start_url is a URL, not a USVString.

@marcoscaceres
Copy link
Member

In 32b497c, I (finally) got rid of the IDL and converted the "processed manifest" to an (Infra) ordered map. It now just uses/checks JSON types.

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

No branches or pull requests

3 participants