opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

NodeJS/ESM Compliance - use import/export file extensions

Open sachaw opened this issue 1 year ago • 9 comments

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

sachaw avatar Jan 02 '24 04:01 sachaw

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.

dyladan avatar Jan 03 '24 20:01 dyladan

I really think everyone needs to start dropping support for eol Node versions. It's just holding the whole community back.

sachaw avatar Jan 04 '24 00:01 sachaw

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:

  1. What version of node our users are on
  2. What version of typescript our users are on
  3. If our users would upgrade the above if required by us
  4. How painful that upgrade would be
  5. 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.

dyladan avatar Jan 05 '24 18:01 dyladan

I believe this to be related https://github.com/open-telemetry/opentelemetry-js/issues/4437

gajus avatar Jan 23 '24 22:01 gajus

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.

github-actions[bot] avatar Mar 25 '24 06:03 github-actions[bot]

Not stale.

jaydenseric avatar Apr 04 '24 23:04 jaydenseric

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.

github-actions[bot] avatar Jun 17 '24 06:06 github-actions[bot]

This is still a thing that should be considered.

martabitbrain avatar Jun 26 '24 08:06 martabitbrain