Add clarification for otel-js apps written in CJS and ESM
Node.js has two module systems: CommonJS(CJS) and ECMAScript modules(ESM). As ESM becomes more common in usage, we need to better document the current assumptions and requirements.
This is a start with the bare minimum, which is to specify the assumption that the app is running as CJS... as well as document the loader hook currently required for ESM apps. It seemed useful to start here based on issues like #4812.
- Refs: https://github.com/open-telemetry/opentelemetry-js/issues/4845
- Replaces #5072
I've incorporated the feedback from the original PR, and created new as I wasn't sure what would be easiest to review. Happy to reopen the old if that's better.
/fix:refcache
✅ fix:refcache applied successfully in run 20334630470.