The HTML and Fetch standards have been updated to add support for text imports, as in:
import text from "./path/to/file.txt" with { type: "text" };
The Fetch standard update includes a new destination "text" for such imports, which is then made available to servers via a Sec-Fetch-Dest: text header.
While reviewing my Firefox implementation for this, @Rob--W identified that the web extension webRequest.ResourceType and declarativeNetRequest.ResourceType also need consideration, and might warrant either adding a new text type there as well, or using other instead. Which one should we go with?
As potentially relevant context, it's likely that the import-bytes proposal will also be advancing in the relevant standards bodies, at least once immutable arraybuffers become available. That'd add { type: "bytes" } import attribute support. I'm not aware of any other new module types being advanced at the moment.
The HTML and Fetch standards have been updated to add support for text imports, as in:
The Fetch standard update includes a new destination
"text"for such imports, which is then made available to servers via aSec-Fetch-Dest: textheader.While reviewing my Firefox implementation for this, @Rob--W identified that the web extension
webRequest.ResourceTypeanddeclarativeNetRequest.ResourceTypealso need consideration, and might warrant either adding a newtexttype there as well, or usingotherinstead. Which one should we go with?As potentially relevant context, it's likely that the import-bytes proposal will also be advancing in the relevant standards bodies, at least once immutable arraybuffers become available. That'd add
{ type: "bytes" }import attribute support. I'm not aware of any other new module types being advanced at the moment.