open-telemetry / opentelemetry-js

OpenTelemetry JavaScript Client
https://opentelemetry.io
Apache License 2.0
2.72k stars 792 forks source link

NodeJS/ESM Compliance - use import/export file extensions #4396

Open sachaw opened 9 months ago

sachaw commented 9 months ago

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

dyladan commented 9 months ago

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.

sachaw commented 9 months ago

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

dyladan commented 9 months ago

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.

gajus commented 9 months ago

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

github-actions[bot] commented 7 months ago

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.

jaydenseric commented 6 months ago

Not stale.

github-actions[bot] commented 4 months ago

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.

martabitbrain commented 3 months ago

This is still a thing that should be considered.

github-actions[bot] commented 4 weeks ago

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.