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

fix(javascript): keep comments and jsdoc in build #307

Merged
merged 2 commits into from
Mar 31, 2022

Conversation

shortcuts
Copy link
Member

@shortcuts shortcuts commented Mar 29, 2022

🧭 What and Why

🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-400

Changes included:

Comments and JSDoc were removed in the build, which makes the autocompletion poorer.

Comments

This was just an option to change in the tsconfig.json. There's a huge impact on the size of the common package, but types needs to be checked due to many duplicates, so it's fine in the meantime.

JSDoc

TS Playground for reproduction

At build time, methods returned in an object loses JSDoc, but does not when inlined in the object. I've went with this solution for now as it's the one if the smallest footprint but alternatives are:

  • Keeping this solution until a fix on the TS side
  • Using classes, which would change (forever, as we don't want to break everything multiple times) the usage of our client
    • I don't see the need as this solution work, but if you have arguments please share them

Opened an issue on TypeScript: microsoft/TypeScript#48495

🧪 Test

CI :D

@shortcuts shortcuts self-assigned this Mar 29, 2022
@netlify
Copy link

netlify bot commented Mar 29, 2022

Deploy Preview for api-clients-automation canceled.

Name Link
🔨 Latest commit 54fe8d0
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/62456a244293390008f88ddd

@algolia-bot
Copy link
Collaborator

algolia-bot commented Mar 29, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the generated/main branch.

Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

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

looks good, This PR should possibly be linked from an issue on typescript mentioning that the comments get removed even though they shouldn't?

@shortcuts shortcuts requested review from a team, eunjae-lee and damcou and removed request for a team March 30, 2022 09:39
Copy link
Contributor

@eunjae-lee eunjae-lee left a comment

Choose a reason for hiding this comment

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

I think it makes sense. But as Haroen mentioned, do you have a link to the GH issue in TS? It'd be good to tag the issue in this PR, so that we can have a reference to update it in the future when TS rolls out the fix.

@shortcuts
Copy link
Member Author

This PR should possibly be linked from an issue on typescript mentioning that the comments get removed even though they shouldn't?

do you have a link to the GH issue in TS?

I did not had time to open the GH issue yet, will check their open ones and open it if it does not exists

@shortcuts
Copy link
Member Author

I've created an issue @eunjae-lee @Haroenv microsoft/TypeScript#48495

If you have changes to propose to it, lmk!

@shortcuts shortcuts merged commit 7cd51e2 into main Mar 31, 2022
@shortcuts shortcuts deleted the fix/javascript-comments-jsdoc branch March 31, 2022 09:58
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Mar 31, 2022
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.

5 participants