Skip to content

Integration with import-attributes #5640

@xtuc

Description

@xtuc

The proposal https://github.com/tc39/proposal-import-attributes, currently stage 2, provides a way for developers to add attributes to the in the import, for instance:

import json from "/foo.json" with type: "json";

The host will ensure that the resource is of type JSON.

In tc39/proposal-import-attributes#61 we are discussing if the host would send a header indicating the expected type to the server, I suppose that would be Accept. We decided that the type attribute isn't part of the module cache key.

On the other hand, tc39/proposal-import-attributes#16 shows that multiple representation of a resource may exist; BinAST and JavaScript for example.

Does sending a header based on the module type or other semantics make sense to you?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions