Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: extended typescript support #1349

Merged
merged 1 commit into from
Oct 1, 2024
Merged

feat: extended typescript support #1349

merged 1 commit into from
Oct 1, 2024

Conversation

kirrg001
Copy link
Contributor

@kirrg001 kirrg001 commented Sep 30, 2024

Problems:

import instana from '@instana/collector';
console.log('instana', instana);
instana: undefined

No declaration file was found for the module "@instana/collector." "node_modules/@instana/collector/src/index.js" implicitly has an "any" type.

Explanations

Typescript could not load our in-code typedefs. We had to provide types files.
We had no definitions for exported functions.

The PR is a beginning. We need to do much more. Raised a new ticket.

Works

import * as instana from '@instana/collector'
import instana from '@instana/collector'

Raised

https://jsw.ibm.com/browse/INSTA-15926
https://jsw.ibm.com/browse/INSTA-15926

Tasks

  • fix tests
  • add test

@kirrg001 kirrg001 changed the title feat: added typescript support for esm apps feat: extended typescript support (esm) Sep 30, 2024
- added typescript files
- optimized exports
@kirrg001 kirrg001 marked this pull request as ready for review September 30, 2024 19:40
@kirrg001 kirrg001 requested a review from a team as a code owner September 30, 2024 19:40
@kirrg001
Copy link
Contributor Author

kirrg001 commented Sep 30, 2024

@aryamohanan @abhilash-sivan

For testing:
instana-collector-3.19.0.tgz
instana-core-3.19.0.tgz

See new test app.
I have added to our test env.
You can simply create a new project with typescript as dependency and build a app.ts.

@kirrg001 kirrg001 changed the title feat: extended typescript support (esm) feat: extended typescript support Sep 30, 2024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Can we exclude compiled js files from the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we could do that. Lets do that after the release 👍

Copy link
Contributor

@aryamohanan aryamohanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🤞

@kirrg001 kirrg001 merged commit 3b8abea into main Oct 1, 2024
1 check passed
@kirrg001 kirrg001 deleted the fix-esm-types branch October 1, 2024 07:54
aryamohanan pushed a commit that referenced this pull request Oct 4, 2024
- added typescript .d.ts files
- optimized exports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants