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

Rename the SVG <script> async/defer feature #677

Closed
wants to merge 1 commit into from
Closed

Conversation

foolip
Copy link
Collaborator

@foolip foolip commented Mar 8, 2024

The type="module" support makes more sense as part of JS modules:
#676

Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

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

https://github.com/web-platform-dx/web-features/pull/676/files#r1517665897 says you're removing svg.elements.script.type.module from this feature. I think it's fine to remain (so the alias still makes sense), so I'm approving as is, but if you think it shouldn't be in the feature after all, I'd like to hear a little more about why.

Copy link
Collaborator

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

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

If you leave it in, you are creating situation 4 for MDN: #654 (comment). MDN doesn't have its own page for this BCD key, so it might not be a problem.

@foolip
Copy link
Collaborator Author

foolip commented Mar 8, 2024

There are a few things to contemplate here.

The feature "SVG <script> works like HTML <script>" is very contingent on how browsers evolved. It feels much more contingent-y than most features, and eventually won't be considered a feature at all. Note how I dropped the modules part from the name of this feature to make it shorter, but that didn't really make sense...

On the contents of this feature, I don't think modules and defer should be in a single feature. They are actually mutually incompatible, and an HTML validator will say:

A script element with a defer attribute must not have a type attribute with the value module.

The remaining question is whether async + defer makes sense as a feature, either just for SVG or for HTML+SVG. Caniuse has split it differently:
https://caniuse.com/script-async
https://caniuse.com/script-defer

I'm leaning towards matching that, and either treating SVG support as a (future) note or having "in SVG" features as suggested in #676 (review).

@ddbeck
Copy link
Collaborator

ddbeck commented Mar 8, 2024

The feature "SVG <script> works like HTML <script>" is very contingent on how browsers evolved. It feels much more contingent-y than most features, and eventually won't be considered a feature at all. Note how I dropped the modules part from the name of this feature to make it shorter, but that didn't really make sense...

Hmmm. I feel that something like this should be allowed to (co-)exist? Spitballing here, but maybe we'd be better served by a few (partly overlapping) groups:

  • SVG script equivalency
  • SVG script async
  • SVG script defer
  • JS modules

The first one would probably be short-lived (we'd acquire some irrelevance guideline, like BCD), while the others would persist for a long time.

@@ -1,4 +1,5 @@
name: SVG <script> async and defer
alias: svg2-script-html-equivalence
spec: https://svgwg.org/svg2-draft/interact.html#ScriptElement
status:
baseline: false

This comment was marked as spam.

This comment was marked as spam.

@foolip foolip changed the title Trim and rename the SVG <script> async/defer feature Rename the SVG <script> async/defer feature Mar 15, 2024
@foolip
Copy link
Collaborator Author

foolip commented Mar 15, 2024

The JS modules part of this features was extracted in #676.

The identifier for this will continue to bug me, in particular the number 2, so I've updated this to svg-async-defer. But should we even have this feature, or should we put back JS modules and rename it to svg-script-parity or something?

@ddbeck
Copy link
Collaborator

ddbeck commented Mar 16, 2024

@foolip can you show example YAML for that? I'm not quite sure what you mean.

@niloferm1984

This comment was marked as spam.

@niloferm1984

This comment was marked as spam.

@foolip
Copy link
Collaborator Author

foolip commented Mar 16, 2024

@ddbeck I mean like #700.

@ddbeck
Copy link
Collaborator

ddbeck commented Mar 16, 2024

Thanks, @foolip. Very helpful to understand the options here. I guess looking back on what I said in #677 (comment), I think my preferences on this are now:

  • Split this PR in two, as in svg-script-async and svg-script-defer. (Reasoning here that web developers won't be looking for both async and defer, they'll just be wondering why the one they tried to use isn't working.)
  • Drop Rename and restore the SVG <script> parity feature #700 and the "equivalency" angle entirely. I see now that "equivalency with HTML" is not a feature. It's why async and defer should work in SVGs, but I have a hard time seeing it as a thing one could use. As if you'd want the option to insert a script tag into either HTML or SVG dynamically or something? It's too weird.

@ddbeck
Copy link
Collaborator

ddbeck commented Mar 16, 2024

And on a meta issue: I've sent a message to François to look into spam controls on the repo—I don't have the necessary privileges in the web-platform-dx org.

@niloferm1984

This comment was marked as spam.

@foolip
Copy link
Collaborator Author

foolip commented Mar 16, 2024

@ddbeck sounds like we're on the same page, I don't think this amounts to a coherent feature.

@niloferm1984

This comment was marked as spam.

@foolip foolip closed this Mar 19, 2024
@foolip foolip reopened this Mar 19, 2024
@foolip
Copy link
Collaborator Author

foolip commented Mar 19, 2024

Reopening just to serve as a reminder to split into smaller features.

@foolip foolip marked this pull request as draft March 19, 2024 17:33
@foolip
Copy link
Collaborator Author

foolip commented Apr 25, 2024

I'll close this and open an issue instead.

@foolip foolip closed this Apr 25, 2024
@foolip foolip deleted the svg-async-defer branch April 25, 2024 13:06
ddbeck added a commit to ddbeck/web-features that referenced this pull request May 28, 2024
To quote myself in
web-platform-dx#677 (comment):

> [This] is _not_ a feature. It's _why_ async and defer should work in SVGs, but I have a hard time seeing it as a thing one could _use_. As if you'd want the option to insert a script tag into either HTML or SVG dynamically or something? It's too weird.

Fixes web-platform-dx#963
foolip pushed a commit that referenced this pull request May 28, 2024
To quote myself in
#677 (comment):

> [This] is _not_ a feature. It's _why_ async and defer should work in SVGs, but I have a hard time seeing it as a thing one could _use_. As if you'd want the option to insert a script tag into either HTML or SVG dynamically or something? It's too weird.

Fixes #963
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.

4 participants