GithubHelp home page GithubHelp logo

Comments (4)

domenic avatar domenic commented on September 28, 2024

I'm unsure whether this is a bug report (i.e. the spec does not match the tests) or a request for increasing the spec's clarity.

The intent of the quoted section is to be a non-normative summary of the normative requirements elsewhere. And I think it achieves that at a high level. It doesn't give the full normative details on what "not accepted" means; if you go read the parts of the spec that consult the "acquiring import maps" flag, then you see that it means an error event is fired and the resulting import map is not registered. But I think it's OK for such notes, like code comments in implementations, to not fully duplicate the "what". They can focus on the "why".

But, if you found the note confusing, we can clarify it. And if you think the spec is just failing to properly reject import maps after the first module, then that's a bug and we should fix it!

from import-maps.

allstarschh avatar allstarschh commented on September 28, 2024

This is a request for increasing the spec's clarity.

So the paragraph in Prepare a Script, is read to me like:
The boolean 'acquiring Import Maps' is used to make sure there's only 1 import map script tag in the document.
Because in the 'Prepare a Script' section there's only 1 place mentioning to set acquiring import maps to false.

But after reading the test in wpt of import maps, I realized I need to check the non-normative section of acquiring import maps as well, to find out that the boolean variable is also used to keep track of the first module load. And then onerror should be fired according to the spec

So I have to check the spec back and forth, and also have to check how the test is written in wpt, to figure out the exact meanings.
And if something is tested in wpt, shouldn't the spec define it clearly?

from import-maps.

domenic avatar domenic commented on September 28, 2024

I believe this is fixed in whatwg/html#8075. Please check. If so, I will close this when I remove all spec text from this repository and instead let HTML be the new source of truth.

from import-maps.

allstarschh avatar allstarschh commented on September 28, 2024

Fixed in prepare the script element, Step 31.2.

"importmap"
If el's relevant global object's import maps allowed is false, then queue an element task on the DOM manipulation task source given el to fire an event named error at el, and return.

from import-maps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.