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

Can we/should we make std:x | y work? #14

Open
domenic opened this issue May 4, 2018 · 5 comments
Open

Can we/should we make std:x | y work? #14

domenic opened this issue May 4, 2018 · 5 comments
Labels
fallback syntax An issue with the syntax for falling back from a LAPI to a polyfill

Comments

@domenic
Copy link
Collaborator

domenic commented May 4, 2018

@drufball wrote some example slides wherein he did

<script type="module"
        src="std:virtual-list | https://cdn.example.com/virtual-list.js">
</script>

Per the current spec, that won't work; it'll look for a layered API named "virtual-list " (which doesn't exist; note the space).

The space after the | is not a problem, as URL parsing strips ASCII whitespace.

Probably we should just insert a step to strip ASCII whitespace from the LAPI identifier?

/cc @hiroshige-g

@domenic domenic added the fallback syntax An issue with the syntax for falling back from a LAPI to a polyfill label May 7, 2018
@domenic
Copy link
Collaborator Author

domenic commented May 7, 2018

In #15 @hiroshige-g noted that using spaces in URLs is invalid. Even if we make | valid (#15), we won't make spaces valid, as that causes problems with places like srcset="". So this issue is about whether we should attempt to be a bit nicer to users who type invalid URLs.

I am undecided.

@ojanvafai
Copy link
Collaborator

Stripping trailing/leading whitespace around the "|" seems good to me. Putting those spaces in makes these URLs considerably more legible IMO. I guess a question is whether we should allow newlines. I think not?

@ojanvafai
Copy link
Collaborator

I don't feel strongly though if there are good coutnerarguments.

@domenic
Copy link
Collaborator Author

domenic commented May 8, 2018

I think we'd probably just use the standard strip ASCII whitespace algorithm which would allow newlines.

@mathiasbynens
Copy link
Contributor

I weakly prefer being strict and disallowing whitespace, at least initially. This seems like one of those things that can always be loosened up later. OTOH, if we allow whitespace now, we won't be able to go back.

domenic added a commit that referenced this issue Aug 3, 2018
This incorporates some of the ideas touched on in the issue tracker, mostly around using package name maps to provide a better fallback story and web developer control. It touches on the following issues:

* Fixes #10, fixes #14, fixes #15, and fixes #24 by moving away from std:x|y and its attendant problems.
* Opens the door to solutions for #5 based on the speculative package name map fallback ideas.

It also adds a bit more motivation to the intro, and rearranges to emphasize the standards process, before diving into many details on the importing infrastructure.

For now we delete the "Trying these ideas out" section, and spec.md, as they are all about the old infrastructure.
domenic added a commit that referenced this issue Aug 3, 2018
This incorporates some of the ideas touched on in the issue tracker, mostly around using package name maps to provide a better fallback story and web developer control. It touches on the following issues:

* Fixes #10, fixes #14, fixes #15, and fixes #24 by moving away from std:x|y and its attendant problems.
* Opens the door to solutions for #5 based on the speculative package name map fallback ideas.

It also adds a bit more motivation to the intro, and rearranges to emphasize the standards process, before diving into many details on the importing infrastructure.

For now we delete the "Trying these ideas out" section, and spec.md, as they are all about the old infrastructure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fallback syntax An issue with the syntax for falling back from a LAPI to a polyfill
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants