You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript allows exporting and importing names that are string literals and not just identifiers. This is for compatibility with future non-JS modules types that might not have the same restrictions on export names, like WASM, CSS, HTML, etc.
import{'product-card'asproductCard}from'./product.html` with {type: 'html'};import{'fast-inverse-square-root'asfastInverseSquareRoot}from'carmack.wasm';
π» Use Cases
What do you want to use this for?
Importing from non-JS modules and defining types for non-JS modules
What shortcomings exist with current approaches?
You can't do either of the above
What workarounds are you using in the meantime?
None?
The text was updated successfully, but these errors were encountered:
π Search Terms
export string name literal
β Viability Checklist
β Suggestion
JavaScript allows exporting and importing names that are string literals and not just identifiers. This is for compatibility with future non-JS modules types that might not have the same restrictions on export names, like WASM, CSS, HTML, etc.
See https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#prod-ModuleExportName
π Motivating Example
π» Use Cases
What do you want to use this for?
Importing from non-JS modules and defining types for non-JS modules
What shortcomings exist with current approaches?
You can't do either of the above
What workarounds are you using in the meantime?
None?
The text was updated successfully, but these errors were encountered: