opentelemetry-js
opentelemetry-js copied to clipboard
NodeJS/ESM Compliance - use import/export file extensions
Is your feature request related to a problem? Please describe.
Projects using the modern module resolution algorithm in NodeJS require local import and export statements to suffix the file extension.
Describe the solution you'd like
Forcing projects to use NodeNext as the module resolution setting in each packages tsconfig.json file will enforce this rule.
Additional context
This will be come more and more pertinent as CJS is slowly dying
This requires an update to typescript 5+ which is already on our radar for SDK 2.0 in the next branch https://github.com/open-telemetry/opentelemetry-js/pull/4323
We'll have to consider how to deal with the API since we're not planning to make a major version bump there and upgrading our Typescript version may break some users.
I really think everyone needs to start dropping support for eol Node versions. It's just holding the whole community back.
Unfortunately we're beholden to the needs of our users. If we drop support for old versions it forces our users to upgrade as well. As I said, we're going ahead with this with the SDK 2.0. I'm not saying we won't move forward with the API as well, but it needs to be thoroughly considered.
Unfortunately, we have no real way of knowing:
- What version of node our users are on
- What version of typescript our users are on
- If our users would upgrade the above if required by us
- How painful that upgrade would be
- How many users would either drop otel or stay on old unsupported versions
Once 2.0 is released, we may have a better idea of the answers to the above questions depending on the adoption rate. If users quickly migrate from the 1.x line to the 2.x line, we will know they are at least on the runtimes supported by that and it will give us some idea as to the safety of migrating the API in a minor version release.
I believe this to be related https://github.com/open-telemetry/opentelemetry-js/issues/4437
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
Not stale.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This is still a thing that should be considered.