JSON Modules Can Now Be Imported in JavaScript in All Modern Browsers, CSS Modules to Follow
Briefly

Thomas Steiner, a Developer Relations Engineer at Google, announced the support for JSON module scripts in all major browsers. This feature allows developers to import JSON modules directly into their JavaScript, enhancing ease of use and efficiency. The development builds on the Import Attributes proposal, with native CSS modules potentially on the horizon. The specification supports loading non-JS modules without extra parsing, addressing earlier developer challenges with bundlers and polyfills. Notably, JSON modules will not include named exports as part of their design.
Developers using the latest version of modern browsers can now directly import JSON modules into their JavaScript code, building on the Import Attributes proposal.
The primary use case is to load non-JS modules, such as JSON modules and CSS modules, making it highly relevant for modern web development.
With CSS, the result of importing a CSS file would be a constructable stylesheet, directly usable within the DOM API.
JSON modules do not support named exports, as the proposal champions opted against allowing them for simplicity and consistency.
Read at InfoQ
[
|
]