Description
This is a tracking issue for the work to add native ESM support for new Node versions and direct <script type="module">
references for the @apollo/client
package.
This would probably mean adding "type": "module"
to package.json
files and potentially exports fields. It may also include changes to the build system and package artifacts. It is potentially a breaking change for unwitting developers who have imported files which we never intended to export.
Maybe this is a low priority, especially given most bundlers and front-end tools conflate and handle CommonJS and ESModules out of box, and I’m not sure what percentage of users import apollo-client
from ESM-capable node versions. Maybe someone doing SSR?
Also note that this is a risky change to the codebase which will cause outages if we don’t dot our t’s and cross our i’s. See https://javascript.plainenglish.io/is-promise-post-mortem-cab807f18dcc, for instance.