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

goal parameter not defined in detail #17

Open
annevk opened this issue Nov 2, 2017 · 12 comments
Open

goal parameter not defined in detail #17

annevk opened this issue Nov 2, 2017 · 12 comments

Comments

@annevk
Copy link

annevk commented Nov 2, 2017

I've seen it used in an ASCII case-insensitive way, but it's not defined as such.

It's also not stated how it's to be used while parsing.

Also, not all hosts are going to use it since this kind of thing was rejected for HTML integration of JavaScript modules. So perhaps there should be some note that not all consumers/clients will use it.

cc @domenic

@bmeck
Copy link
Owner

bmeck commented Nov 2, 2017

@annevk

https://tools.ietf.org/html/rfc2046#section-1

MIME implementations must also ignore any parameters whose names they do not recognize.

There is no need to state that not all consumers/clients will use it.

@bmeck
Copy link
Owner

bmeck commented Nov 2, 2017

@allenwb I think goal symbols are specified in the ECMA262 spec, but we could specify that this parameter only applies to the ones in Syntactic Grammar. What do you think?

@annevk
Copy link
Author

annevk commented Nov 2, 2017

There is no need to state that not all consumers/clients will use it.

I think there is, since by defining the parameter you are setting the expectation that it will be recognized.

@allenwb
Copy link

allenwb commented Nov 2, 2017

@bmeck Yes, the official ECMA-262 are the ones listed in the Syntactic Grammar clause you referenced.

But what about cjs modules? Technically, they don't parse as either the Script or Module goal. I can imagine that a package manager that serves all kinds of js code could usefully distinguish all three.

@bmeck
Copy link
Owner

bmeck commented Nov 2, 2017

@allenwb CJS is getting a separate MIME nodejs/TSC#371

bmeck added a commit that referenced this issue Nov 2, 2017
specify that the goal parameter is case insensitive per #17
@bmeck
Copy link
Owner

bmeck commented Nov 2, 2017

@annevk

I think there is, since by defining the parameter you are setting the expectation that it will be recognized.

Wouldn't a possible solution be to amend the HTML spec for this parameter as well? It isn't as intrusive as a completely new MIME.

@annevk
Copy link
Author

annevk commented Nov 3, 2017

What kind of modification do you have in mind?

@annevk
Copy link
Author

annevk commented Nov 3, 2017

(I don't really see how it's less intrusive btw.)

bmeck added a commit that referenced this issue Nov 4, 2017
specify which goal symbols are to be used per #17
@bmeck
Copy link
Owner

bmeck commented Nov 4, 2017

@annevk

https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-script

Already checks content-type metadata for information on encoding. Any reason it can't check for goal existing and not equaling script there? IDK if <script> type= check relates really since it doesn't use content-type.

https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-module-script

Doesn't do the encoding check, but does check the actual content-type. Any reason it can't check goal existing and not equaling module there?

The spec here has clarified the goal symbols and case insensitivity, so that should be cleared up. Let me know if spec needs any more clarifications.

@annevk
Copy link
Author

annevk commented Nov 6, 2017

Sure, such modifications could be made, provided there's implementers willing to implement that.

@annevk
Copy link
Author

annevk commented Nov 6, 2017

However, until that's actually proposed and carried through by someone, #17 (comment) stands.

@bmeck
Copy link
Owner

bmeck commented Nov 6, 2017

@annevk I've made such a proposed change to start the process of discussing that then.

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

No branches or pull requests

3 participants